Skip to content

Commit 3e72ef6

Browse files
nwf-msrdavidchisnall
authored andcommitted
NFC: cmake: add SNMALLOC_LINK_ICF, default on
ICF currently breaks building on Morello, so allow cmake to notch it out.
1 parent da19291 commit 3e72ef6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ option(SNMALLOC_USE_CXX17 "Build as C++17 for legacy support." OFF)
1818
option(SNMALLOC_TRACING "Enable large quantities of debug output." OFF)
1919
option(SNMALLOC_NO_REALLOCARRAY "Build without reallocarray exported" ON)
2020
option(SNMALLOC_NO_REALLOCARR "Build without reallocarr exported" ON)
21+
option(SNMALLOC_LINK_ICF "Link with Identical Code Folding" ON)
2122
# Options that apply only if we're not building the header-only library
2223
cmake_dependent_option(SNMALLOC_RUST_SUPPORT "Build static library for rust" OFF "NOT SNMALLOC_HEADER_ONLY_LIBRARY" OFF)
2324
cmake_dependent_option(SNMALLOC_STATIC_LIBRARY "Build static libraries" ON "NOT SNMALLOC_HEADER_ONLY_LIBRARY" OFF)
@@ -318,7 +319,7 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY)
318319
endif()
319320
endif()
320321
# Remove all the duplicate new/malloc and free/delete definitions
321-
target_link_options(${name} PRIVATE $<$<BOOL:${LLD_WORKS}>:-Wl,--icf=all -fuse-ld=lld>)
322+
target_link_options(${name} PRIVATE $<$<BOOL:${LLD_WORKS}>:$<$<BOOL:${SNMALLOC_LINK_ICF}>:-Wl,--icf=all> -fuse-ld=lld>)
322323
endif()
323324

324325
target_compile_definitions(${name} PRIVATE

0 commit comments

Comments
 (0)