forked from OSchip/llvm-project
[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
This commit is contained in:
parent
003fed8269
commit
1613ab8a4a
|
@ -48,7 +48,7 @@ if (LIBCXX_SUPPORTS_NOSTDLIBXX_FLAG OR LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
|
|||
list(APPEND CMAKE_REQUIRED_LIBRARIES c)
|
||||
endif ()
|
||||
if (LIBCXX_USE_COMPILER_RT)
|
||||
list(APPEND CMAKE_REQUIRED_FLAGS -rtlib=compiler-rt)
|
||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -rtlib=compiler-rt")
|
||||
find_compiler_rt_library(builtins LIBCXX_BUILTINS_LIBRARY)
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBCXX_BUILTINS_LIBRARY}")
|
||||
elseif (LIBCXX_HAS_GCC_LIB)
|
||||
|
|
|
@ -38,7 +38,7 @@ if (LIBCXXABI_SUPPORTS_NOSTDLIBXX_FLAG OR LIBCXXABI_SUPPORTS_NODEFAULTLIBS_FLAG)
|
|||
list(APPEND CMAKE_REQUIRED_LIBRARIES c)
|
||||
endif ()
|
||||
if (LIBCXXABI_USE_COMPILER_RT)
|
||||
list(APPEND CMAKE_REQUIRED_FLAGS -rtlib=compiler-rt)
|
||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -rtlib=compiler-rt")
|
||||
find_compiler_rt_library(builtins LIBCXXABI_BUILTINS_LIBRARY)
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBCXXABI_BUILTINS_LIBRARY}")
|
||||
else ()
|
||||
|
|
Loading…
Reference in New Issue