Skip to content

Commit e4b93ef

Browse files
committed
Use -Xlinker forwarding instead of the SWIFTPM_EMBED_RPATH env-var
1 parent 082336a commit e4b93ef

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

Sources/Build/misc.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,6 @@ func platformArgs() -> [String] {
2323
}
2424
#endif
2525

26-
// We support a custom override in conjunction with the
27-
// bootstrap script to allow embedding an appropriate RPATH for
28-
// the package manager tools themselves on Linux, so they can be
29-
// relocated with the Swift compiler.
30-
31-
//TODO replace with -Xlinker forwarding since we have that now
32-
33-
if let rpath = getenv("SWIFTPM_EMBED_RPATH") {
34-
args += ["-Xlinker", "-rpath", "-Xlinker", rpath]
35-
}
36-
3726
return args
3827
}
3928

Utilities/bootstrap

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,12 +532,14 @@ def main():
532532
"SWIFT_BUILD_PATH=" + build_path]
533533
if args.sysroot:
534534
env_cmd.append("SYSROOT=" + args.sysroot)
535-
# On Linux, we need to embed an RPATH so swift-{build,get} can find the core
535+
536+
# We need to embed an RPATH so swift-{build,test} can find the core
536537
# libraries.
537538
if platform.system() == 'Linux':
538-
env_cmd.append("SWIFTPM_EMBED_RPATH=$ORIGIN/../lib/swift/linux")
539+
embed_rpath = "$ORIGIN/../lib/swift/linux"
539540
else:
540-
env_cmd.append("SWIFTPM_EMBED_RPATH=@executable_path/../lib/swift/macosx")
541+
embed_rpath = "@executable_path/../lib/swift/macosx"
542+
cmd.extend(["-Xlinker", "-rpath", "-Xlinker", embed_rpath])
541543

542544
cmd = [os.path.join(sandbox_path, "bin", "swift-build")]
543545
if args.xctest_path:

0 commit comments

Comments
 (0)