mirror of
https://github.com/RPCSX/SPIRV-Tools.git
synced 2024-11-23 11:29:44 +00:00
Add -fsantize to link flags. (#2506)
The option "SPIRV_USE_SANITIZER=address" does not work as stated in our documentation because the link step fails for the tools. We have to add -fsanitize to the link flags so the correct libraries are added on the link step. Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/2482.
This commit is contained in:
parent
82ebbbba15
commit
2b46521cd7
@ -140,6 +140,8 @@ function(spvtools_default_compile_options TARGET)
|
||||
if(NOT "${SPIRV_USE_SANITIZER}" STREQUAL "")
|
||||
target_compile_options(${TARGET} PRIVATE
|
||||
-fsanitize=${SPIRV_USE_SANITIZER})
|
||||
set_target_properties(${TARGET} PROPERTIES
|
||||
LINK_FLAGS -fsanitize=${SPIRV_USE_SANITIZER})
|
||||
endif()
|
||||
target_compile_options(${TARGET} PRIVATE
|
||||
-ftemplate-depth=1024)
|
||||
|
@ -46,7 +46,7 @@ fi
|
||||
ADDITIONAL_CMAKE_FLAGS=""
|
||||
if [ $CONFIG = "ASAN" ]
|
||||
then
|
||||
ADDITIONAL_CMAKE_FLAGS="-DCMAKE_CXX_FLAGS=-fsanitize=address -DCMAKE_C_FLAGS=-fsanitize=address"
|
||||
ADDITIONAL_CMAKE_FLAGS="SPIRV_USE_SANITIZER=address"
|
||||
[ $COMPILER = "clang" ] || { echo "$CONFIG requires clang"; exit 1; }
|
||||
elif [ $CONFIG = "COVERAGE" ]
|
||||
then
|
||||
|
Loading…
Reference in New Issue
Block a user