diff options
author | Dean Michael Berris <dberris@google.com> | 2017-08-03 00:58:45 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2017-08-03 00:58:45 +0000 |
commit | 449fdf816e0b18ff75c2b4a9b3f9ce83063c57b6 (patch) | |
tree | 2690a33b7caa02a9831d4a56b2666b6ac7ecb1a3 /compiler-rt/CMakeLists.txt | |
parent | 1efd2229f07069dac5fc2a5da97f5056021a42f7 (diff) | |
download | bcm5719-llvm-449fdf816e0b18ff75c2b4a9b3f9ce83063c57b6.tar.gz bcm5719-llvm-449fdf816e0b18ff75c2b4a9b3f9ce83063c57b6.zip |
[XRay][compiler-rt] Allow for building the XRay runtime without PREINIT initialization.
Summary:
Define a build-time configuration option for the XRay runtime to
determine whether the archive will add an entry to the `.preinit_array`
section of the binary. We also allow for initializing the XRay data
structures with an explicit call to __xray_init(). This allows us to
give users the capability to initialize the XRay data structures on
demand.
This can allow us to start porting XRay to platforms where
`.preinit_array` isn't a supported section. It also allows us to limit
the effects of XRay in the initialization sequence for applications that
are sensitive to this kind of interference (i.e. large binaries) or
those that want to package XRay control in libraries.
Future changes should allow us to build two different library archives
for the XRay runtime, and allow clang users to determine which version
to link.
Reviewers: dblaikie, kpw, pelikan
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D36080
llvm-svn: 309909
Diffstat (limited to 'compiler-rt/CMakeLists.txt')
-rw-r--r-- | compiler-rt/CMakeLists.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index 5fbc8554c56..5f277e0db0c 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -36,6 +36,8 @@ option(COMPILER_RT_BUILD_SANITIZERS "Build sanitizers" ON) mark_as_advanced(COMPILER_RT_BUILD_SANITIZERS) option(COMPILER_RT_BUILD_XRAY "Build xray" ON) mark_as_advanced(COMPILER_RT_BUILD_XRAY) +option(COMPILER_RT_BUILD_XRAY_NO_PREINIT "Build xray with no preinit patching" OFF) +mark_as_advanced(COMPILER_RT_BUILD_XRAY_NO_PREINIT) set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOLEAN "Build for a bare-metal target.") |