Skip to content

Commit 2c4d4e7

Browse files
authored
Adjust rpaths for release builds (#5718)
For release builds, we want the rpath to Swift compatibility libs to be relative to our executable.
1 parent e3a61c0 commit 2c4d4e7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Utilities/bootstrap

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,13 @@ def add_rpath_for_cmake_build(args, rpath):
562562
def get_swift_backdeploy_library_paths(args):
563563
if platform.system() == 'Darwin':
564564
# Need to include backwards compatibility libraries for Concurrency
565-
# FIXME: Would be nice if we could get this from `swiftc -print-target-info`
566-
return ['/usr/lib/swift', args.target_info["paths"]["runtimeLibraryPaths"][0] + '/../../swift-5.5/macosx']
565+
if args.release:
566+
# For release builds, we need a relative path that finds the compatibility libs in the current toolchain.
567+
backdeploy_path = '@executable_path/../lib/swift-5.5/macosx'
568+
else:
569+
# FIXME: Would be nice if we could get this from `swiftc -print-target-info`
570+
backdeploy_path = args.target_info["paths"]["runtimeLibraryPaths"][0] + '/../../swift-5.5/macosx'
571+
return ['/usr/lib/swift', backdeploy_path]
567572
else:
568573
return []
569574

0 commit comments

Comments
 (0)