Skip to content

Commit 1613ab8

Browse files
nehaljwanimordante
authored andcommitted
[libcxx][libcxxabi] CMAKE_REQUIRED_FLAGS is a string, not a list
When `libcxx` or `libcxxabi` is built with `-DLLVM_USE_SANITIZER=MemoryWithOrigins` **and** `-DLIBCXX[ABI]_USE_COMPILER_RT=ON`, all of the `LIBCXX[ABI]_SUPPORTS_*_FLAG` checks fail, since the value of `CMAKE_REQUIRED_FLAGS` is not set correctly. Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=51774 Reviewed By: #libc, #libc_abi, compnerd, ldionne Differential Revision: https://reviews.llvm.org/D109342
1 parent 003fed8 commit 1613ab8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libcxx/cmake/config-ix.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ if (LIBCXX_SUPPORTS_NOSTDLIBXX_FLAG OR LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
4848
list(APPEND CMAKE_REQUIRED_LIBRARIES c)
4949
endif ()
5050
if (LIBCXX_USE_COMPILER_RT)
51-
list(APPEND CMAKE_REQUIRED_FLAGS -rtlib=compiler-rt)
51+
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -rtlib=compiler-rt")
5252
find_compiler_rt_library(builtins LIBCXX_BUILTINS_LIBRARY)
5353
list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBCXX_BUILTINS_LIBRARY}")
5454
elseif (LIBCXX_HAS_GCC_LIB)

libcxxabi/cmake/config-ix.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if (LIBCXXABI_SUPPORTS_NOSTDLIBXX_FLAG OR LIBCXXABI_SUPPORTS_NODEFAULTLIBS_FLAG)
3838
list(APPEND CMAKE_REQUIRED_LIBRARIES c)
3939
endif ()
4040
if (LIBCXXABI_USE_COMPILER_RT)
41-
list(APPEND CMAKE_REQUIRED_FLAGS -rtlib=compiler-rt)
41+
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -rtlib=compiler-rt")
4242
find_compiler_rt_library(builtins LIBCXXABI_BUILTINS_LIBRARY)
4343
list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBCXXABI_BUILTINS_LIBRARY}")
4444
else ()

0 commit comments

Comments
 (0)