From 4eb3f2d3fa5b3dc9574d6163602a55f1629c0dcb Mon Sep 17 00:00:00 2001 From: 3405691582 Date: Sat, 30 Aug 2025 21:24:55 -0400 Subject: [PATCH] Use the unversioned subdirectory in the rpath. While we use versioned subdirectory triples for Swift module paths, this part of the rpath should be unversioned, if at the very least, for consistency. While we are here, ensure that -z origin is used when linking, which is necessary for ORIGIN processing. --- Utilities/build-script-helper.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Utilities/build-script-helper.py b/Utilities/build-script-helper.py index ee1610008..1509f93bd 100755 --- a/Utilities/build-script-helper.py +++ b/Utilities/build-script-helper.py @@ -110,6 +110,11 @@ def get_swiftpm_options(args): swiftpm_args += [ '-Xlinker', '-rpath', '-Xlinker', '$ORIGIN/../lib/swift/freebsd', ] + elif '-openbsd' in args.build_target: + swiftpm_args += [ + '-Xlinker', '-rpath', '-Xlinker', '$ORIGIN/../lib/swift/openbsd', + '-Xlinker', '-z', '-Xlinker', 'origin', + ] else: # Library rpath for swift, dispatch, Foundation, etc. when installing swiftpm_args += [