diff options
author | Dean Michael Berris <dberris@google.com> | 2016-11-16 01:01:13 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2016-11-16 01:01:13 +0000 |
commit | a1df33d42314dc8c52e3eb5254f0f216397e60fc (patch) | |
tree | 3170b1ed69ea95bca55af2ddfebef5da3fdf08a2 /cmake/builtin-config-ix.cmake | |
parent | ec301129e76d82fbdf59168f7478b343cff71294 (diff) |
[XRay][compiler-rt] Disable XRay instrumentation of the XRay runtime.
Summary:
Adds a CMake check for whether the compiler used to build the XRay
library supports XRay-instrumentation. If the compiler we're using does
support the `-fxray-instrument` flag (i.e. recently-built Clang), we
define the XRAY_NEVER_INSTRUMENT macro that then makes sure that the
XRay runtime functions never get XRay-instrumented.
This prevents potential weirdness involved with building the XRay
library with a Clang that supports XRay-instrumentation, and is
attempting to XRay-instrument the build of compiler-rt.
Reviewers: majnemer, rSerge, echristo
Subscribers: mehdi_amini, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D26597
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@287068 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/builtin-config-ix.cmake')
-rw-r--r-- | cmake/builtin-config-ix.cmake | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmake/builtin-config-ix.cmake b/cmake/builtin-config-ix.cmake index 92896187d..269f83b6c 100644 --- a/cmake/builtin-config-ix.cmake +++ b/cmake/builtin-config-ix.cmake @@ -4,6 +4,7 @@ include(CheckCSourceCompiles) # Make all the tests only check the compiler set(TEST_COMPILE_ONLY On) +# Check host compiler support for certain flags builtin_check_c_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG) builtin_check_c_compiler_flag(-fPIE COMPILER_RT_HAS_FPIE_FLAG) builtin_check_c_compiler_flag(-fno-builtin COMPILER_RT_HAS_FNO_BUILTIN_FLAG) @@ -11,6 +12,7 @@ builtin_check_c_compiler_flag(-std=c99 COMPILER_RT_HAS_STD_C99_FLAG builtin_check_c_compiler_flag(-fvisibility=hidden COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG) builtin_check_c_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG) builtin_check_c_compiler_flag(-ffreestanding COMPILER_RT_HAS_FREESTANDING_FLAG) +builtin_check_c_compiler_flag(-fxray-instrument COMPILER_RT_HAS_XRAY_COMPILER_FLAG) builtin_check_c_compiler_source(COMPILER_RT_HAS_ATOMIC_KEYWORD " |