Skip to content

Commit a9a42ca

Browse files
committed
Applied suggested Linux rpath workaround from PR
1 parent afd4c04 commit a9a42ca

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
@@ -755,7 +755,7 @@ def get_swiftpm_flags(args):
755755
swift_library_rpath_prefix = "$ORIGIN/../"
756756
platform_path = None
757757
for path in args.target_info["paths"]["runtimeLibraryPaths"]:
758-
platform_path = re.search(r"(lib/swift/[^/]+)$", path)
758+
platform_path = re.search(r"(lib/swift/([^/]+))$", path)
759759
if platform_path:
760760
build_flags.extend(
761761
[
@@ -765,6 +765,15 @@ def get_swiftpm_flags(args):
765765
swift_library_rpath_prefix + platform_path.group(1),
766766
]
767767
)
768+
if platform.system() == 'Linux':
769+
build_flags.extend(
770+
[
771+
"-Xlinker",
772+
"-rpath",
773+
"-Xlinker",
774+
swift_library_rpath_prefix + '../' + platform_path.group(2),
775+
]
776+
)
768777
break
769778

770779
if not platform_path:

0 commit comments

Comments
 (0)