Commit b9c3d091 authored by Jakob Otto's avatar Jakob Otto

Enable ubsan

parent 1ea49b14
...@@ -287,10 +287,10 @@ if(CAF_MORE_WARNINGS) ...@@ -287,10 +287,10 @@ if(CAF_MORE_WARNINGS)
endif() endif()
# Enable ASAN if requested by the user. # Enable ASAN if requested by the user.
if(CAF_ENABLE_ADDRESS_SANITIZER AND NOT WIN32) if(CAF_SANITIZERS)
add_compile_options("-fsanitize=address" add_compile_options("-fsanitize=${CAF_SANITIZERS}"
"-fno-omit-frame-pointer") "-fno-omit-frame-pointer")
list(APPEND CAF_EXTRA_LDFLAGS "-fsanitize=address") list(APPEND CAF_EXTRA_LDFLAGS "-fsanitize=${CAF_SANITIZERS}")
endif() endif()
# -pthread is ignored on MacOSX but required on other platforms # -pthread is ignored on MacOSX but required on other platforms
......
...@@ -9,7 +9,7 @@ defaultReleaseBuildFlags = [ ...@@ -9,7 +9,7 @@ defaultReleaseBuildFlags = [
// Default CMake flags for debug builds. // Default CMake flags for debug builds.
defaultDebugBuildFlags = defaultReleaseBuildFlags + [ defaultDebugBuildFlags = defaultReleaseBuildFlags + [
'CAF_ENABLE_ADDRESS_SANITIZER:BOOL=yes', 'CAF_SANITIZERS:STRING=address,undefined',
'CAF_LOG_LEVEL:STRING=TRACE', 'CAF_LOG_LEVEL:STRING=TRACE',
] ]
...@@ -61,6 +61,7 @@ config = [ ...@@ -61,6 +61,7 @@ config = [
builds: ['debug'], builds: ['debug'],
tools: ['gcc-8'], tools: ['gcc-8'],
extraSteps: ['coverageReport'], extraSteps: ['coverageReport'],
extraFlags: ['BUILD_SHARED_LIBS:BOOL=OFF'],
]], ]],
['fedora-28', [ ['fedora-28', [
builds: ['release'], builds: ['release'],
...@@ -94,19 +95,13 @@ config = [ ...@@ -94,19 +95,13 @@ config = [
], ],
// CMake flags by OS and build type to override defaults for individual builds. // CMake flags by OS and build type to override defaults for individual builds.
buildFlags: [ buildFlags: [
Windows: [ nop: [],
debug: defaultDebugBuildFlags + [
'CAF_BUILD_STATIC_ONLY:BOOL=yes',
],
release: defaultReleaseBuildFlags + [
'CAF_BUILD_STATIC_ONLY:BOOL=yes',
],
],
], ],
// Configures what binary the coverage report uses and what paths to exclude. // Configures what binary the coverage report uses and what paths to exclude.
coverage: [ coverage: [
binary: 'build/incubator-test', binary: 'build/libcaf_net/caf-net-test',
relativeExcludePaths: [ relativeExcludePaths: [
'libcaf_net/test'
], ],
], ],
] ]
......
...@@ -43,10 +43,11 @@ Usage: $0 [OPTION]... [VAR=VALUE]... ...@@ -43,10 +43,11 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--prefix=PREFIX installation directory [/usr/local] --prefix=PREFIX installation directory [/usr/local]
Debugging: Debugging:
--enable-asan build with address sanitizer --with-sanitizers=LIST build with this list of sanitizers enabled
Convenience options: Convenience options:
--dev-mode sets --build-type=debug and --enable-asan --dev-mode sets --build-type=debug and
--sanitizers=address,undefined
Influential Environment Variables (only on first invocation): Influential Environment Variables (only on first invocation):
CXX C++ compiler command CXX C++ compiler command
...@@ -116,8 +117,8 @@ while [ $# -ne 0 ]; do ...@@ -116,8 +117,8 @@ while [ $# -ne 0 ]; do
--prefix=*) --prefix=*)
append_cache_entry CMAKE_INSTALL_PREFIX PATH "$optarg" append_cache_entry CMAKE_INSTALL_PREFIX PATH "$optarg"
;; ;;
--enable-asan) --with-sanitizers=*)
append_cache_entry CAF_ENABLE_ADDRESS_SANITIZER BOOL yes append_cache_entry CAF_SANITIZERS STRING "$optarg"
;; ;;
--more-warnings) --more-warnings)
append_cache_entry CAF_MORE_WARNINGS BOOL yes append_cache_entry CAF_MORE_WARNINGS BOOL yes
...@@ -176,7 +177,7 @@ while [ $# -ne 0 ]; do ...@@ -176,7 +177,7 @@ while [ $# -ne 0 ]; do
;; ;;
--dev-mode) --dev-mode)
append_cache_entry CMAKE_BUILD_TYPE STRING Debug append_cache_entry CMAKE_BUILD_TYPE STRING Debug
append_cache_entry CAF_ENABLE_ADDRESS_SANITIZER BOOL yes append_cache_entry CAF_SANITIZERS STRING address,undefined
;; ;;
*) *)
echo "Invalid option '$1'. Try $0 --help to see available options." echo "Invalid option '$1'. Try $0 --help to see available options."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment