From 8f9b5ff8d68c29ecff0076ee1f061713636227c5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 8 Jan 2025 09:17:58 -0500 Subject: [PATCH] liblzma: Disable inline assembly when compiled with conflicting flag --- Utilities/cmliblzma/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt index 3ba3ce952e..6ac02f0e0e 100644 --- a/Utilities/cmliblzma/CMakeLists.txt +++ b/Utilities/cmliblzma/CMakeLists.txt @@ -176,6 +176,11 @@ endif() ADD_LIBRARY(cmliblzma STATIC ${LZMA_SRCS}) +# Disable inline assembly in a case where it does not compile. +if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_FLAGS MATCHES "-ftrapv") + set_property(SOURCE liblzma/lzma/lzma_decoder.c PROPERTY COMPILE_DEFINITIONS LZMA_RANGE_DECODER_CONFIG=0) +endif() + IF(CMAKE_C_COMPILER_ID STREQUAL "XL") # Disable the XL compiler optimizer because it causes crashes # and other bad behavior in liblzma code.