Skip to content

Use -Xlinker forwarding instead of the SWIFTPM_EMBED_RPATH env-var #172

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
Mar 5, 2016
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
11 changes: 0 additions & 11 deletions Sources/Build/misc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ func platformArgs() -> [String] {
}
#endif

// We support a custom override in conjunction with the
// bootstrap script to allow embedding an appropriate RPATH for
// the package manager tools themselves on Linux, so they can be
// relocated with the Swift compiler.

//TODO replace with -Xlinker forwarding since we have that now

if let rpath = getenv("SWIFTPM_EMBED_RPATH") {
args += ["-Xlinker", "-rpath", "-Xlinker", rpath]
}

return args
}

Expand Down
8 changes: 5 additions & 3 deletions Utilities/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -532,12 +532,14 @@ def main():
"SWIFT_BUILD_PATH=" + build_path]
if args.sysroot:
env_cmd.append("SYSROOT=" + args.sysroot)
# On Linux, we need to embed an RPATH so swift-{build,get} can find the core

# We need to embed an RPATH so swift-{build,test} can find the core
# libraries.
if platform.system() == 'Linux':
env_cmd.append("SWIFTPM_EMBED_RPATH=$ORIGIN/../lib/swift/linux")
embed_rpath = "$ORIGIN/../lib/swift/linux"
else:
env_cmd.append("SWIFTPM_EMBED_RPATH=@executable_path/../lib/swift/macosx")
embed_rpath = "@executable_path/../lib/swift/macosx"
cmd.extend(["-Xlinker", "-rpath", "-Xlinker", embed_rpath])

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