Skip to content

Commit

Permalink
Revert "[CMake][compiler-rt] Make CRT separately buildable"
Browse files Browse the repository at this point in the history
This reverts commit ed28461 since
it broke the VE bot.
  • Loading branch information
petrhosek committed Mar 8, 2022
1 parent 53e5e58 commit 601022f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 84 deletions.
2 changes: 2 additions & 0 deletions compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions compiler-rt/cmake/Modules/CompilerRTUtils.cmake
Expand Up @@ -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`
Expand Down
7 changes: 7 additions & 0 deletions compiler-rt/cmake/config-ix.cmake
Expand Up @@ -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})
Expand Down Expand Up @@ -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)
Expand Down
48 changes: 0 additions & 48 deletions compiler-rt/cmake/crt-config-ix.cmake

This file was deleted.

32 changes: 0 additions & 32 deletions 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)
Expand Down

0 comments on commit 601022f

Please sign in to comment.