Skip to content

Commit 2ce432e

Browse files
authored
Merge pull request swiftlang#8255 from al45tair/eng/PR-123436280
[Build] Turn off -undefined-version when building with lld
2 parents 0be69e9 + cb1aa8a commit 2ce432e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@ if (NOT DEFINED LLVM_LINKER_DETECTED AND NOT WIN32)
254254
endif()
255255

256256
function(add_link_opts target_name)
257+
# Newer lld defaults to no-undefined-version, which we don't expect
258+
if(LLVM_LINKER_IS_LLD)
259+
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
260+
LINK_FLAGS " -Wl,-undefined-version")
261+
endif()
262+
257263
get_llvm_distribution(${target_name} in_distribution in_distribution_var)
258264
if(NOT in_distribution)
259265
# Don't LTO optimize targets that aren't part of any distribution.

0 commit comments

Comments
 (0)