Skip to content

Commit c24d0a5

Browse files
authored
FreeBSD: Fix docc rpath (#1228)
The docc rpath on FreeBSD included the OS version number, but the runtimes are not installed to that location resulting in the binary failing to launch. This fixes it to search in the correct place for the Swift runtime libraries.
1 parent fc79e78 commit c24d0a5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

build-script-helper.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ def get_swiftpm_options(action, args):
166166
# is not available.
167167
'-Xlinker', '-rpath', '-Xlinker', '@executable_path/../lib/swift/macosx',
168168
]
169+
elif build_os.startswith('freebsd'):
170+
# FreeBSD triples include the OS version number.
171+
# The swift runtime library install location does not, resulting in a docc
172+
# that fails to launch.
173+
swiftpm_args += [
174+
# Library rpath for swift, dispatch, Foundation, etc. when installing
175+
'-Xlinker', '-rpath', '-Xlinker', '$ORIGIN/../lib/swift/freebsd',
176+
]
177+
if action == 'install':
178+
swiftpm_args += ['--disable-local-rpath']
169179
else:
170180
swiftpm_args += [
171181
# Library rpath for swift, dispatch, Foundation, etc. when installing

0 commit comments

Comments
 (0)