From 4af11272f57a4a6fed2932e9e0857b2c1a707c51 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 18 Jan 2022 23:34:54 +0000 Subject: [cmake] Duplicate `{llvm,compiler_rt}_check_linker_flag` for runtime libs and llvm We previously had a few varied definitions of this floating around. I made the one installed with LLVM handle all the cases, and then made the others use it. This issue was reported to me in https://reviews.llvm.org/D116521#3248117 as D116521 made clang and llvm use the common cmake utils. Reviewed By: sebastian-ne, phosek, #libunwind, #libc, #libc_abi, ldionne Differential Revision: https://reviews.llvm.org/D117537 --- runtimes/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtimes') diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt index cedce7b3541e..1a50d9e8c98b 100644 --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -88,7 +88,7 @@ set(LLVM_CMAKE_DIR ${LLVM_MAIN_SRC_DIR}/cmake/modules) set(LLVM_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../llvm) include(CheckLibraryExists) -include(CheckLinkerFlag) +include(LLVMCheckLinkerFlag) # Compat until CMake 3.18 include(CheckCCompilerFlag) include(CheckCXXCompilerFlag) @@ -100,7 +100,7 @@ if (NOT LLVM_RUNTIMES_LINKING_WORKS) # --unwindlib=none is supported, and use that if possible. # Don't add this if not necessary to fix linking, as it can break using # e.g. ASAN/TSAN. - llvm_check_linker_flag("--unwindlib=none" LLVM_RUNTIMES_SUPPORT_UNWINDLIB_NONE_FLAG) + llvm_check_linker_flag(C "--unwindlib=none" LLVM_RUNTIMES_SUPPORT_UNWINDLIB_NONE_FLAG) if (LLVM_RUNTIMES_SUPPORT_UNWINDLIB_NONE_FLAG) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} --unwindlib=none") endif() @@ -110,7 +110,7 @@ endif() # Check for -nostdlib++ first; if there's no C++ standard library yet, # all check_cxx_compiler_flag commands will fail until we add -nostdlib++ # (or -nodefaultlibs). -llvm_check_linker_flag(-nostdlib++ LLVM_RUNTIMES_SUPPORT_NOSTDLIBXX_FLAG) +llvm_check_linker_flag(C "-nostdlib++" LLVM_RUNTIMES_SUPPORT_NOSTDLIBXX_FLAG) if (LLVM_RUNTIMES_SUPPORT_NOSTDLIBXX_FLAG) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdlib++") endif() -- cgit v1.2.1