Skip to content

Commit a4a3560

Browse files
authored
Merge pull request #66745 from finagolfin/release/5.9
[5.9][Driver] Remove unused runtime library path on non-Darwin platforms
2 parents 8fba23f + 1af6cf7 commit a4a3560

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/Driver/ToolChains.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,8 @@ void ToolChain::getRuntimeLibraryPaths(SmallVectorImpl<std::string> &runtimeLibP
15131513
if (!scratchPath.empty())
15141514
runtimeLibPaths.push_back(std::string(scratchPath.str()));
15151515

1516-
if (!SDKPath.empty()) {
1516+
// Only Darwin places libraries directly in /sdk/usr/lib/swift/.
1517+
if (Triple.isOSDarwin() && !SDKPath.empty()) {
15171518
if (!scratchPath.empty()) {
15181519
// If we added the secondary resource dir, we also need the iOSSupport
15191520
// directory.

test/Driver/options-interpreter.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
// CHECK-COMPLEX-DAG: DYLD_FRAMEWORK_PATH=/foo/:/bar/:/abc/{{$| }}
5959
// CHECK-COMPLEX-DAG: DYLD_LIBRARY_PATH={{/foo2/:/bar2/:[^:]+/lib/swift/macosx:/sdkroot/usr/lib/swift($| )}}
6060

61+
// RUN: %swift_driver_plain -sdk /sdk -### -target aarch64-unknown-linux-gnu %s | %FileCheck -check-prefix=CHECK-RUNTIME-LIBRARY-PATH %s
62+
// CHECK-RUNTIME-LIBRARY-PATH-NOT: # LD_LIBRARY_PATH=/sdk/usr/lib/swift/linux:/sdk/usr/lib/swift
63+
6164
// RUN: %swift_driver_plain -sdk "" -### -target x86_64-unknown-linux-gnu -L/foo/ %s | %FileCheck -check-prefix=CHECK-L-LINUX${LD_LIBRARY_PATH+_LAX} %s
6265
// CHECK-L-LINUX: # LD_LIBRARY_PATH={{/foo/:[^:]+/lib/swift/linux$}}
6366
// CHECK-L-LINUX_LAX: # LD_LIBRARY_PATH={{/foo/:[^:]+/lib/swift/linux($|:)}}

0 commit comments

Comments
 (0)