aboutsummaryrefslogtreecommitdiff
path: root/libc/cmake/modules
diff options
context:
space:
mode:
Diffstat (limited to 'libc/cmake/modules')
-rw-r--r--libc/cmake/modules/LLVMLibCCompileOptionRules.cmake10
-rw-r--r--libc/cmake/modules/LLVMLibCTestRules.cmake5
2 files changed, 3 insertions, 12 deletions
diff --git a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
index 2eb0f06..4c36ed8 100644
--- a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
+++ b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
@@ -26,13 +26,6 @@ function(_get_compile_options_from_flags output_var)
list(APPEND compile_options "-mavx2")
list(APPEND compile_options "-mfma")
endif()
- # For clang, we will build the math functions with `-fno-math-errno` so that
- # __builtin_fma* will generate the fused-mutliply-add instructions. We
- # don't put the control flag to the public config yet, and see if it makes
- # sense to just enable this flag by default.
- if(LIBC_ADD_FNO_MATH_ERRNO)
- list(APPEND compile_options "-fno-math-errno")
- endif()
endif()
if(ADD_ROUND_OPT_FLAG)
if(LIBC_TARGET_ARCHITECTURE_IS_X86_64)
@@ -102,6 +95,9 @@ function(_get_compile_options_from_config output_var)
if(LIBC_CONF_MATH_OPTIMIZATIONS)
list(APPEND config_options "-DLIBC_MATH=${LIBC_CONF_MATH_OPTIMIZATIONS}")
+ if(LIBC_CONF_MATH_OPTIMIZATIONS MATCHES "LIBC_MATH_NO_ERRNO")
+ list(APPEND config_options "-fno-math-errno")
+ endif()
endif()
if(LIBC_CONF_ERRNO_MODE)
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 19da0ad..933b81b 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -3,11 +3,6 @@ function(_get_common_test_compile_options output_var c_test flags)
_get_compile_options_from_config(config_flags)
_get_compile_options_from_arch(arch_flags)
- # Remove -fno-math-errno if it was added.
- if(LIBC_ADD_FNO_MATH_ERRNO)
- list(REMOVE_ITEM compile_flags "-fno-math-errno")
- endif()
-
# Death test executor is only available in Linux for now.
if(NOT ${LIBC_TARGET_OS} STREQUAL "linux")
list(REMOVE_ITEM config_flags "-DLIBC_ADD_NULL_CHECKS")