diff --git a/libc/cmake/modules/LLVMLibCObjectRules.cmake b/libc/cmake/modules/LLVMLibCObjectRules.cmake --- a/libc/cmake/modules/LLVMLibCObjectRules.cmake +++ b/libc/cmake/modules/LLVMLibCObjectRules.cmake @@ -5,6 +5,18 @@ if(NOT ${LIBC_TARGET_OS} STREQUAL "windows") set(compile_options ${compile_options} -fpie -ffreestanding) endif() + if(LLVM_COMPILER_IS_GCC_COMPATIBLE) + list(APPEND compile_options "-fno-exceptions") + list(APPEND compile_options "-fno-unwind-tables") + list(APPEND compile_options "-fno-asynchronous-unwind-tables") + list(APPEND compile_options "-fno-rtti") + elseif(MSVC) + list(APPEND compile_options "/EHs-c-") + list(APPEND compile_options "/GR-") + elseif(CMAKE_CXX_COMPILER_ID MATCHES "XL") + list(APPEND compile_options "-qnoeh") + list(APPEND compile_options "-qnortti") + endif() set(${output_var} ${compile_options} PARENT_SCOPE) endfunction()