[compiler-rt] 601022f - Revert "[CMake][compiler-rt] Make CRT separately buildable"
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 7 23:59:56 PST 2022
Author: Petr Hosek
Date: 2022-03-07T23:59:29-08:00
New Revision: 601022fd96a8dd76d3f28b67d438e8ec1bf9ba71
URL: https://github.com/llvm/llvm-project/commit/601022fd96a8dd76d3f28b67d438e8ec1bf9ba71
DIFF: https://github.com/llvm/llvm-project/commit/601022fd96a8dd76d3f28b67d438e8ec1bf9ba71.diff
LOG: Revert "[CMake][compiler-rt] Make CRT separately buildable"
This reverts commit ed28461e2716fda004f4f55654ef33bc8c78f203 since
it broke the VE bot.
Added:
Modified:
compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
compiler-rt/cmake/Modules/CompilerRTUtils.cmake
compiler-rt/cmake/config-ix.cmake
compiler-rt/lib/crt/CMakeLists.txt
Removed:
compiler-rt/cmake/crt-config-ix.cmake
################################################################################
diff --git a/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake b/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
index bc4789dbe1009..3e86cf63c789b 100644
--- a/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
+++ b/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
@@ -27,6 +27,8 @@ set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86} ${X86_64} ${PPC64} ${RISCV64}
${HEXAGON})
set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9} ${HEXAGON})
+set(ALL_CRT_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC32}
+ ${PPC64} ${RISCV32} ${RISCV64} ${VE} ${HEXAGON})
set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64})
if(ANDROID)
diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index 829aa92920f0f..052095801aaed 100644
--- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -238,10 +238,6 @@ function(get_compiler_rt_root_source_dir ROOT_DIR_VAR)
# Compiler-RT Builtins standalone build.
# `llvm-project/compiler-rt/lib/builtins`
set(PATH_TO_COMPILER_RT_SOURCE_ROOT "${CompilerRTBuiltins_SOURCE_DIR}/../../")
- elseif (DEFINED CompilerRTCRT_SOURCE_DIR)
- # Compiler-RT CRT standalone build.
- # `llvm-project/compiler-rt/lib/crt`
- set(PATH_TO_COMPILER_RT_SOURCE_ROOT "${CompilerRTCRT_SOURCE_DIR}/../../")
elseif(DEFINED CompilerRT_SOURCE_DIR)
# Compiler-RT standalone build.
# `llvm-project/compiler-rt`
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index 2e965dfbc91e7..3ad2d6a932dba 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -611,6 +611,7 @@ if(APPLE)
SANITIZER_COMMON_SUPPORTED_ARCH)
else()
+ filter_available_targets(CRT_SUPPORTED_ARCH ${ALL_CRT_SUPPORTED_ARCH})
# Architectures supported by compiler-rt libraries.
filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH
${ALL_SANITIZER_COMMON_SUPPORTED_ARCH})
@@ -707,6 +708,12 @@ endif()
# TODO: Add builtins support.
+if (CRT_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux" AND NOT LLVM_USE_SANITIZER)
+ set(COMPILER_RT_HAS_CRT TRUE)
+else()
+ set(COMPILER_RT_HAS_CRT FALSE)
+endif()
+
if (COMPILER_RT_HAS_SANITIZER_COMMON AND DFSAN_SUPPORTED_ARCH AND
OS_NAME MATCHES "Linux")
set(COMPILER_RT_HAS_DFSAN TRUE)
diff --git a/compiler-rt/cmake/crt-config-ix.cmake b/compiler-rt/cmake/crt-config-ix.cmake
deleted file mode 100644
index 2ac25587e50a9..0000000000000
--- a/compiler-rt/cmake/crt-config-ix.cmake
+++ /dev/null
@@ -1,48 +0,0 @@
-include(BuiltinTests)
-include(CheckCSourceCompiles)
-
-# Make all the tests only check the compiler
-set(TEST_COMPILE_ONLY On)
-
-builtin_check_c_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG)
-builtin_check_c_compiler_flag(-std=c11 COMPILER_RT_HAS_STD_C11_FLAG)
-builtin_check_c_compiler_flag(-Wno-pedantic COMPILER_RT_HAS_WNO_PEDANTIC)
-builtin_check_c_compiler_flag(-fno-lto COMPILER_RT_HAS_FNO_LTO_FLAG)
-builtin_check_c_compiler_flag(-fno-profile-generate COMPILER_RT_HAS_FNO_PROFILE_GENERATE_FLAG)
-builtin_check_c_compiler_flag(-fno-profile-instr-generate COMPILER_RT_HAS_FNO_PROFILE_INSTR_GENERATE_FLAG)
-builtin_check_c_compiler_flag(-fno-profile-instr-use COMPILER_RT_HAS_FNO_PROFILE_INSTR_USE_FLAG)
-
-if(ANDROID)
- set(OS_NAME "Android")
-else()
- set(OS_NAME "${CMAKE_SYSTEM_NAME}")
-endif()
-
-set(ARM64 aarch64)
-set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k)
-set(X86 i386)
-set(X86_64 x86_64)
-set(RISCV32 riscv32)
-set(RISCV64 riscv64)
-set(VE ve)
-
-set(ALL_CRT_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV32} ${RISCV64} ${VE})
-
-include(CompilerRTUtils)
-
-if(NOT APPLE)
- if(COMPILER_RT_CRT_STANDALONE_BUILD)
- test_targets()
- endif()
- # Architectures supported by compiler-rt crt library.
- filter_available_targets(CRT_SUPPORTED_ARCH
- ${ALL_CRT_SUPPORTED_ARCH})
-
- if (CRT_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux" AND NOT LLVM_USE_SANITIZER)
- set(COMPILER_RT_HAS_CRT TRUE)
- else()
- set(COMPILER_RT_HAS_CRT FALSE)
- endif()
-endif()
-
-message(STATUS "Supported architectures for crt: ${CRT_SUPPORTED_ARCH}")
diff --git a/compiler-rt/lib/crt/CMakeLists.txt b/compiler-rt/lib/crt/CMakeLists.txt
index b1b0671a9793b..dc7dd17f8b1a9 100644
--- a/compiler-rt/lib/crt/CMakeLists.txt
+++ b/compiler-rt/lib/crt/CMakeLists.txt
@@ -1,35 +1,3 @@
-if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
- cmake_minimum_required(VERSION 3.13.4)
-
- set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
- project(CompilerRTCRT C)
- set(COMPILER_RT_STANDALONE_BUILD TRUE)
- set(COMPILER_RT_CRT_STANDALONE_BUILD TRUE)
-
- set(COMPILER_RT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..")
-
- set(LLVM_COMMON_CMAKE_UTILS "${COMPILER_RT_SOURCE_DIR}/../cmake")
-
- # Add path for custom modules
- list(INSERT CMAKE_MODULE_PATH 0
- "${COMPILER_RT_SOURCE_DIR}/cmake"
- "${COMPILER_RT_SOURCE_DIR}/cmake/Modules"
- "${LLVM_COMMON_CMAKE_UTILS}"
- "${LLVM_COMMON_CMAKE_UTILS}/Modules"
- )
-
- include(base-config-ix)
- include(CompilerRTUtils)
-
- load_llvm_config()
- construct_compiler_rt_default_triple()
-
- include(SetPlatformToolchainTools)
- include(AddCompilerRT)
-endif()
-
-include(crt-config-ix)
-
add_compiler_rt_component(crt)
function(check_cxx_section_exists section output)
More information about the llvm-commits
mailing list