Meta: Disable -fsanitize=function on macOS with clang 17 or higher

This seems to trip on calling file static functions through a function
pointer directly. Still need to reduce and report upstream.
This commit is contained in:
Andrew Kaster 2023-12-19 15:41:57 -07:00 committed by Andrew Kaster
parent c0f50b12a4
commit 08108ac579
Notes: sideshowbarker 2024-07-16 22:22:13 +09:00
2 changed files with 6 additions and 0 deletions

View File

@ -42,6 +42,9 @@ if (ENABLE_UNDEFINED_SANITIZER)
if (UNDEFINED_BEHAVIOR_IS_FATAL)
add_compile_options(-fno-sanitize-recover=undefined)
endif()
if (APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang$" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "17")
add_compile_options(-fno-sanitize=function)
endif()
add_link_options(-fsanitize=undefined)
endif()

View File

@ -105,6 +105,9 @@ if (ENABLE_UNDEFINED_SANITIZER)
if (UNDEFINED_BEHAVIOR_IS_FATAL)
add_compile_options(-fno-sanitize-recover=undefined)
endif()
if (APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang$" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "17")
add_compile_options(-fno-sanitize=function)
endif()
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=undefined")
endif()