Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions libc/cmake/modules/LLVMLibCTestRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion libc/config/baremetal/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"math": {
"LIBC_CONF_MATH_OPTIMIZATIONS": {
"value": "(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)"
"value": "(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES | LIBC_MATH_NO_ERRNO)"
}
},
"general": {
Expand Down
Loading