diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-09-12 07:38:47 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-09-12 07:38:47 +0000 |
commit | 694633e19b38e469171c3cc238ad5c208c98587c (patch) | |
tree | b46e5ffc92977b81bb77687d5d38fdc5e378c5b9 | |
parent | c3d9a3d881ef034ffa71533a5bf8bcf99a9ca8c3 (diff) | |
download | bcm5719-llvm-694633e19b38e469171c3cc238ad5c208c98587c.tar.gz bcm5719-llvm-694633e19b38e469171c3cc238ad5c208c98587c.zip |
[Sanitizer] first effort to start building ASan runtime with -Werror in CMake build
llvm-svn: 163686
-rw-r--r-- | compiler-rt/CMakeLists.txt | 1 | ||||
-rw-r--r-- | compiler-rt/lib/asan/asan_interceptors.cc | 2 | ||||
-rw-r--r-- | compiler-rt/lib/asan/tests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | compiler-rt/lib/asan/tests/asan_noinst_test.cc | 7 | ||||
-rw-r--r-- | compiler-rt/lib/sanitizer_common/CMakeLists.txt | 2 |
5 files changed, 8 insertions, 5 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index d336eedda6c..a10a83bfe5e 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -62,6 +62,7 @@ endfunction() # Provide some common commmandline flags for Sanitizer runtimes. set(SANITIZER_COMMON_CFLAGS + -Werror -fPIC -fno-builtin -fno-exceptions diff --git a/compiler-rt/lib/asan/asan_interceptors.cc b/compiler-rt/lib/asan/asan_interceptors.cc index 900bf5ac8b8..cbc35abf734 100644 --- a/compiler-rt/lib/asan/asan_interceptors.cc +++ b/compiler-rt/lib/asan/asan_interceptors.cc @@ -625,7 +625,7 @@ void InitializeAsanInterceptors() { #if !MAC_INTERPOSE_FUNCTIONS // If we're using dynamic interceptors on Mac, these two are just plain // functions. - *(uptr*)&REAL(memcpy) = (uptr)REAL(memmove); + internal_memcpy(&REAL(memcpy), &REAL(memmove), sizeof(REAL(memmove))); #endif } diff --git a/compiler-rt/lib/asan/tests/CMakeLists.txt b/compiler-rt/lib/asan/tests/CMakeLists.txt index b8ff061128e..d92e6474176 100644 --- a/compiler-rt/lib/asan/tests/CMakeLists.txt +++ b/compiler-rt/lib/asan/tests/CMakeLists.txt @@ -17,6 +17,7 @@ include_directories(../..) set(ASAN_UNITTEST_COMMON_CFLAGS -Wall -Wno-format + -Werror -fvisibility=hidden -g -O2 diff --git a/compiler-rt/lib/asan/tests/asan_noinst_test.cc b/compiler-rt/lib/asan/tests/asan_noinst_test.cc index 70b59f029f7..76ec387549b 100644 --- a/compiler-rt/lib/asan/tests/asan_noinst_test.cc +++ b/compiler-rt/lib/asan/tests/asan_noinst_test.cc @@ -678,9 +678,10 @@ TEST(AddressSanitizerInterface, DISABLED_InvalidPoisonAndUnpoisonCallsTest) { } static void ErrorReportCallbackOneToZ(const char *report) { - write(2, "ABCDEF", 6); - write(2, report, strlen(report)); - write(2, "ABCDEF", 6); + int report_len = strlen(report); + ASSERT_EQ(6, write(2, "ABCDEF", 6)); + ASSERT_EQ(report_len, write(2, report, report_len)); + ASSERT_EQ(6, write(2, "ABCDEF", 6)); _exit(1); } diff --git a/compiler-rt/lib/sanitizer_common/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/CMakeLists.txt index 4c24fceb3ed..f3461630b08 100644 --- a/compiler-rt/lib/sanitizer_common/CMakeLists.txt +++ b/compiler-rt/lib/sanitizer_common/CMakeLists.txt @@ -58,7 +58,7 @@ if(LLVM_INCLUDE_TESTS) add_library(RTSanitizerCommon.test STATIC ${SANITIZER_SOURCES}) # Build test library with debug info. set_target_compile_flags(RTSanitizerCommon.test - ${SANITIZER_CFLAGS} -g -Werror) + ${SANITIZER_CFLAGS} -g) set_target_properties(RTSanitizerCommon.test PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) |