Skip to content

Commit d14b759

Browse files
ilovepipetrhosek
authored andcommitted
[Fuchsia][cmake] Avoid referencing cxx_shared in compiler-rt (llvm#112257)
After llvm#80007 Fuchsia builds are now always building cxx_shared for arm64 and x64 Linux. Ultimately, this is because the LIBCXX_ENABLE_SHARED is not used in compiler-rt to select the correct libc++ target, and because cxx_shared is now always defined, it is selected as a dependency when building runtimes tests. --------- Co-authored-by: Petr Hosek <[email protected]>
1 parent 727b442 commit d14b759

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

compiler-rt/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ if(COMPILER_RT_USE_LLVM_UNWINDER)
621621
if (COMPILER_RT_ENABLE_STATIC_UNWINDER)
622622
list(APPEND COMPILER_RT_UNWINDER_LINK_LIBS "$<TARGET_LINKER_FILE:unwind_static>")
623623
else()
624-
list(APPEND COMPILER_RT_UNWINDER_LINK_LIBS "$<TARGET_LINKER_FILE:$<IF:$<TARGET_EXISTS:unwind_shared>,unwind_shared,unwind_static>>")
624+
list(APPEND COMPILER_RT_UNWINDER_LINK_LIBS "$<TARGET_LINKER_FILE:$<IF:$<BOOL:${LIBUNWIND_ENABLE_SHARED}>,unwind_shared,unwind_static>>")
625625
endif()
626626
endif()
627627

@@ -634,7 +634,7 @@ if (COMPILER_RT_CXX_LIBRARY STREQUAL "libcxx")
634634
if (COMPILER_RT_STATIC_CXX_LIBRARY)
635635
set(COMPILER_RT_CXX_LINK_LIBS "$<TARGET_LINKER_FILE:cxx_static>")
636636
else()
637-
set(COMPILER_RT_CXX_LINK_LIBS "$<TARGET_LINKER_FILE:$<IF:$<TARGET_EXISTS:cxx_shared>,cxx_shared,cxx_static>>")
637+
set(COMPILER_RT_CXX_LINK_LIBS "$<TARGET_LINKER_FILE:$<IF:$<BOOL:${LIBCXX_ENABLE_SHARED}>,cxx_shared,cxx_static>>")
638638
endif()
639639
elseif (COMPILER_RT_CXX_LIBRARY STREQUAL "none")
640640
# We aren't using any C++ standard library so avoid including the default one.
@@ -676,7 +676,7 @@ if (SANITIZER_TEST_CXX_LIBNAME STREQUAL "libc++")
676676
if (SANITIZER_USE_STATIC_TEST_CXX)
677677
list(APPEND SANITIZER_TEST_CXX_LIBRARIES "$<TARGET_LINKER_FILE:cxx_static>")
678678
else()
679-
list(APPEND SANITIZER_TEST_CXX_LIBRARIES "$<TARGET_LINKER_FILE:$<IF:$<TARGET_EXISTS:cxx_shared>,cxx_shared,cxx_static>>")
679+
list(APPEND SANITIZER_TEST_CXX_LIBRARIES "$<TARGET_LINKER_FILE:$<IF:$<BOOL:${LIBCXX_ENABLE_SHARED}>,cxx_shared,cxx_static>>")
680680
endif()
681681
# We are using the in tree libc++ so avoid including the default one.
682682
append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ COMPILER_RT_UNITTEST_CFLAGS)

compiler-rt/test/fuzzer/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ endmacro()
7373

7474
test_fuzzer("default")
7575
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
76-
if(TARGET cxx_shared)
76+
if(LIBCXX_ENABLE_SHARED)
7777
test_fuzzer("libc++" DEPS cxx_shared)
7878
endif()
79-
if(TARGET cxx_static)
79+
if(LIBCXX_ENABLE_STATIC)
8080
test_fuzzer("static-libc++" DEPS cxx_static)
8181
endif()
8282
endif()

0 commit comments

Comments
 (0)