Skip to content

[Driver] Remove unused runtime library path on non-Darwin platforms #66546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Driver/ToolChains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,8 @@ void ToolChain::getRuntimeLibraryPaths(SmallVectorImpl<std::string> &runtimeLibP
if (!scratchPath.empty())
runtimeLibPaths.push_back(std::string(scratchPath.str()));

if (!SDKPath.empty()) {
// Only Darwin places libraries directly in /sdk/usr/lib/swift/.
if (Triple.isOSDarwin() && !SDKPath.empty()) {
if (!scratchPath.empty()) {
// If we added the secondary resource dir, we also need the iOSSupport
// directory.
Expand Down
3 changes: 3 additions & 0 deletions test/Driver/options-interpreter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
// CHECK-COMPLEX-DAG: DYLD_FRAMEWORK_PATH=/foo/:/bar/:/abc/{{$| }}
// CHECK-COMPLEX-DAG: DYLD_LIBRARY_PATH={{/foo2/:/bar2/:[^:]+/lib/swift/macosx:/sdkroot/usr/lib/swift($| )}}

// RUN: %swift_driver_plain -sdk /sdk -### -target aarch64-unknown-linux-gnu %s | %FileCheck -check-prefix=CHECK-RUNTIME-LIBRARY-PATH %s
// CHECK-RUNTIME-LIBRARY-PATH-NOT: # LD_LIBRARY_PATH=/sdk/usr/lib/swift/linux:/sdk/usr/lib/swift

// 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
// CHECK-L-LINUX: # LD_LIBRARY_PATH={{/foo/:[^:]+/lib/swift/linux$}}
// CHECK-L-LINUX_LAX: # LD_LIBRARY_PATH={{/foo/:[^:]+/lib/swift/linux($|:)}}
Expand Down