Skip to content

Commit 078a755

Browse files
committed
Applied suggested Linux rpath workaround from PR
1 parent a61de56 commit 078a755

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Utilities/bootstrap

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ def get_swiftpm_flags(args):
757757
swift_library_rpath_prefix = "$ORIGIN/../"
758758
platform_path = None
759759
for path in args.target_info["paths"]["runtimeLibraryPaths"]:
760-
platform_path = re.search(r"(lib/swift/[^/]+)$", path)
760+
platform_path = re.search(r"(lib/swift/([^/]+))$", path)
761761
if platform_path:
762762
build_flags.extend(
763763
[
@@ -767,6 +767,15 @@ def get_swiftpm_flags(args):
767767
swift_library_rpath_prefix + platform_path.group(1),
768768
]
769769
)
770+
if platform.system() == 'Linux':
771+
build_flags.extend(
772+
[
773+
"-Xlinker",
774+
"-rpath",
775+
"-Xlinker",
776+
swift_library_rpath_prefix + '../' + platform_path.group(2),
777+
]
778+
)
770779
break
771780

772781
if not platform_path:

0 commit comments

Comments
 (0)