[Sanitizer] first effort to start building ASan runtime with -Werror in CMake build
llvm-svn: 163686
This commit is contained in:
parent
c3d9a3d881
commit
694633e19b
|
|
@ -62,6 +62,7 @@ endfunction()
|
||||||
|
|
||||||
# Provide some common commmandline flags for Sanitizer runtimes.
|
# Provide some common commmandline flags for Sanitizer runtimes.
|
||||||
set(SANITIZER_COMMON_CFLAGS
|
set(SANITIZER_COMMON_CFLAGS
|
||||||
|
-Werror
|
||||||
-fPIC
|
-fPIC
|
||||||
-fno-builtin
|
-fno-builtin
|
||||||
-fno-exceptions
|
-fno-exceptions
|
||||||
|
|
|
||||||
|
|
@ -625,7 +625,7 @@ void InitializeAsanInterceptors() {
|
||||||
#if !MAC_INTERPOSE_FUNCTIONS
|
#if !MAC_INTERPOSE_FUNCTIONS
|
||||||
// If we're using dynamic interceptors on Mac, these two are just plain
|
// If we're using dynamic interceptors on Mac, these two are just plain
|
||||||
// functions.
|
// functions.
|
||||||
*(uptr*)&REAL(memcpy) = (uptr)REAL(memmove);
|
internal_memcpy(&REAL(memcpy), &REAL(memmove), sizeof(REAL(memmove)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ include_directories(../..)
|
||||||
set(ASAN_UNITTEST_COMMON_CFLAGS
|
set(ASAN_UNITTEST_COMMON_CFLAGS
|
||||||
-Wall
|
-Wall
|
||||||
-Wno-format
|
-Wno-format
|
||||||
|
-Werror
|
||||||
-fvisibility=hidden
|
-fvisibility=hidden
|
||||||
-g
|
-g
|
||||||
-O2
|
-O2
|
||||||
|
|
|
||||||
|
|
@ -678,9 +678,10 @@ TEST(AddressSanitizerInterface, DISABLED_InvalidPoisonAndUnpoisonCallsTest) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ErrorReportCallbackOneToZ(const char *report) {
|
static void ErrorReportCallbackOneToZ(const char *report) {
|
||||||
write(2, "ABCDEF", 6);
|
int report_len = strlen(report);
|
||||||
write(2, report, strlen(report));
|
ASSERT_EQ(6, write(2, "ABCDEF", 6));
|
||||||
write(2, "ABCDEF", 6);
|
ASSERT_EQ(report_len, write(2, report, report_len));
|
||||||
|
ASSERT_EQ(6, write(2, "ABCDEF", 6));
|
||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ if(LLVM_INCLUDE_TESTS)
|
||||||
add_library(RTSanitizerCommon.test STATIC ${SANITIZER_SOURCES})
|
add_library(RTSanitizerCommon.test STATIC ${SANITIZER_SOURCES})
|
||||||
# Build test library with debug info.
|
# Build test library with debug info.
|
||||||
set_target_compile_flags(RTSanitizerCommon.test
|
set_target_compile_flags(RTSanitizerCommon.test
|
||||||
${SANITIZER_CFLAGS} -g -Werror)
|
${SANITIZER_CFLAGS} -g)
|
||||||
set_target_properties(RTSanitizerCommon.test PROPERTIES
|
set_target_properties(RTSanitizerCommon.test PROPERTIES
|
||||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue