Skip to content

Commit 18da29d

Browse files
antonmesGreg Parker
authored andcommitted
[FreeBSD] Fix undefined references to __atomic*
1 parent 735fd36 commit 18da29d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,11 @@ function(add_swift_library name)
15311531
if("${sdk}" STREQUAL "ANDROID")
15321532
list(APPEND swiftlib_private_link_libraries_targets
15331533
"-latomic")
1534+
# the same issue on FreeBSD, missing symbols:
1535+
# __atomic_store, __atomic_compare_exchange, __atomic_load
1536+
elseif("${sdk}" STREQUAL "FREEBSD")
1537+
list(APPEND swiftlib_private_link_libraries_targets
1538+
"${SWIFTLIB_DIR}/clang/lib/freebsd/libclang_rt.builtins-${arch}.a")
15341539
endif()
15351540
elseif("${lib}" STREQUAL "ICU_I18N")
15361541
list(APPEND swiftlib_private_link_libraries_targets

0 commit comments

Comments
 (0)