diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-08-29 00:13:11 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-08-29 00:13:11 +0000 |
commit | 60ab090deed8213613643729a7921ef0915ac704 (patch) | |
tree | 4f21037c600edc3a73c359c84a7233ced95ad447 /lib | |
parent | 80acccf4647c3482c3e3e6ae21e757ba580a5956 (diff) | |
download | compiler-rt-60ab090deed8213613643729a7921ef0915ac704.tar.gz compiler-rt-60ab090deed8213613643729a7921ef0915ac704.tar.bz2 compiler-rt-60ab090deed8213613643729a7921ef0915ac704.tar.xz |
Some flag cleanup for the sanitizer runtimes.
This hoists most of the CFLAGS into a common variable. It also adds
detection for -Wno-c99-extensions and uses it to silence a pile of
warnings.
Finally, it switches to the proper flag -rdynamic.
With this, the cmake build is warning free on my bootstrap Linux build.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162809 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/asan/CMakeLists.txt | 9 | ||||
-rw-r--r-- | lib/asan/tests/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lib/interception/CMakeLists.txt | 11 | ||||
-rw-r--r-- | lib/sanitizer_common/CMakeLists.txt | 8 |
4 files changed, 4 insertions, 26 deletions
diff --git a/lib/asan/CMakeLists.txt b/lib/asan/CMakeLists.txt index 16080242..8051e335 100644 --- a/lib/asan/CMakeLists.txt +++ b/lib/asan/CMakeLists.txt @@ -29,10 +29,7 @@ set(ASAN_DYLIB_SOURCES include_directories(..) set(ASAN_CFLAGS - -fPIC - -fno-exceptions - -funwind-tables - -fvisibility=hidden + ${SANITIZER_COMMON_CFLAGS} -fno-builtin -fomit-frame-pointer -O3 @@ -43,10 +40,6 @@ set(ASAN_DYLIB_DEFINITIONS MAC_INTERPOSE_FUNCTIONS=1 ) -if (SUPPORTS_NO_VARIADIC_MACROS_FLAG) - list(APPEND ASAN_CFLAGS -Wno-variadic-macros) -endif () - if (APPLE) list(APPEND ASAN_CFLAGS -mmacosx-version-min=10.5) endif() diff --git a/lib/asan/tests/CMakeLists.txt b/lib/asan/tests/CMakeLists.txt index 364a9445..09ceea02 100644 --- a/lib/asan/tests/CMakeLists.txt +++ b/lib/asan/tests/CMakeLists.txt @@ -60,7 +60,7 @@ function(add_asan_test testname) elseif (UNIX) # Linux-specific linker flags. set_property(TARGET ${testname} APPEND PROPERTY - LINK_FLAGS "-lpthread -ldl -export-dynamic") + LINK_FLAGS "-lpthread -ldl -rdynamic") if(LLVM_BUILD_32_BITS) target_link_libraries(${testname} clang_rt.asan-i386) else() diff --git a/lib/interception/CMakeLists.txt b/lib/interception/CMakeLists.txt index 55046e91..27e0452f 100644 --- a/lib/interception/CMakeLists.txt +++ b/lib/interception/CMakeLists.txt @@ -13,16 +13,7 @@ if (APPLE) list(APPEND INTERCEPTION_SOURCES mach_override/mach_override.c) endif () -set(INTERCEPTION_CFLAGS - -O3 - -fPIC - -fno-exceptions - -funwind-tables - -fvisibility=hidden - ) -if(SUPPORTS_NO_VARIADIC_MACROS_FLAG) - list(APPEND INTERCEPTION_CFLAGS -Wno-variadic-macros) -endif() +set(INTERCEPTION_CFLAGS -O3 ${SANITIZER_COMMON_CFLAGS}) if(APPLE) # Build universal binary on APPLE. diff --git a/lib/sanitizer_common/CMakeLists.txt b/lib/sanitizer_common/CMakeLists.txt index c4f3b482..cb425a21 100644 --- a/lib/sanitizer_common/CMakeLists.txt +++ b/lib/sanitizer_common/CMakeLists.txt @@ -18,13 +18,7 @@ set(SANITIZER_SOURCES sanitizer_win.cc ) -set(SANITIZER_CFLAGS - -O3 - -fPIC - -fno-exceptions - -funwind-tables - -fvisibility=hidden - ) +set(SANITIZER_CFLAGS -O3 ${SANITIZER_COMMON_CFLAGS}) set(SANITIZER_COMMON_DEFINITIONS) |