summaryrefslogtreecommitdiff
path: root/runtimes
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-01-18 23:34:54 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-01-20 21:18:42 +0000
commit4af11272f57a4a6fed2932e9e0857b2c1a707c51 (patch)
treec50b4cef24904dd73eecae5dd9b364f40ab37257 /runtimes
parent8c9f62ea90c70d538766a81ef5980c9223b8566b (diff)
downloadllvm-4af11272f57a4a6fed2932e9e0857b2c1a707c51.tar.gz
[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
Diffstat (limited to 'runtimes')
-rw-r--r--runtimes/CMakeLists.txt6
1 files changed, 3 insertions, 3 deletions
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()