From 08108ac5795c9b58f80dd7709af067631b6a2edf Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Tue, 19 Dec 2023 15:41:57 -0700 Subject: [PATCH] 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. --- Ladybird/CMakeLists.txt | 3 +++ Meta/Lagom/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Ladybird/CMakeLists.txt b/Ladybird/CMakeLists.txt index 71b2b660d6..bc1aaa5fbf 100644 --- a/Ladybird/CMakeLists.txt +++ b/Ladybird/CMakeLists.txt @@ -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() diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt index 93f43f4233..73b54c8045 100644 --- a/Meta/Lagom/CMakeLists.txt +++ b/Meta/Lagom/CMakeLists.txt @@ -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()