2012-04-04 22:12:04 +00:00
|
|
|
# CMake build for CompilerRT.
|
|
|
|
#
|
|
|
|
# An important constraint of the build is that it only produces libraries
|
|
|
|
# based on the ability of the host toolchain to target various platforms.
|
|
|
|
|
Reland "[CMake] Bumps minimum version to 3.20.0.
This reverts commit d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6.
Adds the patch by @hans from
https://github.com/llvm/llvm-project/issues/62719
This patch fixes the Windows build.
d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6 reverted the reviews
D144509 [CMake] Bumps minimum version to 3.20.0.
This partly undoes D137724.
This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193
Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.
D150532 [OpenMP] Compile assembly files as ASM, not C
Since CMake 3.20, CMake explicitly passes "-x c" (or equivalent)
when compiling a file which has been set as having the language
C. This behaviour change only takes place if "cmake_minimum_required"
is set to 3.20 or newer, or if the policy CMP0119 is set to new.
Attempting to compile assembly files with "-x c" fails, however
this is workarounded in many cases, as OpenMP overrides this with
"-x assembler-with-cpp", however this is only added for non-Windows
targets.
Thus, after increasing cmake_minimum_required to 3.20, this breaks
compiling the GNU assembly for Windows targets; the GNU assembly is
used for ARM and AArch64 Windows targets when building with Clang.
This patch unbreaks that.
D150688 [cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump
The build uses other mechanism to select the runtime.
Fixes #62719
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D151344
2023-05-24 18:12:32 +02:00
|
|
|
cmake_minimum_required(VERSION 3.20.0)
|
2024-06-04 09:26:45 +02:00
|
|
|
set(LLVM_SUBPROJECT_TITLE "Compiler-RT")
|
Reland "[CMake] Bumps minimum version to 3.20.0.
This reverts commit d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6.
Adds the patch by @hans from
https://github.com/llvm/llvm-project/issues/62719
This patch fixes the Windows build.
d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6 reverted the reviews
D144509 [CMake] Bumps minimum version to 3.20.0.
This partly undoes D137724.
This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193
Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.
D150532 [OpenMP] Compile assembly files as ASM, not C
Since CMake 3.20, CMake explicitly passes "-x c" (or equivalent)
when compiling a file which has been set as having the language
C. This behaviour change only takes place if "cmake_minimum_required"
is set to 3.20 or newer, or if the policy CMP0119 is set to new.
Attempting to compile assembly files with "-x c" fails, however
this is workarounded in many cases, as OpenMP overrides this with
"-x assembler-with-cpp", however this is only added for non-Windows
targets.
Thus, after increasing cmake_minimum_required to 3.20, this breaks
compiling the GNU assembly for Windows targets; the GNU assembly is
used for ARM and AArch64 Windows targets when building with Clang.
This patch unbreaks that.
D150688 [cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump
The build uses other mechanism to select the runtime.
Fixes #62719
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D151344
2023-05-24 18:12:32 +02:00
|
|
|
|
2023-10-04 20:05:48 +08:00
|
|
|
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
|
|
|
|
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
|
|
|
|
endif()
|
Reland "[CMake] Bumps minimum version to 3.20.0.
This reverts commit d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6.
Adds the patch by @hans from
https://github.com/llvm/llvm-project/issues/62719
This patch fixes the Windows build.
d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6 reverted the reviews
D144509 [CMake] Bumps minimum version to 3.20.0.
This partly undoes D137724.
This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193
Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.
D150532 [OpenMP] Compile assembly files as ASM, not C
Since CMake 3.20, CMake explicitly passes "-x c" (or equivalent)
when compiling a file which has been set as having the language
C. This behaviour change only takes place if "cmake_minimum_required"
is set to 3.20 or newer, or if the policy CMP0119 is set to new.
Attempting to compile assembly files with "-x c" fails, however
this is workarounded in many cases, as OpenMP overrides this with
"-x assembler-with-cpp", however this is only added for non-Windows
targets.
Thus, after increasing cmake_minimum_required to 3.20, this breaks
compiling the GNU assembly for Windows targets; the GNU assembly is
used for ARM and AArch64 Windows targets when building with Clang.
This patch unbreaks that.
D150688 [cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump
The build uses other mechanism to select the runtime.
Fixes #62719
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D151344
2023-05-24 18:12:32 +02:00
|
|
|
include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
|
|
|
|
NO_POLICY_SCOPE)
|
2017-06-16 21:14:45 +00:00
|
|
|
|
2024-10-14 15:07:11 +03:00
|
|
|
# TODO(CMake 3.22): remove
|
|
|
|
if(POLICY CMP0128)
|
|
|
|
cmake_policy(SET CMP0128 NEW)
|
|
|
|
endif()
|
|
|
|
|
2022-01-21 12:20:28 -05:00
|
|
|
# Check if compiler-rt is built as a standalone project.
|
|
|
|
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD)
|
|
|
|
project(CompilerRT C CXX ASM)
|
|
|
|
set(COMPILER_RT_STANDALONE_BUILD TRUE)
|
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
endif()
|
|
|
|
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-09 21:45:52 +00:00
|
|
|
# Add path for custom compiler-rt modules.
|
|
|
|
list(INSERT CMAKE_MODULE_PATH 0
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules"
|
2022-01-01 07:03:31 +00:00
|
|
|
"${LLVM_COMMON_CMAKE_UTILS}"
|
|
|
|
"${LLVM_COMMON_CMAKE_UTILS}/Modules"
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-09 21:45:52 +00:00
|
|
|
)
|
|
|
|
|
2017-07-28 00:50:56 +00:00
|
|
|
if(CMAKE_CONFIGURATION_TYPES)
|
|
|
|
set(CMAKE_CFG_RESOLVED_INTDIR "${CMAKE_CFG_INTDIR}/")
|
|
|
|
else()
|
|
|
|
set(CMAKE_CFG_RESOLVED_INTDIR "")
|
|
|
|
endif()
|
|
|
|
|
2021-12-07 11:53:38 -08:00
|
|
|
include(SetPlatformToolchainTools)
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-09 21:45:52 +00:00
|
|
|
include(base-config-ix)
|
2016-08-02 05:51:05 +00:00
|
|
|
include(CompilerRTUtils)
|
2022-04-26 23:23:53 -07:00
|
|
|
include(CMakeDependentOption)
|
2024-03-22 15:29:36 -07:00
|
|
|
include(GetDarwinLinkerVersion)
|
2013-10-01 12:52:15 +00:00
|
|
|
|
[compiler-rt] [test] Fix using toolchains that rely on Clang default configs (#113491)
The use of CLANG_NO_DEFAULT_CONFIG in the tests was added because some
Linux distributions had a global default config file, that added flags
relating to hardening, which interfere with the sanitizer tests. By
setting CLANG_NO_DEFAULT_CONFIG, the global default config files that
are found are ignored, and the sanitizers get the expected default
compiler behaviour.
(This was https://github.com/llvm/llvm-project/issues/60394, which was
fixed in 8ab762557fb057af1a3015211ee116a975027e78.)
However, some toolchains may rely on default config files for mandatory
parts required for functioning at all - setting things like sysroots,
-rtlib, -unwindlib, -stdlib, -fuse-ld etc. In such a case we can't
forcibly disable any default config, because it will break the otherwise
working toolchain.
Add a test for whether the compiler works while passing
--no-default-config to it. If the option is accepted and the toolchain
still works while that is set, set CLANG_NO_DEFAULT_CONFIG while running
tests.
(This adds a little bit of inconsistency, as we're testing for the
command line option, while using the environment variable. However doing
compile testing with an environment variable isn't quite as easily
doable, and passing an extra command line flag to all compile commands
while testing, is a bit clumsy - therefore this inconsistency.)
2024-10-24 23:45:14 +03:00
|
|
|
include(CheckCXXCompilerFlag)
|
|
|
|
|
|
|
|
# Check if we can compile with --no-default-config, or if that omits a config
|
|
|
|
# file that is essential for the toolchain to work properly.
|
|
|
|
#
|
|
|
|
# Using CMAKE_REQUIRED_FLAGS to make sure the flag is used both for compilation
|
|
|
|
# and for linking.
|
|
|
|
#
|
|
|
|
# Doing this test early on, to see if the flag works on the toolchain
|
|
|
|
# out of the box. Later on, we end up adding -nostdlib and similar flags
|
|
|
|
# to all test compiles, which easily can give false positives on this test.
|
|
|
|
set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
|
|
|
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} --no-default-config")
|
|
|
|
check_cxx_compiler_flag("" COMPILER_RT_HAS_NO_DEFAULT_CONFIG_FLAG)
|
|
|
|
set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
|
|
|
|
|
2015-09-14 19:59:24 +00:00
|
|
|
option(COMPILER_RT_BUILD_BUILTINS "Build builtins" ON)
|
|
|
|
mark_as_advanced(COMPILER_RT_BUILD_BUILTINS)
|
2022-12-30 13:34:45 +00:00
|
|
|
option(COMPILER_RT_DISABLE_AARCH64_FMV "Disable AArch64 Function Multi Versioning support" OFF)
|
|
|
|
mark_as_advanced(COMPILER_RT_DISABLE_AARCH64_FMV)
|
2015-09-14 19:59:24 +00:00
|
|
|
option(COMPILER_RT_BUILD_SANITIZERS "Build sanitizers" ON)
|
|
|
|
mark_as_advanced(COMPILER_RT_BUILD_SANITIZERS)
|
2016-08-08 03:58:57 +00:00
|
|
|
option(COMPILER_RT_BUILD_XRAY "Build xray" ON)
|
2016-07-21 07:39:55 +00:00
|
|
|
mark_as_advanced(COMPILER_RT_BUILD_XRAY)
|
2017-08-21 23:25:50 +00:00
|
|
|
option(COMPILER_RT_BUILD_LIBFUZZER "Build libFuzzer" ON)
|
|
|
|
mark_as_advanced(COMPILER_RT_BUILD_LIBFUZZER)
|
2017-10-02 05:03:55 +00:00
|
|
|
option(COMPILER_RT_BUILD_PROFILE "Build profile runtime" ON)
|
|
|
|
mark_as_advanced(COMPILER_RT_BUILD_PROFILE)
|
2024-04-22 19:30:20 +02:00
|
|
|
option(COMPILER_RT_BUILD_CTX_PROFILE "Build ctx profile runtime" ON)
|
|
|
|
mark_as_advanced(COMPILER_RT_BUILD_CTX_PROFILE)
|
2020-09-03 15:21:20 -07:00
|
|
|
option(COMPILER_RT_BUILD_MEMPROF "Build memory profiling runtime" ON)
|
|
|
|
mark_as_advanced(COMPILER_RT_BUILD_MEMPROF)
|
2017-08-03 00:58:45 +00:00
|
|
|
option(COMPILER_RT_BUILD_XRAY_NO_PREINIT "Build xray with no preinit patching" OFF)
|
|
|
|
mark_as_advanced(COMPILER_RT_BUILD_XRAY_NO_PREINIT)
|
2021-04-23 21:14:56 -07:00
|
|
|
option(COMPILER_RT_BUILD_ORC "Build ORC runtime" ON)
|
|
|
|
mark_as_advanced(COMPILER_RT_BUILD_ORC)
|
2021-07-27 17:44:14 +00:00
|
|
|
option(COMPILER_RT_BUILD_GWP_ASAN "Build GWP-ASan, and link it into SCUDO" ON)
|
|
|
|
mark_as_advanced(COMPILER_RT_BUILD_GWP_ASAN)
|
2022-01-10 09:23:28 +08:00
|
|
|
option(COMPILER_RT_ENABLE_CET "Build Compiler RT with CET enabled" OFF)
|
2015-09-14 19:59:24 +00:00
|
|
|
|
2022-10-10 15:07:06 -07:00
|
|
|
option(COMPILER_RT_SCUDO_STANDALONE_SYSROOT_PATH "Set custom sysroot for building SCUDO standalone" OFF)
|
|
|
|
mark_as_advanced(COMPILER_RT_SCUDO_STANDALONE_SYSROOT_PATH)
|
|
|
|
option(COMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED "Build SCUDO standalone for shared libraries" ON)
|
|
|
|
mark_as_advanced(COMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED)
|
|
|
|
option(COMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC "Build SCUDO standalone with LLVM's libc headers" OFF)
|
|
|
|
mark_as_advanced(COMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC)
|
|
|
|
|
2021-06-02 11:33:49 -07:00
|
|
|
if(FUCHSIA)
|
|
|
|
set(COMPILER_RT_HWASAN_WITH_INTERCEPTORS_DEFAULT OFF)
|
|
|
|
else()
|
|
|
|
set(COMPILER_RT_HWASAN_WITH_INTERCEPTORS_DEFAULT ON)
|
|
|
|
endif()
|
|
|
|
set(COMPILER_RT_HWASAN_WITH_INTERCEPTORS ${COMPILER_RT_HWASAN_WITH_INTERCEPTORS_DEFAULT} CACHE BOOL "Enable libc interceptors in HWASan (testing mode)")
|
[hwasan] Add a (almost) no-interceptor mode.
Summary:
The idea behind this change is to allow sanitization of libc. We are prototyping on Bionic,
but the tool interface will be general enough (or at least generalizable) to support any other libc.
When libc depends on libclang_rt.hwasan, the latter can not interpose libc functions.
In fact, majority of interceptors become unnecessary when libc code is instrumented.
This change gets rid of most hwasan interceptors and provides interface for libc to notify
hwasan about thread creation and destruction events. Some interceptors (pthread_create)
are kept under #ifdef to enable testing with uninstrumented libc. They are expressed in
terms of the new libc interface.
The new cmake switch, COMPILER_RT_HWASAN_WITH_INTERCEPTORS, ON by default, builds testing
version of the library with the aforementioned pthread_create interceptor.
With the OFF setting, the library becomes more of a libc plugin.
Reviewers: vitalybuka, kcc, jfb
Subscribers: srhines, kubamracek, mgorny, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D50922
llvm-svn: 340216
2018-08-20 21:49:15 +00:00
|
|
|
|
2019-05-28 19:09:17 +00:00
|
|
|
set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL
|
2017-05-10 15:34:25 +00:00
|
|
|
"Build for a bare-metal target.")
|
|
|
|
|
[CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.
This patch contains the following specific changes:
* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration
I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.
This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.
Reviewers: samsonov, iains, jroelofs
Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D19742
llvm-svn: 268977
2016-05-09 21:45:52 +00:00
|
|
|
if (COMPILER_RT_STANDALONE_BUILD)
|
2022-08-16 16:24:42 -07:00
|
|
|
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to")
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
|
|
|
set(CMAKE_CXX_EXTENSIONS NO)
|
|
|
|
|
2022-11-11 22:50:14 +00:00
|
|
|
if (NOT LLVM_RUNTIMES_BUILD)
|
|
|
|
load_llvm_config()
|
|
|
|
endif()
|
2018-06-27 12:56:34 +00:00
|
|
|
if (TARGET intrinsics_gen)
|
|
|
|
# Loading the llvm config causes this target to be imported so place it
|
|
|
|
# under the appropriate folder in an IDE.
|
2024-06-04 09:26:45 +02:00
|
|
|
set_target_properties(intrinsics_gen PROPERTIES FOLDER "LLVM/Tablegenning")
|
2018-06-27 12:56:34 +00:00
|
|
|
endif()
|
2014-02-19 10:04:29 +00:00
|
|
|
|
2020-09-05 17:52:23 +03:00
|
|
|
find_package(Python3 COMPONENTS Interpreter)
|
|
|
|
if(NOT Python3_Interpreter_FOUND)
|
|
|
|
message(WARNING "Python3 not found, using python2 as a fallback")
|
|
|
|
find_package(Python2 COMPONENTS Interpreter REQUIRED)
|
|
|
|
if(Python2_VERSION VERSION_LESS 2.7)
|
|
|
|
message(SEND_ERROR "Python 2.7 or newer is required")
|
2020-04-28 17:25:23 +00:00
|
|
|
endif()
|
|
|
|
|
2020-09-05 17:52:23 +03:00
|
|
|
# Treat python2 as python3
|
2020-04-28 17:25:23 +00:00
|
|
|
add_executable(Python3::Interpreter IMPORTED)
|
|
|
|
set_target_properties(Python3::Interpreter PROPERTIES
|
2020-09-05 17:52:23 +03:00
|
|
|
IMPORTED_LOCATION ${Python2_EXECUTABLE})
|
|
|
|
set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
|
2014-02-19 10:04:29 +00:00
|
|
|
endif()
|
|
|
|
|
2018-09-17 23:25:36 +00:00
|
|
|
# Ensure that fat libraries are built correctly on Darwin
|
2020-08-21 13:03:13 -07:00
|
|
|
if(APPLE)
|
2019-06-04 02:38:15 +00:00
|
|
|
include(UseLibtool)
|
2018-09-17 23:25:36 +00:00
|
|
|
endif()
|
|
|
|
|
2014-02-19 10:04:29 +00:00
|
|
|
# Define default arguments to lit.
|
|
|
|
set(LIT_ARGS_DEFAULT "-sv")
|
|
|
|
if (MSVC OR XCODE)
|
|
|
|
set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
|
|
|
|
endif()
|
|
|
|
set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
|
2017-09-15 22:10:46 +00:00
|
|
|
set(LLVM_LIT_OUTPUT_DIR "${COMPILER_RT_EXEC_OUTPUT_DIR}")
|
2014-02-19 07:49:16 +00:00
|
|
|
endif()
|
|
|
|
|
2016-08-02 05:51:05 +00:00
|
|
|
construct_compiler_rt_default_triple()
|
2018-08-14 18:01:19 +00:00
|
|
|
if ("${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" MATCHES ".*hf$")
|
2017-09-19 17:54:11 +00:00
|
|
|
if (${COMPILER_RT_DEFAULT_TARGET_ARCH} MATCHES "^arm")
|
|
|
|
set(COMPILER_RT_DEFAULT_TARGET_ARCH "armhf")
|
2020-10-12 14:23:26 -03:00
|
|
|
CHECK_SYMBOL_EXISTS (__thumb__ "" COMPILER_RT_ARM_THUMB)
|
2017-09-19 17:54:11 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
2018-08-14 18:01:19 +00:00
|
|
|
if ("${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" MATCHES ".*android.*")
|
2016-06-27 22:52:05 +00:00
|
|
|
set(ANDROID 1)
|
2020-11-14 01:52:44 -08:00
|
|
|
string(REGEX MATCH "-target(=| +)[^ ]+android[a-z]*([0-9]+)" ANDROID_API_LEVEL "${CMAKE_C_FLAGS}")
|
2020-11-04 13:10:17 -08:00
|
|
|
set(ANDROID_API_LEVEL ${CMAKE_MATCH_2})
|
2016-06-27 22:52:05 +00:00
|
|
|
endif()
|
2017-09-16 05:13:56 +00:00
|
|
|
pythonize_bool(ANDROID)
|
2012-12-19 12:33:39 +00:00
|
|
|
|
|
|
|
set(COMPILER_RT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
2013-06-06 12:35:48 +00:00
|
|
|
set(COMPILER_RT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
2012-12-19 12:33:39 +00:00
|
|
|
|
2018-06-28 03:11:52 +00:00
|
|
|
pythonize_bool(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
|
|
|
|
|
2022-08-19 06:46:22 -07:00
|
|
|
# We support running instrumented tests when we're not cross-compiling
|
2014-05-13 14:25:49 +00:00
|
|
|
# and target a UNIX-like system or Windows.
|
|
|
|
# We can run tests on Android even when we are cross-compiling.
|
2023-03-30 12:47:33 +08:00
|
|
|
if((NOT "${CMAKE_CROSSCOMPILING}" AND (UNIX OR WIN32))
|
2022-08-19 06:46:22 -07:00
|
|
|
OR ANDROID OR COMPILER_RT_EMULATOR)
|
2013-04-01 04:13:03 +00:00
|
|
|
option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" ON)
|
2012-12-27 13:19:23 +00:00
|
|
|
else()
|
2013-04-01 04:13:03 +00:00
|
|
|
option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" OFF)
|
2012-12-27 13:19:23 +00:00
|
|
|
endif()
|
2013-04-01 04:13:03 +00:00
|
|
|
|
2013-10-25 23:03:34 +00:00
|
|
|
option(COMPILER_RT_DEBUG "Build runtimes with full debug info" OFF)
|
2015-12-03 20:08:22 +00:00
|
|
|
option(COMPILER_RT_EXTERNALIZE_DEBUGINFO
|
|
|
|
"Generate dSYM files and strip executables and libraries (Darwin Only)" OFF)
|
2013-10-25 23:03:34 +00:00
|
|
|
# COMPILER_RT_DEBUG_PYBOOL is used by lit.common.configured.in.
|
|
|
|
pythonize_bool(COMPILER_RT_DEBUG)
|
|
|
|
|
2019-03-06 19:25:09 +00:00
|
|
|
option(COMPILER_RT_INTERCEPT_LIBDISPATCH
|
2019-03-15 17:52:27 +00:00
|
|
|
"Support interception of libdispatch (GCD). Requires '-fblocks'" OFF)
|
2019-04-04 17:25:43 +00:00
|
|
|
option(COMPILER_RT_LIBDISPATCH_INSTALL_PATH
|
|
|
|
"Specify if libdispatch is installed in a custom location" "")
|
2019-04-02 20:04:32 +00:00
|
|
|
if (COMPILER_RT_INTERCEPT_LIBDISPATCH AND NOT APPLE)
|
2019-04-04 01:10:07 +00:00
|
|
|
set(COMPILER_RT_LIBDISPATCH_CFLAGS -fblocks)
|
|
|
|
set(COMPILER_RT_TEST_LIBDISPATCH_CFLAGS)
|
2019-04-04 17:25:43 +00:00
|
|
|
if (COMPILER_RT_LIBDISPATCH_INSTALL_PATH)
|
2019-04-04 01:10:07 +00:00
|
|
|
list(APPEND COMPILER_RT_TEST_LIBDISPATCH_CFLAGS
|
2019-05-10 18:37:30 +00:00
|
|
|
-I${COMPILER_RT_LIBDISPATCH_INSTALL_PATH}/include
|
2019-04-04 17:25:43 +00:00
|
|
|
-L${COMPILER_RT_LIBDISPATCH_INSTALL_PATH}/lib
|
|
|
|
-Wl,-rpath=${COMPILER_RT_LIBDISPATCH_INSTALL_PATH}/lib)
|
2019-03-15 17:52:27 +00:00
|
|
|
endif()
|
2019-04-04 01:10:07 +00:00
|
|
|
list(APPEND COMPILER_RT_TEST_LIBDISPATCH_CFLAGS -lBlocksRuntime -ldispatch)
|
2019-03-15 17:52:27 +00:00
|
|
|
endif()
|
2019-03-06 19:25:09 +00:00
|
|
|
if (APPLE) # Always enable on Apple platforms.
|
|
|
|
set(COMPILER_RT_INTERCEPT_LIBDISPATCH ON)
|
|
|
|
endif()
|
2019-03-07 18:15:23 +00:00
|
|
|
pythonize_bool(COMPILER_RT_INTERCEPT_LIBDISPATCH)
|
2019-03-06 19:25:09 +00:00
|
|
|
|
2017-07-07 22:40:13 +00:00
|
|
|
if(APPLE AND SANITIZER_MIN_OSX_VERSION AND SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9")
|
2016-08-22 18:31:37 +00:00
|
|
|
# Mac OS X prior to 10.9 had problems with exporting symbols from
|
|
|
|
# libc++/libc++abi.
|
2017-09-15 20:24:12 +00:00
|
|
|
set(cxxabi_supported OFF)
|
2016-08-22 18:31:37 +00:00
|
|
|
else()
|
2017-09-15 20:24:12 +00:00
|
|
|
set(cxxabi_supported ON)
|
2016-08-22 18:31:37 +00:00
|
|
|
endif()
|
|
|
|
|
2018-05-18 18:44:37 +00:00
|
|
|
option(SANITIZER_ALLOW_CXXABI "Allow use of C++ ABI details in ubsan" ON)
|
2017-09-15 20:24:12 +00:00
|
|
|
|
2021-04-12 14:04:38 +08:00
|
|
|
set(SANITIZER_CAN_USE_CXXABI OFF)
|
2017-09-15 20:24:12 +00:00
|
|
|
if (cxxabi_supported AND SANITIZER_ALLOW_CXXABI)
|
|
|
|
set(SANITIZER_CAN_USE_CXXABI ON)
|
|
|
|
endif()
|
2016-08-22 18:31:37 +00:00
|
|
|
pythonize_bool(SANITIZER_CAN_USE_CXXABI)
|
|
|
|
|
2019-02-16 08:34:26 +00:00
|
|
|
macro(handle_default_cxx_lib var)
|
2020-10-30 20:19:39 -07:00
|
|
|
# Specifying -stdlib= in CMAKE_CXX_FLAGS overrides the defaults.
|
|
|
|
if (CMAKE_CXX_FLAGS MATCHES "-stdlib=([a-zA-Z+]*)")
|
|
|
|
set(${var}_LIBNAME "${CMAKE_MATCH_1}")
|
|
|
|
set(${var}_SYSTEM 1)
|
|
|
|
elseif (${var} STREQUAL "default")
|
2024-12-19 18:33:29 -05:00
|
|
|
if (APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
2019-02-16 08:34:26 +00:00
|
|
|
set(${var}_LIBNAME "libc++")
|
|
|
|
set(${var}_SYSTEM 1)
|
2023-08-29 10:37:49 -07:00
|
|
|
elseif (FUCHSIA)
|
2019-02-16 08:34:26 +00:00
|
|
|
set(${var}_LIBNAME "libc++")
|
|
|
|
set(${var}_INTREE 1)
|
|
|
|
else()
|
|
|
|
set(${var}_LIBNAME "libstdc++")
|
|
|
|
set(${var}_SYSTEM 1)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(${var}_LIBNAME "${${var}}")
|
|
|
|
set(${var}_SYSTEM 1)
|
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
# This is either directly the C++ ABI library or the full C++ library
|
|
|
|
# which pulls in the ABI transitively.
|
2022-06-02 21:52:56 +00:00
|
|
|
# TODO: Mark this as internal flag, most users should use COMPILER_RT_CXX_LIBRARY.
|
2017-07-28 03:39:39 +00:00
|
|
|
set(SANITIZER_CXX_ABI "default" CACHE STRING
|
|
|
|
"Specify C++ ABI library to use.")
|
2019-02-16 08:34:26 +00:00
|
|
|
set(CXXABIS none default libstdc++ libc++ libcxxabi)
|
2017-07-28 03:39:39 +00:00
|
|
|
set_property(CACHE SANITIZER_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
|
2019-02-16 08:34:26 +00:00
|
|
|
handle_default_cxx_lib(SANITIZER_CXX_ABI)
|
2017-07-28 03:39:39 +00:00
|
|
|
|
2019-02-16 08:34:26 +00:00
|
|
|
# This needs to be a full C++ library for linking gtest and unit tests.
|
2022-06-02 21:52:56 +00:00
|
|
|
# TODO: Mark this as internal flag, most users should use COMPILER_RT_CXX_LIBRARY.
|
2019-02-16 08:34:26 +00:00
|
|
|
set(SANITIZER_TEST_CXX "default" CACHE STRING
|
|
|
|
"Specify C++ library to use for tests.")
|
|
|
|
set(CXXLIBS none default libstdc++ libc++)
|
|
|
|
set_property(CACHE SANITIZER_TEST_CXX PROPERTY STRINGS ;${CXXLIBS})
|
|
|
|
handle_default_cxx_lib(SANITIZER_TEST_CXX)
|
2017-07-28 03:39:39 +00:00
|
|
|
|
2023-08-29 10:37:49 -07:00
|
|
|
option(COMPILER_RT_USE_LLVM_UNWINDER "Use the LLVM unwinder." OFF)
|
2022-04-26 23:23:53 -07:00
|
|
|
cmake_dependent_option(COMPILER_RT_ENABLE_STATIC_UNWINDER
|
|
|
|
"Statically link the LLVM unwinder." OFF
|
|
|
|
"COMPILER_RT_USE_LLVM_UNWINDER" OFF)
|
|
|
|
|
2019-01-31 03:38:43 +00:00
|
|
|
set(DEFAULT_SANITIZER_USE_STATIC_LLVM_UNWINDER OFF)
|
2023-08-29 10:37:49 -07:00
|
|
|
if (FUCHSIA)
|
2019-01-31 03:38:43 +00:00
|
|
|
set(DEFAULT_SANITIZER_USE_STATIC_LLVM_UNWINDER ON)
|
|
|
|
elseif (DEFINED LIBUNWIND_ENABLE_SHARED AND NOT LIBUNWIND_ENABLE_SHARED)
|
|
|
|
set(DEFAULT_SANITIZER_USE_STATIC_LLVM_UNWINDER ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(SANITIZER_USE_STATIC_LLVM_UNWINDER
|
|
|
|
"Use static LLVM unwinder." ${DEFAULT_SANITIZER_USE_STATIC_LLVM_UNWINDER})
|
2021-10-06 11:09:29 -07:00
|
|
|
pythonize_bool(SANITIZER_USE_STATIC_LLVM_UNWINDER)
|
2019-01-31 03:38:43 +00:00
|
|
|
|
|
|
|
set(DEFAULT_SANITIZER_USE_STATIC_CXX_ABI OFF)
|
|
|
|
if (DEFINED LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_SHARED)
|
|
|
|
set(DEFAULT_SANITIZER_USE_STATIC_CXX_ABI ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(SANITIZER_USE_STATIC_CXX_ABI
|
|
|
|
"Use static libc++abi." ${DEFAULT_SANITIZER_USE_STATIC_CXX_ABI})
|
2021-09-22 15:25:05 -07:00
|
|
|
pythonize_bool(SANITIZER_USE_STATIC_CXX_ABI)
|
2019-01-31 03:38:43 +00:00
|
|
|
|
2022-01-25 09:42:28 -08:00
|
|
|
set(DEFAULT_SANITIZER_USE_STATIC_TEST_CXX OFF)
|
|
|
|
if (DEFINED LIBCXX_ENABLE_SHARED AND NOT LIBCXX_ENABLE_SHARED)
|
|
|
|
set(DEFAULT_SANITIZER_USE_STATIC_TEST_CXX ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(SANITIZER_USE_STATIC_TEST_CXX
|
|
|
|
"Use static libc++ for tests." ${DEFAULT_SANITIZER_USE_STATIC_TEST_CXX})
|
|
|
|
pythonize_bool(SANITIZER_USE_STATIC_TEST_CXX)
|
|
|
|
|
2022-06-02 21:52:56 +00:00
|
|
|
set(COMPILER_RT_SUPPORTED_CXX_LIBRARIES none default libcxx)
|
|
|
|
set(COMPILER_RT_CXX_LIBRARY "default" CACHE STRING "Specify C++ library to use. Supported values are ${COMPILER_RT_SUPPORTED_CXX_LIBRARIES}.")
|
|
|
|
if (NOT "${COMPILER_RT_CXX_LIBRARY}" IN_LIST COMPILER_RT_SUPPORTED_CXX_LIBRARIES)
|
|
|
|
message(FATAL_ERROR "Unsupported C++ library: '${COMPILER_RT_CXX_LIBRARY}'. Supported values are ${COMPILER_RT_SUPPORTED_CXX_LIBRARIES}.")
|
|
|
|
endif()
|
|
|
|
cmake_dependent_option(COMPILER_RT_STATIC_CXX_LIBRARY
|
|
|
|
"Statically link the C++ library." OFF
|
|
|
|
"COMPILER_RT_CXX_LIBRARY" OFF)
|
|
|
|
|
2018-07-15 03:05:20 +00:00
|
|
|
set(DEFAULT_COMPILER_RT_USE_BUILTINS_LIBRARY OFF)
|
2023-08-29 10:37:49 -07:00
|
|
|
if (FUCHSIA)
|
2018-07-15 03:05:20 +00:00
|
|
|
set(DEFAULT_COMPILER_RT_USE_BUILTINS_LIBRARY ON)
|
2018-05-22 22:58:48 +00:00
|
|
|
endif()
|
2017-07-28 03:39:38 +00:00
|
|
|
|
2018-07-15 03:05:20 +00:00
|
|
|
option(COMPILER_RT_USE_BUILTINS_LIBRARY
|
|
|
|
"Use compiler-rt builtins instead of libgcc" ${DEFAULT_COMPILER_RT_USE_BUILTINS_LIBRARY})
|
|
|
|
|
2024-09-03 10:28:49 -07:00
|
|
|
option(COMPILER_RT_USE_ATOMIC_LIBRARY "Use compiler-rt atomic instead of libatomic" OFF)
|
|
|
|
|
2018-05-22 18:33:27 +00:00
|
|
|
include(config-ix)
|
|
|
|
|
2014-02-18 07:26:58 +00:00
|
|
|
#================================
|
|
|
|
# Setup Compiler Flags
|
|
|
|
#================================
|
2015-01-14 15:55:17 +00:00
|
|
|
|
2022-01-10 09:23:28 +08:00
|
|
|
# fcf-protection is a gcc/clang option for CET support on Linux platforms.
|
|
|
|
# We need to handle MSVC CET option on Windows platforms.
|
|
|
|
if (NOT MSVC)
|
|
|
|
if (COMPILER_RT_ENABLE_CET AND NOT COMPILER_RT_HAS_FCF_PROTECTION_FLAG)
|
|
|
|
message(FATAL_ERROR "Compiler used to build compiler-rt doesn't support CET!")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2014-03-13 11:31:10 +00:00
|
|
|
if(MSVC)
|
2016-06-17 17:48:52 +00:00
|
|
|
# Override any existing /W flags with /W4. This is what LLVM does. Failing to
|
|
|
|
# remove other /W[0-4] flags will result in a warning about overriding a
|
|
|
|
# previous flag.
|
|
|
|
if (COMPILER_RT_HAS_W4_FLAG)
|
|
|
|
string(REGEX REPLACE " /W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
|
|
|
string(REGEX REPLACE " /W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
|
|
append_string_if(COMPILER_RT_HAS_W4_FLAG /W4 CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
|
|
|
endif()
|
2014-03-13 11:31:10 +00:00
|
|
|
else()
|
|
|
|
append_string_if(COMPILER_RT_HAS_WALL_FLAG -Wall CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
|
|
|
endif()
|
2014-02-24 11:22:39 +00:00
|
|
|
if(COMPILER_RT_ENABLE_WERROR)
|
2014-03-13 11:31:10 +00:00
|
|
|
append_string_if(COMPILER_RT_HAS_WERROR_FLAG -Werror CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
|
|
|
append_string_if(COMPILER_RT_HAS_WX_FLAG /WX CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
2014-02-24 11:22:39 +00:00
|
|
|
endif()
|
|
|
|
|
2014-02-26 21:54:39 +00:00
|
|
|
# Emulate C99 and C++11's __func__ for MSVC prior to 2013 CTP.
|
2014-02-27 06:52:41 +00:00
|
|
|
if(NOT COMPILER_RT_HAS_FUNC_SYMBOL)
|
2014-02-27 07:03:32 +00:00
|
|
|
add_definitions(-D__func__=__FUNCTION__)
|
2014-02-26 21:54:39 +00:00
|
|
|
endif()
|
|
|
|
|
2021-05-27 14:53:49 -07:00
|
|
|
# Provide some common commandline flags for Sanitizer runtimes.
|
|
|
|
if("${ANDROID_API_LEVEL}" GREATER_EQUAL 29)
|
2020-10-17 01:57:02 -04:00
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS -fno-emulated-tls)
|
2020-11-04 19:22:28 -08:00
|
|
|
string(APPEND COMPILER_RT_TEST_COMPILER_CFLAGS " -fno-emulated-tls")
|
2020-10-17 01:57:02 -04:00
|
|
|
endif()
|
2016-09-08 15:57:22 +00:00
|
|
|
if(NOT WIN32)
|
|
|
|
append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC SANITIZER_COMMON_CFLAGS)
|
|
|
|
endif()
|
2014-10-15 22:47:54 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_FNO_BUILTIN_FLAG -fno-builtin SANITIZER_COMMON_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG -fno-exceptions SANITIZER_COMMON_CFLAGS)
|
2017-03-27 17:14:48 +00:00
|
|
|
if(NOT COMPILER_RT_DEBUG AND NOT APPLE)
|
2016-05-22 19:59:06 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG -fomit-frame-pointer SANITIZER_COMMON_CFLAGS)
|
|
|
|
endif()
|
2014-10-15 22:47:54 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_FUNWIND_TABLES_FLAG -funwind-tables SANITIZER_COMMON_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG -fno-stack-protector SANITIZER_COMMON_CFLAGS)
|
2015-06-15 21:08:47 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_FNO_SANITIZE_SAFE_STACK_FLAG -fno-sanitize=safe-stack SANITIZER_COMMON_CFLAGS)
|
2014-10-15 22:47:54 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG -fvisibility=hidden SANITIZER_COMMON_CFLAGS)
|
2017-11-28 23:41:42 +00:00
|
|
|
if(NOT COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG)
|
|
|
|
append_list_if(COMPILER_RT_HAS_FVISIBILITY_INLINES_HIDDEN_FLAG -fvisibility-inlines-hidden SANITIZER_COMMON_CFLAGS)
|
|
|
|
endif()
|
2015-01-15 16:31:22 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_FNO_LTO_FLAG -fno-lto SANITIZER_COMMON_CFLAGS)
|
2014-02-18 07:26:58 +00:00
|
|
|
|
2020-03-09 15:25:41 -07:00
|
|
|
# By default do not instrument or use profdata for compiler-rt.
|
|
|
|
if(NOT COMPILER_RT_ENABLE_PGO)
|
|
|
|
if(LLVM_PROFDATA_FILE AND COMPILER_RT_HAS_FNO_PROFILE_INSTR_USE_FLAG)
|
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS "-fno-profile-instr-use")
|
|
|
|
endif()
|
|
|
|
if(LLVM_BUILD_INSTRUMENTED MATCHES IR AND COMPILER_RT_HAS_FNO_PROFILE_GENERATE_FLAG)
|
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS "-fno-profile-generate")
|
2021-11-09 10:55:34 +01:00
|
|
|
elseif((LLVM_BUILD_INSTRUMENTED OR LLVM_BUILD_INSTRUMENTED_COVERAGE) AND COMPILER_RT_HAS_FNO_PROFILE_INSTR_GENERATE_FLAG)
|
2020-03-09 15:25:41 -07:00
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS "-fno-profile-instr-generate")
|
2021-11-09 10:55:34 +01:00
|
|
|
if(LLVM_BUILD_INSTRUMENTED_COVERAGE AND COMPILER_RT_HAS_FNO_COVERAGE_MAPPING_FLAG)
|
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS "-fno-coverage-mapping")
|
|
|
|
endif()
|
2020-03-09 15:25:41 -07:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2017-01-30 22:31:49 +00:00
|
|
|
# The following is a workaround for powerpc64le. This is the only architecture
|
|
|
|
# that requires -fno-function-sections to work properly. If lacking, the ASan
|
2019-08-05 16:48:12 +00:00
|
|
|
# Linux test function-sections-are-bad.cpp fails with the following error:
|
2017-01-30 22:31:49 +00:00
|
|
|
# 'undefined symbol: __sanitizer_unaligned_load32'.
|
|
|
|
if(DEFINED TARGET_powerpc64le_CFLAGS)
|
2020-01-15 10:42:12 -05:00
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "XL")
|
|
|
|
append("-qnofuncsect" TARGET_powerpc64le_CFLAGS)
|
|
|
|
else()
|
|
|
|
append_list_if(COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG -fno-function-sections TARGET_powerpc64le_CFLAGS)
|
|
|
|
endif()
|
2017-01-30 22:31:49 +00:00
|
|
|
endif()
|
|
|
|
|
2019-06-18 13:26:27 +00:00
|
|
|
# The following is a workaround for s390x. This avoids creation of "partial
|
|
|
|
# inline" function fragments when building the asan libraries with certain
|
|
|
|
# GCC versions. The presence of those fragments, in particular for the
|
|
|
|
# interceptors, changes backtraces seen in asan error cases, which causes
|
|
|
|
# testsuite failures.
|
|
|
|
if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "s390x")
|
|
|
|
append_list_if(COMPILER_RT_HAS_FNO_PARTIAL_INLINING_FLAG -fno-partial-inlining SANITIZER_COMMON_CFLAGS)
|
|
|
|
endif()
|
|
|
|
|
2014-02-28 08:04:30 +00:00
|
|
|
if(MSVC)
|
Reland [asan][windows] Eliminate the static asan runtime on windows (#107899)
This reapplies 8fa66c6ca7272268747835a0e86805307b62399c ([asan][windows]
Eliminate the static asan runtime on windows) for a second time.
That PR bounced off the tests because it caused failures in the other
sanitizer runtimes, these have been fixed by only building interception,
sanitizer_common, and asan with /MD, and continuing to build the rest of
the runtimes with /MT. This does mean that any usage of the static
ubsan/fuzzer/etc runtimes will mean you're mixing different runtime
library linkages in the same app, the interception, sanitizer_common,
and asan runtimes are designed for this, however it does result in some
linker warnings.
Additionally, it turns out when building in release-mode with
LLVM_ENABLE_PDBs the build system forced /OPT:ICF. This totally breaks
asan's "new" method of doing "weak" functions on windows, and so
/OPT:NOICF was explicitly added to asan's link flags.
---------
Co-authored-by: Amy Wishnousky <amyw@microsoft.com>
2024-09-09 13:41:08 -07:00
|
|
|
|
2024-05-30 11:41:44 -07:00
|
|
|
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
|
2023-10-02 13:22:23 +03:00
|
|
|
|
|
|
|
# Remove any /M[DT][d] flags, and strip any definitions of _DEBUG.
|
|
|
|
# Since we're using CMAKE_MSVC_RUNTIME_LIBRARY (CMP0091 set to NEW),
|
|
|
|
# these options shouldn't be included in these flags variables. However,
|
|
|
|
# package managers that don't know which mechanism is used for passing
|
|
|
|
# CRT choice flags might be passing them both ways - which leads to
|
|
|
|
# duplicate CRT choice options. Thus make sure to strip out these flags
|
|
|
|
# from these variables, when we're forcing a CRT choice other than what
|
|
|
|
# the user requested here.
|
|
|
|
foreach(flag_var
|
|
|
|
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
|
|
|
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
|
|
|
|
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
|
|
|
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
|
|
|
string(REGEX REPLACE "[/-]M[DT]d" "" ${flag_var} "${${flag_var}}")
|
|
|
|
string(REGEX REPLACE "[/-]MD" "" ${flag_var} "${${flag_var}}")
|
|
|
|
string(REGEX REPLACE "[/-]D_DEBUG" "" ${flag_var} "${${flag_var}}")
|
|
|
|
endforeach()
|
|
|
|
|
2014-10-15 22:47:54 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_Oy_FLAG /Oy- SANITIZER_COMMON_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_GS_FLAG /GS- SANITIZER_COMMON_CFLAGS)
|
2019-07-30 22:49:11 +00:00
|
|
|
|
|
|
|
# Disable thread safe initialization for static locals. ASan shouldn't need
|
|
|
|
# it. Thread safe initialization assumes that the CRT has already been
|
|
|
|
# initialized, but ASan initializes before the CRT.
|
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS /Zc:threadSafeInit-)
|
2014-02-28 08:04:30 +00:00
|
|
|
endif()
|
2014-02-18 07:26:58 +00:00
|
|
|
|
2015-01-06 20:25:34 +00:00
|
|
|
append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 SANITIZER_COMMON_CFLAGS)
|
2015-01-03 04:29:12 +00:00
|
|
|
|
2023-01-18 17:24:10 -08:00
|
|
|
append_list_if(COMPILER_RT_HAS_WTHREAD_SAFETY_FLAG -Wthread-safety THREAD_SAFETY_FLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_WTHREAD_SAFETY_REFERENCE_FLAG -Wthread-safety-reference THREAD_SAFETY_FLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_WTHREAD_SAFETY_BETA_FLAG -Wthread-safety-beta THREAD_SAFETY_FLAGS)
|
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS ${THREAD_SAFETY_FLAGS})
|
|
|
|
string(REPLACE ";" " " thread_safety_flags_space_sep "${THREAD_SAFETY_FLAGS}")
|
|
|
|
string(APPEND COMPILER_RT_TEST_COMPILER_CFLAGS " ${thread_safety_flags_space_sep}")
|
2021-07-09 19:29:41 +02:00
|
|
|
|
2017-07-15 00:30:46 +00:00
|
|
|
# If we're using MSVC,
|
2014-03-13 13:37:07 +00:00
|
|
|
# always respect the optimization flags set by CMAKE_BUILD_TYPE instead.
|
2017-07-15 00:30:46 +00:00
|
|
|
if (NOT MSVC)
|
|
|
|
|
2017-09-15 22:10:46 +00:00
|
|
|
# Build with optimization, unless we're in debug mode.
|
2017-07-15 00:30:46 +00:00
|
|
|
if(COMPILER_RT_DEBUG)
|
2022-12-13 16:38:12 -08:00
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS -O1)
|
2017-07-15 00:30:46 +00:00
|
|
|
else()
|
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS -O3)
|
|
|
|
endif()
|
2012-11-08 14:49:28 +00:00
|
|
|
endif()
|
2014-02-18 07:26:58 +00:00
|
|
|
|
2015-01-03 04:29:12 +00:00
|
|
|
# Determine if we should restrict stack frame sizes.
|
2019-08-21 15:53:08 +00:00
|
|
|
# Stack frames on PowerPC, Mips, SystemZ and in debug build can be much larger than
|
2015-01-03 04:29:12 +00:00
|
|
|
# anticipated.
|
|
|
|
# FIXME: Fix all sanitizers and add -Wframe-larger-than to
|
|
|
|
# SANITIZER_COMMON_FLAGS
|
|
|
|
if(COMPILER_RT_HAS_WFRAME_LARGER_THAN_FLAG AND NOT COMPILER_RT_DEBUG
|
2019-08-21 15:53:08 +00:00
|
|
|
AND NOT ${COMPILER_RT_DEFAULT_TARGET_ARCH} MATCHES "powerpc|mips|s390x")
|
2015-01-03 04:29:12 +00:00
|
|
|
set(SANITIZER_LIMIT_FRAME_SIZE TRUE)
|
|
|
|
else()
|
|
|
|
set(SANITIZER_LIMIT_FRAME_SIZE FALSE)
|
|
|
|
endif()
|
|
|
|
|
2018-05-09 21:24:06 +00:00
|
|
|
if(FUCHSIA OR UNIX)
|
|
|
|
set(SANITIZER_USE_SYMBOLS TRUE)
|
|
|
|
else()
|
|
|
|
set(SANITIZER_USE_SYMBOLS FALSE)
|
|
|
|
endif()
|
|
|
|
|
2024-03-22 15:29:36 -07:00
|
|
|
# Get the linker version while configuring compiler-rt and explicitly pass it
|
|
|
|
# in cflags during testing. This fixes the compiler/linker version mismatch
|
|
|
|
# issue when running a clang built with a newer Xcode in an older Xcode
|
|
|
|
set(COMPILER_RT_DARWIN_LINKER_VERSION)
|
|
|
|
if (APPLE AND NOT CMAKE_LINKER MATCHES ".*lld.*")
|
|
|
|
get_darwin_linker_version(COMPILER_RT_DARWIN_LINKER_VERSION)
|
|
|
|
message(STATUS "Host linker version: ${COMPILER_RT_DARWIN_LINKER_VERSION}")
|
|
|
|
endif()
|
|
|
|
|
2014-02-18 07:26:58 +00:00
|
|
|
# Build sanitizer runtimes with debug info.
|
2018-04-26 20:34:19 +00:00
|
|
|
if(MSVC)
|
2016-08-02 01:02:46 +00:00
|
|
|
# Use /Z7 instead of /Zi for the asan runtime. This avoids the LNK4099
|
|
|
|
# warning from the MS linker complaining that it can't find the 'vc140.pdb'
|
|
|
|
# file used by our object library compilations.
|
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS /Z7)
|
2019-03-01 22:30:17 +00:00
|
|
|
foreach(var_to_update
|
|
|
|
CMAKE_CXX_FLAGS
|
|
|
|
CMAKE_CXX_FLAGS_DEBUG
|
|
|
|
CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
|
|
|
string(REGEX REPLACE "(^| )/Z[i7I]($| )" " /Z7 "
|
|
|
|
"${var_to_update}" "${${var_to_update}}")
|
|
|
|
endforeach()
|
2021-08-04 14:29:32 -07:00
|
|
|
elseif(APPLE)
|
|
|
|
# On Apple platforms use full debug info (i.e. not `-gline-tables-only`)
|
|
|
|
# for all build types so that the runtime can be debugged.
|
|
|
|
if(NOT COMPILER_RT_HAS_G_FLAG)
|
|
|
|
message(FATAL_ERROR "-g is not supported by host compiler")
|
|
|
|
endif()
|
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS -g)
|
2018-04-26 20:34:19 +00:00
|
|
|
elseif(COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG AND NOT COMPILER_RT_DEBUG)
|
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only)
|
|
|
|
elseif(COMPILER_RT_HAS_G_FLAG)
|
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS -g)
|
2013-03-25 10:31:49 +00:00
|
|
|
endif()
|
2014-02-18 07:26:58 +00:00
|
|
|
|
2016-10-08 09:01:27 +00:00
|
|
|
if(LLVM_ENABLE_MODULES)
|
|
|
|
# Sanitizers cannot be built with -fmodules. The interceptors intentionally
|
|
|
|
# don't include system headers, which is incompatible with modules.
|
|
|
|
list(APPEND SANITIZER_COMMON_CFLAGS -fno-modules)
|
|
|
|
endif()
|
|
|
|
|
2014-02-18 07:26:58 +00:00
|
|
|
# Turn off several warnings.
|
2014-11-13 21:19:53 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_WGNU_FLAG -Wno-gnu SANITIZER_COMMON_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG -Wno-variadic-macros SANITIZER_COMMON_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_WC99_EXTENSIONS_FLAG -Wno-c99-extensions SANITIZER_COMMON_CFLAGS)
|
2021-08-12 19:37:29 +02:00
|
|
|
# format-pedantic warns about passing T* for %p, which is not useful.
|
2014-10-23 20:39:58 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_WD4146_FLAG /wd4146 SANITIZER_COMMON_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_WD4291_FLAG /wd4291 SANITIZER_COMMON_CFLAGS)
|
2014-10-15 22:47:54 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_WD4391_FLAG /wd4391 SANITIZER_COMMON_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_WD4722_FLAG /wd4722 SANITIZER_COMMON_CFLAGS)
|
2014-10-23 20:39:58 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_WD4800_FLAG /wd4800 SANITIZER_COMMON_CFLAGS)
|
2012-08-29 00:13:11 +00:00
|
|
|
|
2018-09-26 06:53:01 +00:00
|
|
|
append_list_if(MINGW -fms-extensions SANITIZER_COMMON_CFLAGS)
|
|
|
|
|
2022-12-08 19:29:28 +00:00
|
|
|
# When lsan scans the stack for detecting reachable pointers, it's possible for
|
|
|
|
# a leaked pointer, which was pushed to the stack on an earlier function call,
|
|
|
|
# to still exist on the stack when doing a leak check if that part of the stack
|
|
|
|
# was not overwritten. In particular, if there's any uninitialized data in the
|
|
|
|
# lsan runtime, and the SP we start from is sufficiently deep into the runtime,
|
|
|
|
# then a leaked pointer could be marked as reachable. Such instances could be
|
|
|
|
# mitigated by clobbering any uninitialized data. Note that this won't cover
|
|
|
|
# all possible uninitialized stack contents, such as those used for register
|
|
|
|
# spill slots, unused portions for alignment, or even local variables not
|
|
|
|
# yet in scope at a certain point in the function.
|
|
|
|
#
|
|
|
|
# Note that this type of issue was discovered with lsan, but can apply to other
|
|
|
|
# sanitizers.
|
2024-03-09 14:31:53 -08:00
|
|
|
# Disable PowerPC because of https://github.com/llvm/llvm-project/issues/84654.
|
|
|
|
if(NOT "${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc")
|
|
|
|
append_list_if(COMPILER_RT_HAS_TRIVIAL_AUTO_INIT -ftrivial-auto-var-init=pattern SANITIZER_COMMON_CFLAGS)
|
|
|
|
endif()
|
2022-12-08 19:29:28 +00:00
|
|
|
|
2017-07-28 03:39:38 +00:00
|
|
|
# Set common link flags.
|
2022-07-11 08:08:37 +00:00
|
|
|
# TODO: We should consider using the same model as libc++, that is use either
|
|
|
|
# -nostdlib++ and --unwindlib=none if supported, or -nodefaultlibs otherwise.
|
2022-03-10 11:47:09 +02:00
|
|
|
append_list_if(C_SUPPORTS_NODEFAULTLIBS_FLAG -nodefaultlibs SANITIZER_COMMON_LINK_FLAGS)
|
2019-03-01 01:45:01 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_Z_TEXT -Wl,-z,text SANITIZER_COMMON_LINK_FLAGS)
|
2017-07-28 03:39:38 +00:00
|
|
|
|
2022-07-27 12:30:18 +02:00
|
|
|
# Only necessary for 32-bit SPARC. Solaris 11.2+ ld uses -z ignore/-z record
|
|
|
|
# natively, but supports --as-needed/--no-as-needed for GNU ld compatibility.
|
|
|
|
if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "sparc")
|
|
|
|
list(APPEND SANITIZER_COMMON_LINK_LIBS -Wl,--as-needed atomic -Wl,--no-as-needed)
|
|
|
|
endif()
|
|
|
|
|
2018-07-15 03:05:20 +00:00
|
|
|
if (COMPILER_RT_USE_BUILTINS_LIBRARY)
|
2018-10-29 22:16:56 +00:00
|
|
|
string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
2017-07-28 03:39:38 +00:00
|
|
|
else()
|
2017-07-31 22:46:43 +00:00
|
|
|
if (ANDROID)
|
|
|
|
append_list_if(COMPILER_RT_HAS_GCC_LIB gcc SANITIZER_COMMON_LINK_LIBS)
|
|
|
|
else()
|
|
|
|
append_list_if(COMPILER_RT_HAS_GCC_S_LIB gcc_s SANITIZER_COMMON_LINK_LIBS)
|
|
|
|
endif()
|
2017-07-28 03:39:38 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
append_list_if(COMPILER_RT_HAS_LIBC c SANITIZER_COMMON_LINK_LIBS)
|
2021-06-22 11:03:37 -07:00
|
|
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
|
|
|
|
list(APPEND SANITIZER_COMMON_LINK_LIBS zircon)
|
|
|
|
endif()
|
2025-04-11 16:21:00 -04:00
|
|
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Haiku")
|
|
|
|
list(APPEND SANITIZER_COMMON_LINK_LIBS root)
|
|
|
|
list(APPEND SANITIZER_COMMON_LINK_LIBS bsd)
|
|
|
|
endif()
|
2017-07-28 03:39:38 +00:00
|
|
|
|
2017-08-01 22:22:25 +00:00
|
|
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
|
2021-06-22 11:03:37 -07:00
|
|
|
set(SANITIZER_NO_UNDEFINED_SYMBOLS_DEFAULT ON)
|
|
|
|
else()
|
|
|
|
set(SANITIZER_NO_UNDEFINED_SYMBOLS_DEFAULT OFF)
|
|
|
|
endif()
|
|
|
|
option(SANITIZER_NO_UNDEFINED_SYMBOLS "Report error on unresolved symbol references" ${SANITIZER_NO_UNDEFINED_SYMBOLS_DEFAULT})
|
|
|
|
if (SANITIZER_NO_UNDEFINED_SYMBOLS)
|
2021-06-20 19:10:50 -07:00
|
|
|
list(APPEND SANITIZER_COMMON_LINK_FLAGS -Wl,-z,defs)
|
2017-08-01 22:22:25 +00:00
|
|
|
endif()
|
|
|
|
|
2020-10-30 20:19:39 -07:00
|
|
|
# TODO: COMPILER_RT_COMMON_CFLAGS and COMPILER_RT_COMMON_LINK_FLAGS are
|
|
|
|
# intended for use in non-sanitizer runtimes such as libFuzzer, profile or XRay,
|
|
|
|
# move these higher to include common flags, then derive SANITIZER_COMMON_CFLAGS
|
|
|
|
# and SANITIZER_COMMON_LINK_FLAGS from those and append sanitizer-specific flags.
|
|
|
|
set(COMPILER_RT_COMMON_CFLAGS ${SANITIZER_COMMON_CFLAGS})
|
|
|
|
set(COMPILER_RT_COMMON_LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS})
|
|
|
|
|
|
|
|
# We don't use the C++ standard library, so avoid including it by mistake.
|
|
|
|
append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ SANITIZER_COMMON_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_NOSTDLIBXX_FLAG -nostdlib++ SANITIZER_COMMON_LINK_FLAGS)
|
|
|
|
|
|
|
|
# Remove -stdlib= which is unused when passing -nostdinc++...
|
2020-12-03 10:25:52 -08:00
|
|
|
string(REGEX MATCHALL "-stdlib=[a-zA-Z+]*" stdlib_flag "${CMAKE_CXX_FLAGS}")
|
|
|
|
string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
2020-10-30 20:19:39 -07:00
|
|
|
|
|
|
|
# ...we need it to build some runtimes and tests so readd it where appropriate.
|
|
|
|
list(APPEND COMPILER_RT_COMMON_CFLAGS ${stdlib_flag})
|
|
|
|
list(APPEND COMPILER_RT_COMMON_LINK_FLAGS ${stdlib_flag})
|
|
|
|
|
2022-06-17 08:11:32 +00:00
|
|
|
# TODO: There's a lot of duplication across lib/*/tests/CMakeLists.txt files,
|
|
|
|
# move some of the common flags to COMPILER_RT_UNITTEST_CFLAGS.
|
|
|
|
|
|
|
|
# Unittests need access to C++ standard library.
|
|
|
|
string(APPEND COMPILER_RT_TEST_COMPILER_CFLAGS " ${stdlib_flag}")
|
|
|
|
|
|
|
|
# When cross-compiling, COMPILER_RT_TEST_COMPILER_CFLAGS help in compilation
|
|
|
|
# and linking of unittests.
|
|
|
|
string(REPLACE " " ";" COMPILER_RT_UNITTEST_CFLAGS "${COMPILER_RT_TEST_COMPILER_CFLAGS}")
|
|
|
|
set(COMPILER_RT_UNITTEST_LINK_FLAGS ${COMPILER_RT_UNITTEST_CFLAGS})
|
|
|
|
|
2024-04-12 13:20:30 -07:00
|
|
|
option(COMPILER_RT_TEST_STANDALONE_BUILD_LIBS
|
|
|
|
"When set to ON and testing in a standalone build, test the runtime \
|
|
|
|
libraries built by this standalone build rather than the runtime libraries \
|
|
|
|
shipped with the compiler (used for testing). When set to OFF and testing \
|
|
|
|
in a standalone build, test the runtime libraries shipped with the compiler \
|
|
|
|
(used for testing). This option has no effect if the compiler and this \
|
|
|
|
build are configured to use the same runtime library path."
|
|
|
|
ON)
|
|
|
|
if (COMPILER_RT_TEST_STANDALONE_BUILD_LIBS)
|
|
|
|
# Ensure that the unit tests can find the sanitizer headers prior to installation.
|
|
|
|
list(APPEND COMPILER_RT_UNITTEST_CFLAGS "-I${CMAKE_CURRENT_LIST_DIR}/include")
|
|
|
|
# Ensure that unit tests link against the just-built runtime libraries instead
|
|
|
|
# of the ones bundled with the compiler by overriding the resource directory.
|
|
|
|
#
|
|
|
|
if ("${COMPILER_RT_TEST_COMPILER_ID}" MATCHES "Clang")
|
|
|
|
list(APPEND COMPILER_RT_UNITTEST_LINK_FLAGS "-resource-dir=${COMPILER_RT_OUTPUT_DIR}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2022-04-26 23:23:53 -07:00
|
|
|
if(COMPILER_RT_USE_LLVM_UNWINDER)
|
2022-07-11 08:08:37 +00:00
|
|
|
# We're linking directly against the libunwind that we're building so don't
|
|
|
|
# try to link in the toolchain's default libunwind which may be missing.
|
|
|
|
append_list_if(CXX_SUPPORTS_UNWINDLIB_NONE_FLAG --unwindlib=none COMPILER_RT_COMMON_LINK_FLAGS)
|
|
|
|
append_list_if(CXX_SUPPORTS_UNWINDLIB_NONE_FLAG --unwindlib=none COMPILER_RT_UNITTEST_LINK_FLAGS)
|
2022-04-26 23:23:53 -07:00
|
|
|
if (COMPILER_RT_ENABLE_STATIC_UNWINDER)
|
2022-07-11 08:08:37 +00:00
|
|
|
list(APPEND COMPILER_RT_UNWINDER_LINK_LIBS "$<TARGET_LINKER_FILE:unwind_static>")
|
2022-04-26 23:23:53 -07:00
|
|
|
else()
|
2024-10-14 14:41:19 -07:00
|
|
|
list(APPEND COMPILER_RT_UNWINDER_LINK_LIBS "$<TARGET_LINKER_FILE:$<IF:$<BOOL:${LIBUNWIND_ENABLE_SHARED}>,unwind_shared,unwind_static>>")
|
2022-04-26 23:23:53 -07:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2022-06-02 21:52:56 +00:00
|
|
|
if (COMPILER_RT_CXX_LIBRARY STREQUAL "libcxx")
|
|
|
|
# We are using the in-tree libc++ so avoid including the default one.
|
|
|
|
append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ COMPILER_RT_COMMON_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_NOSTDLIBXX_FLAG -nostdlib++ COMPILER_RT_COMMON_LINK_FLAGS)
|
|
|
|
# Use the in-tree libc++ through explicit include and library paths.
|
2022-09-29 08:48:03 +00:00
|
|
|
set(COMPILER_RT_CXX_CFLAGS "$<$<TARGET_EXISTS:cxx-headers>:$<IF:$<BOOL:${MSVC}>,/imsvc,-isystem>$<JOIN:$<TARGET_PROPERTY:cxx-headers,INTERFACE_INCLUDE_DIRECTORIES>,$<SEMICOLON>$<IF:$<BOOL:${MSVC}>,/imsvc,-isystem>>>")
|
2022-06-02 21:52:56 +00:00
|
|
|
if (COMPILER_RT_STATIC_CXX_LIBRARY)
|
2022-07-11 08:18:28 +00:00
|
|
|
set(COMPILER_RT_CXX_LINK_LIBS "$<TARGET_LINKER_FILE:cxx_static>")
|
2022-06-02 21:52:56 +00:00
|
|
|
else()
|
2024-10-14 14:41:19 -07:00
|
|
|
set(COMPILER_RT_CXX_LINK_LIBS "$<TARGET_LINKER_FILE:$<IF:$<BOOL:${LIBCXX_ENABLE_SHARED}>,cxx_shared,cxx_static>>")
|
2022-06-02 21:52:56 +00:00
|
|
|
endif()
|
|
|
|
elseif (COMPILER_RT_CXX_LIBRARY STREQUAL "none")
|
|
|
|
# We aren't using any C++ standard library so avoid including the default one.
|
|
|
|
append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ COMPILER_RT_COMMON_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_NOSTDLIBXX_FLAG -nostdlib++ COMPILER_RT_COMMON_LINK_FLAGS)
|
|
|
|
else()
|
|
|
|
# Nothing to be done for `default`.
|
|
|
|
endif()
|
|
|
|
|
2022-09-29 06:51:43 +00:00
|
|
|
if (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libc++")
|
|
|
|
if (SANITIZER_CXX_ABI_INTREE)
|
2022-07-11 08:08:37 +00:00
|
|
|
# TODO: We don't need to add --unwindlib=none to SANITIZER_COMMON_LINK_FLAGS
|
|
|
|
# because we added -nodefaultlibs there earlier, and adding would result in
|
|
|
|
# a warning, but if we switch to -nostdlib++, we would need to add it here.
|
|
|
|
# append_list_if(CXX_SUPPORTS_UNWINDLIB_NONE_FLAG --unwindlib=none SANITIZER_COMMON_LINK_FLAGS)
|
2022-09-29 07:53:06 +00:00
|
|
|
if(SANITIZER_USE_STATIC_CXX_ABI)
|
|
|
|
if(TARGET libcxx-abi-static)
|
|
|
|
set(SANITIZER_CXX_ABI_LIBRARIES libcxx-abi-static)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
if(TARGET libcxx-abi-shared)
|
|
|
|
set(SANITIZER_CXX_ABI_LIBRARIES libcxx-abi-shared)
|
|
|
|
elseif(TARGET libcxx-abi-static)
|
|
|
|
set(SANITIZER_CXX_ABI_LIBRARIES libcxx-abi-static)
|
|
|
|
endif()
|
2018-05-22 18:33:27 +00:00
|
|
|
endif()
|
|
|
|
else()
|
2022-09-29 06:51:43 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_LIBCXX c++ SANITIZER_CXX_ABI_LIBRARIES)
|
2018-05-22 18:33:27 +00:00
|
|
|
endif()
|
Add libcxxabi option back for sanitizer use.
Summary:
A prior refactoring accidentally dropped the case for using libc++abi as
the out-of-tree C++ runtime library for sanitizers. This patch restores
that functionality, which is used by Android, which can't depend on the
full libc++ for these libraries.
Reviewers: phosek, EricWF
Reviewed By: phosek
Subscribers: meikeb, kongyi, chh, mgorny, delcypher, llvm-commits, #sanitizers, pirama
Differential Revision: https://reviews.llvm.org/D49157
llvm-svn: 336749
2018-07-11 00:50:03 +00:00
|
|
|
elseif (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libcxxabi")
|
2019-02-16 08:34:26 +00:00
|
|
|
list(APPEND SANITIZER_CXX_ABI_LIBRARIES "c++abi")
|
2018-05-22 18:33:27 +00:00
|
|
|
elseif (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libstdc++")
|
2019-02-16 08:34:26 +00:00
|
|
|
append_list_if(COMPILER_RT_HAS_LIBSTDCXX stdc++ SANITIZER_CXX_ABI_LIBRARIES)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (SANITIZER_TEST_CXX_LIBNAME STREQUAL "libc++")
|
2022-01-25 09:42:28 -08:00
|
|
|
if (SANITIZER_TEST_CXX_INTREE)
|
2022-09-29 08:48:03 +00:00
|
|
|
list(APPEND SANITIZER_TEST_CXX_CFLAGS "$<$<TARGET_EXISTS:cxx-headers>:$<IF:$<BOOL:${MSVC}>,/imsvc,-isystem>$<JOIN:$<TARGET_PROPERTY:cxx-headers,INTERFACE_INCLUDE_DIRECTORIES>,$<SEMICOLON>$<IF:$<BOOL:${MSVC}>,/imsvc,-isystem>>>")
|
2022-01-25 16:10:51 -08:00
|
|
|
if (SANITIZER_USE_STATIC_TEST_CXX)
|
2022-07-11 08:18:28 +00:00
|
|
|
list(APPEND SANITIZER_TEST_CXX_LIBRARIES "$<TARGET_LINKER_FILE:cxx_static>")
|
2022-01-25 16:10:51 -08:00
|
|
|
else()
|
2024-10-14 14:41:19 -07:00
|
|
|
list(APPEND SANITIZER_TEST_CXX_LIBRARIES "$<TARGET_LINKER_FILE:$<IF:$<BOOL:${LIBCXX_ENABLE_SHARED}>,cxx_shared,cxx_static>>")
|
2022-01-25 09:42:28 -08:00
|
|
|
endif()
|
2022-06-17 08:11:32 +00:00
|
|
|
# We are using the in tree libc++ so avoid including the default one.
|
|
|
|
append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ COMPILER_RT_UNITTEST_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_NOSTDLIBXX_FLAG -nostdlib++ COMPILER_RT_UNITTEST_LINK_FLAGS)
|
2022-01-25 09:42:28 -08:00
|
|
|
else()
|
2022-01-25 16:10:51 -08:00
|
|
|
append_list_if(COMPILER_RT_HAS_LIBCXX -lc++ SANITIZER_TEST_CXX_LIBRARIES)
|
2022-01-25 09:42:28 -08:00
|
|
|
endif()
|
2019-02-16 08:34:26 +00:00
|
|
|
elseif (SANITIZER_TEST_CXX_LIBNAME STREQUAL "libstdc++")
|
2022-01-25 16:10:51 -08:00
|
|
|
append_list_if(COMPILER_RT_HAS_LIBSTDCXX -lstdc++ SANITIZER_TEST_CXX_LIBRARIES)
|
2018-05-22 18:33:27 +00:00
|
|
|
endif()
|
|
|
|
|
2020-10-30 16:16:09 -07:00
|
|
|
# Unittests support.
|
2022-11-10 00:31:01 +00:00
|
|
|
# FIXME: When compiler-rt is build using -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON, then
|
|
|
|
# The LLVM_THIRD_PARTY_DIR variable is not set.
|
|
|
|
if (NOT LLVM_THIRD_PARTY_DIR)
|
|
|
|
set(LLVM_THIRD_PARTY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../third-party")
|
|
|
|
endif()
|
|
|
|
|
2022-11-09 08:51:34 -08:00
|
|
|
set(COMPILER_RT_GTEST_PATH ${LLVM_THIRD_PARTY_DIR}/unittest/googletest)
|
2020-10-30 16:16:09 -07:00
|
|
|
set(COMPILER_RT_GTEST_SOURCE ${COMPILER_RT_GTEST_PATH}/src/gtest-all.cc)
|
|
|
|
set(COMPILER_RT_GTEST_CFLAGS
|
|
|
|
-DGTEST_NO_LLVM_SUPPORT=1
|
|
|
|
-DGTEST_HAS_RTTI=0
|
|
|
|
-I${COMPILER_RT_GTEST_PATH}/include
|
|
|
|
-I${COMPILER_RT_GTEST_PATH}
|
|
|
|
)
|
|
|
|
|
|
|
|
# Mocking support.
|
2022-11-09 08:51:34 -08:00
|
|
|
set(COMPILER_RT_GMOCK_PATH ${LLVM_THIRD_PARTY_DIR}/unittest/googlemock)
|
2020-10-30 16:16:09 -07:00
|
|
|
set(COMPILER_RT_GMOCK_SOURCE ${COMPILER_RT_GMOCK_PATH}/src/gmock-all.cc)
|
|
|
|
set(COMPILER_RT_GMOCK_CFLAGS
|
|
|
|
-DGTEST_NO_LLVM_SUPPORT=1
|
|
|
|
-DGTEST_HAS_RTTI=0
|
|
|
|
-I${COMPILER_RT_GMOCK_PATH}/include
|
|
|
|
-I${COMPILER_RT_GMOCK_PATH}
|
|
|
|
)
|
|
|
|
|
2021-07-30 16:56:36 +02:00
|
|
|
if(COMPILER_RT_HAS_G_FLAG)
|
|
|
|
list(APPEND COMPILER_RT_UNITTEST_CFLAGS -g)
|
|
|
|
endif()
|
2020-10-30 16:16:09 -07:00
|
|
|
append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 COMPILER_RT_UNITTEST_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_WCOVERED_SWITCH_DEFAULT_FLAG -Wno-covered-switch-default COMPILER_RT_UNITTEST_CFLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_WSUGGEST_OVERRIDE_FLAG -Wno-suggest-override COMPILER_RT_UNITTEST_CFLAGS)
|
2023-12-05 13:29:46 -05:00
|
|
|
# Detect if the compiler toolchain includes gcc-toolset-12.
|
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR
|
|
|
|
"${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
|
|
|
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -v
|
|
|
|
RESULT_VARIABLE compiler_info_rc
|
|
|
|
OUTPUT_VARIABLE compiler_info
|
|
|
|
ERROR_VARIABLE compiler_info)
|
|
|
|
if(compiler_info MATCHES ".*gcc-toolset-12.*")
|
|
|
|
set(USING_GCC_TOOLSET_12 TRUE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
if(MSVC OR (LINUX AND DEFINED USING_GCC_TOOLSET_12 AND
|
|
|
|
CMAKE_CXX_STANDARD EQUAL 17))
|
|
|
|
# gtest use a lot of stuff marked as deprecated on Windows or if using
|
|
|
|
# gcc-toolset-12 in the compiler toolchain on Linux; all of the
|
|
|
|
# deprecated declarations in gcc-toolset-12 used in Google Tests have been
|
|
|
|
# observed to be _GLIBCXX17_DEPRECATED and should go away once
|
|
|
|
# CMAKE_CXX_STANDARD is greater than 17.
|
2020-10-30 16:16:09 -07:00
|
|
|
list(APPEND COMPILER_RT_GTEST_CFLAGS -Wno-deprecated-declarations)
|
|
|
|
endif()
|
|
|
|
|
2016-06-17 18:30:37 +00:00
|
|
|
# Warnings to turn off for all libraries, not just sanitizers.
|
|
|
|
append_string_if(COMPILER_RT_HAS_WUNUSED_PARAMETER_FLAG -Wno-unused-parameter CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
|
|
|
|
2017-01-04 21:40:00 +00:00
|
|
|
if (CMAKE_LINKER MATCHES "link.exe$")
|
|
|
|
# Silence MSVC linker warnings caused by empty object files. The
|
|
|
|
# sanitizer libraries intentionally use ifdefs that result in empty
|
|
|
|
# files, rather than skipping these files in the build system.
|
|
|
|
# Ideally, we would pass this flag only for the libraries that need
|
|
|
|
# it, but CMake doesn't seem to have a way to set linker flags for
|
|
|
|
# individual static libraries, so we enable the suppression flag for
|
|
|
|
# the whole compiler-rt project.
|
2024-12-04 10:09:29 +01:00
|
|
|
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/IGNORE:4221")
|
2017-01-04 21:40:00 +00:00
|
|
|
endif()
|
|
|
|
|
2013-04-11 15:49:52 +00:00
|
|
|
add_subdirectory(include)
|
|
|
|
|
2019-01-14 20:33:30 +00:00
|
|
|
option(COMPILER_RT_USE_LIBCXX
|
|
|
|
"Enable compiler-rt to use libc++ from the source tree" ON)
|
2022-06-25 03:10:55 +00:00
|
|
|
if(COMPILER_RT_USE_LIBCXX)
|
|
|
|
if(LLVM_ENABLE_PROJECTS_USED)
|
|
|
|
# Don't use libcxx if LLVM_ENABLE_PROJECTS does not enable it.
|
|
|
|
set(COMPILER_RT_LIBCXX_PATH ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR})
|
|
|
|
set(COMPILER_RT_LIBCXXABI_PATH ${LLVM_EXTERNAL_LIBCXXABI_SOURCE_DIR})
|
2022-10-11 23:24:13 -07:00
|
|
|
else()
|
2022-06-25 03:10:55 +00:00
|
|
|
foreach(path IN ITEMS ${LLVM_MAIN_SRC_DIR}/projects/libcxx
|
|
|
|
${LLVM_MAIN_SRC_DIR}/runtimes/libcxx
|
|
|
|
${LLVM_MAIN_SRC_DIR}/../libcxx
|
|
|
|
${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR})
|
|
|
|
if(IS_DIRECTORY ${path})
|
|
|
|
set(COMPILER_RT_LIBCXX_PATH ${path})
|
|
|
|
break()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
foreach(path IN ITEMS ${LLVM_MAIN_SRC_DIR}/projects/libcxxabi
|
|
|
|
${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi
|
|
|
|
${LLVM_MAIN_SRC_DIR}/../libcxxabi
|
|
|
|
${LLVM_EXTERNAL_LIBCXXABI_SOURCE_DIR})
|
|
|
|
if(IS_DIRECTORY ${path})
|
|
|
|
set(COMPILER_RT_LIBCXXABI_PATH ${path})
|
|
|
|
break()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
endif()
|
2014-02-14 13:02:58 +00:00
|
|
|
|
2023-09-11 11:01:37 -07:00
|
|
|
if (LINKER_IS_LLD OR LLVM_TOOL_LLD_BUILD)
|
|
|
|
set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/tools/lld)
|
|
|
|
if(EXISTS ${COMPILER_RT_LLD_PATH}/)
|
2023-06-06 15:59:26 -07:00
|
|
|
set(COMPILER_RT_HAS_LLD TRUE)
|
2023-09-11 11:01:37 -07:00
|
|
|
else()
|
|
|
|
set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/../lld)
|
|
|
|
if(EXISTS ${COMPILER_RT_LLD_PATH}/)
|
|
|
|
set(COMPILER_RT_HAS_LLD TRUE)
|
|
|
|
endif()
|
2023-06-06 15:59:26 -07:00
|
|
|
endif()
|
2015-08-11 00:33:07 +00:00
|
|
|
endif()
|
2020-11-03 16:10:35 -08:00
|
|
|
|
|
|
|
if(ANDROID)
|
|
|
|
set(COMPILER_RT_HAS_LLD TRUE)
|
|
|
|
set(COMPILER_RT_TEST_USE_LLD TRUE)
|
|
|
|
append_list_if(COMPILER_RT_HAS_FUSE_LD_LLD_FLAG -fuse-ld=lld SANITIZER_COMMON_LINK_FLAGS)
|
|
|
|
append_list_if(COMPILER_RT_HAS_LLD -fuse-ld=lld COMPILER_RT_UNITTEST_LINK_FLAGS)
|
|
|
|
endif()
|
2024-07-29 09:12:15 +02:00
|
|
|
if(${COMPILER_RT_DEFAULT_TARGET_ARCH} MATCHES sparc)
|
|
|
|
# lld has several bugs/limitations on SPARC, so disable (Issue #100320).
|
|
|
|
set(COMPILER_RT_HAS_LLD FALSE)
|
|
|
|
endif()
|
2017-03-25 00:42:25 +00:00
|
|
|
pythonize_bool(COMPILER_RT_HAS_LLD)
|
2020-11-03 16:10:35 -08:00
|
|
|
pythonize_bool(COMPILER_RT_TEST_USE_LLD)
|
2015-08-11 00:33:07 +00:00
|
|
|
|
2023-09-08 11:06:51 -07:00
|
|
|
option(COMPILER_RT_ENABLE_INTERNAL_SYMBOLIZER "Build Compiler RT linked with in LLVM symbolizer" OFF)
|
|
|
|
mark_as_advanced(COMPILER_RT_ENABLE_INTERNAL_SYMBOLIZER)
|
|
|
|
|
2025-03-26 04:59:35 +05:30
|
|
|
option(SANITIZER_DISABLE_SYMBOLIZER_PATH_SEARCH "Disable searching for external symbolizer in $PATH" OFF)
|
|
|
|
mark_as_advanced(SANITIZER_DISABLE_SYMBOLIZER_PATH_SEARCH)
|
|
|
|
|
|
|
|
if (SANITIZER_DISABLE_SYMBOLIZER_PATH_SEARCH)
|
|
|
|
add_compile_definitions(SANITIZER_DISABLE_SYMBOLIZER_PATH_SEARCH)
|
|
|
|
endif()
|
|
|
|
|
2012-04-04 22:12:04 +00:00
|
|
|
add_subdirectory(lib)
|
|
|
|
|
2014-02-19 11:18:47 +00:00
|
|
|
if(COMPILER_RT_INCLUDE_TESTS)
|
2020-09-02 20:41:15 +00:00
|
|
|
# Don't build llvm-lit for runtimes-build, it will clean up map_config.
|
2021-03-03 00:39:50 -08:00
|
|
|
if (COMPILER_RT_STANDALONE_BUILD AND NOT LLVM_RUNTIMES_BUILD)
|
2017-09-15 22:10:46 +00:00
|
|
|
# If we have a valid source tree, generate llvm-lit into the bin directory.
|
|
|
|
# The user can still choose to have the check targets *use* a different lit
|
|
|
|
# by specifying -DLLVM_EXTERNAL_LIT, but we generate it regardless.
|
|
|
|
if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)
|
2020-04-06 20:38:26 -04:00
|
|
|
# Needed for lit support in standalone builds.
|
|
|
|
include(AddLLVM)
|
2017-09-15 22:10:46 +00:00
|
|
|
add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
|
2024-02-27 13:00:07 -08:00
|
|
|
# Ensure that the testsuite uses the local lit rather than
|
|
|
|
# LLVM_INSTALL_DIR/bin/llvm-lit (which probably does not exist).
|
|
|
|
get_llvm_lit_path(_base_dir _file_name)
|
|
|
|
set(LLVM_EXTERNAL_LIT "${_base_dir}/${_file_name}" CACHE STRING "Command used to spawn lit" FORCE)
|
2017-09-15 22:10:46 +00:00
|
|
|
elseif(NOT EXISTS ${LLVM_EXTERNAL_LIT})
|
|
|
|
message(WARNING "Could not find LLVM source directory and LLVM_EXTERNAL_LIT does not"
|
|
|
|
"point to a valid file. You will not be able to run tests.")
|
|
|
|
endif()
|
|
|
|
endif()
|
2024-02-27 13:00:07 -08:00
|
|
|
add_subdirectory(unittests)
|
|
|
|
add_subdirectory(test)
|
2012-04-04 22:12:04 +00:00
|
|
|
endif()
|
Add GWP-ASan fuzz target to compiler-rt/tools.
Summary:
@eugenis to approve addition of //compiler-rt/tools.
@pree-jackie please confirm that this WFY.
D66494 introduced the GWP-ASan stack_trace_compressor_fuzzer. Building fuzz
targets in compiler-rt is a new affair, and has some challenges:
- If the host compiler doesn't have compiler-rt, the -fsanitize=fuzzer may not
be able to link against `libclang_rt.fuzzer*`.
- Things in compiler-rt generally aren't built when you want to build with
sanitizers using `-DLLVM_USE_SANITIZER`. This tricky to work around, so
we create the new tools directory so that we can build fuzz targets with
sanitizers. This has the added bonus of fixing the problem above as well, as
we can now just guard the fuzz target build to only be done with
`-DLLVM_USE_SANITIZE_COVERAGE=On`.
Reviewers: eugenis, pree-jackie
Reviewed By: eugenis, pree-jackie
Subscribers: dberris, mgorny, #sanitizers, llvm-commits, eugenis, pree-jackie, lebedev.ri, vitalybuka, morehouse
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D66776
llvm-svn: 370094
2019-08-27 18:28:07 +00:00
|
|
|
|
|
|
|
add_subdirectory(tools)
|