diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-07-11 20:29:29 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-08-05 16:23:57 +0300 |
commit | 47bf754de4ec60def018284023b5baf9b90ca696 (patch) | |
tree | 3cc1d4980554eabf71992f00d51c2be2cef752c4 /CMakeLists.txt | |
parent | 916e51a4078b452774b2696d1daeb7286ab3f085 (diff) |
Build: disable address sanitizer for Cycles optimized kernels with GCC
It's extremely slow to compile and run, so just disable it unless
WITH_CYCLES_KERNEL_ASAN is manually enabled. For Clang it's always
enabled since that appears to work ok.
This also limits the -fno-sanitize=vptr flag to the Cycles kernel, as it
was added specifically to work around an issue there.
Differential Revision: https://developer.blender.org/D5404
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 88295979fa7..6ced6e1d76d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -413,6 +413,8 @@ unset(PLATFORM_DEFAULT) option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON) option(WITH_CYCLES_DEBUG "Build Cycles with extra debug capabilities" OFF) option(WITH_CYCLES_NATIVE_ONLY "Build Cycles with native kernel only (which fits current CPU, use for development only)" OFF) +option(WITH_CYCLES_KERNEL_ASAN "Build Cycles kernels with address sanitizer when WITH_COMPILER_ASAN is on, even if it's very slow" OFF) +mark_as_advanced(WITH_CYCLES_KERNEL_ASAN) mark_as_advanced(WITH_CYCLES_CUBIN_COMPILER) mark_as_advanced(WITH_CYCLES_LOGGING) mark_as_advanced(WITH_CYCLES_DEBUG) @@ -822,12 +824,6 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}") - if(WITH_CYCLES_OSL) - # With OSL, Cycles disables rtti in some modules, which then breaks at linking - # when trying to use vptr sanitizer (included into 'undefined' general option). - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-sanitize=vptr") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-sanitize=vptr") - endif() if(MSVC) set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6") endif() |