Commit b9c3d091 authored by Jakob Otto's avatar Jakob Otto

Enable ubsan

parent 1ea49b14
......@@ -287,10 +287,10 @@ if(CAF_MORE_WARNINGS)
endif()
# Enable ASAN if requested by the user.
if(CAF_ENABLE_ADDRESS_SANITIZER AND NOT WIN32)
add_compile_options("-fsanitize=address"
if(CAF_SANITIZERS)
add_compile_options("-fsanitize=${CAF_SANITIZERS}"
"-fno-omit-frame-pointer")
list(APPEND CAF_EXTRA_LDFLAGS "-fsanitize=address")
list(APPEND CAF_EXTRA_LDFLAGS "-fsanitize=${CAF_SANITIZERS}")
endif()
# -pthread is ignored on MacOSX but required on other platforms
......
......@@ -9,7 +9,7 @@ defaultReleaseBuildFlags = [
// Default CMake flags for debug builds.
defaultDebugBuildFlags = defaultReleaseBuildFlags + [
'CAF_ENABLE_ADDRESS_SANITIZER:BOOL=yes',
'CAF_SANITIZERS:STRING=address,undefined',
'CAF_LOG_LEVEL:STRING=TRACE',
]
......@@ -61,6 +61,7 @@ config = [
builds: ['debug'],
tools: ['gcc-8'],
extraSteps: ['coverageReport'],
extraFlags: ['BUILD_SHARED_LIBS:BOOL=OFF'],
]],
['fedora-28', [
builds: ['release'],
......@@ -94,19 +95,13 @@ config = [
],
// CMake flags by OS and build type to override defaults for individual builds.
buildFlags: [
Windows: [
debug: defaultDebugBuildFlags + [
'CAF_BUILD_STATIC_ONLY:BOOL=yes',
],
release: defaultReleaseBuildFlags + [
'CAF_BUILD_STATIC_ONLY:BOOL=yes',
],
],
nop: [],
],
// Configures what binary the coverage report uses and what paths to exclude.
coverage: [
binary: 'build/incubator-test',
binary: 'build/libcaf_net/caf-net-test',
relativeExcludePaths: [
'libcaf_net/test'
],
],
]
......
......@@ -43,10 +43,11 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--prefix=PREFIX installation directory [/usr/local]
Debugging:
--enable-asan build with address sanitizer
--with-sanitizers=LIST build with this list of sanitizers enabled
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):
CXX C++ compiler command
......@@ -116,8 +117,8 @@ while [ $# -ne 0 ]; do
--prefix=*)
append_cache_entry CMAKE_INSTALL_PREFIX PATH "$optarg"
;;
--enable-asan)
append_cache_entry CAF_ENABLE_ADDRESS_SANITIZER BOOL yes
--with-sanitizers=*)
append_cache_entry CAF_SANITIZERS STRING "$optarg"
;;
--more-warnings)
append_cache_entry CAF_MORE_WARNINGS BOOL yes
......@@ -176,7 +177,7 @@ while [ $# -ne 0 ]; do
;;
--dev-mode)
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."
......
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