Skip to content

Commit 03ca228

Browse files
authored
Merge pull request #8863 from al45tair/cherry-pick-8255
[Build] Turn off -undefined-version when building with lld
2 parents d945d25 + c5ebedd commit 03ca228

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
@@ -296,6 +296,12 @@ if (NOT DEFINED LLVM_LINKER_DETECTED AND NOT WIN32)
296296
endif()
297297

298298
function(add_link_opts target_name)
299+
# Newer lld defaults to no-undefined-version, which we don't expect
300+
if(LLVM_LINKER_IS_LLD)
301+
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
302+
LINK_FLAGS " -Wl,-undefined-version")
303+
endif()
304+
299305
get_llvm_distribution(${target_name} in_distribution in_distribution_var)
300306
if(NOT in_distribution)
301307
# Don't LTO optimize targets that aren't part of any distribution.

0 commit comments

Comments
 (0)