diff options
Diffstat (limited to 'libc/cmake/modules/LLVMLibCCompileOptionRules.cmake')
-rw-r--r-- | libc/cmake/modules/LLVMLibCCompileOptionRules.cmake | 10 |
1 files changed, 3 insertions, 7 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) |