[libc] Fix fixed point detection and add compile option. (#81788)

This commit is contained in:
lntue 2024-02-14 17:12:51 -05:00 committed by GitHub
parent ad49657a42
commit 271e07321b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View File

@ -49,6 +49,10 @@ function(_get_common_compile_options output_var flags)
list(APPEND compile_options "-ffreestanding")
endif()
if(LIBC_COMPILER_HAS_FIXED_POINT)
list(APPEND compile_options "-ffixed-point")
endif()
list(APPEND compile_options "-fno-builtin")
list(APPEND compile_options "-fno-exceptions")
list(APPEND compile_options "-fno-lax-vector-conversions")

View File

@ -1,4 +1,4 @@
#include "include/llvm-libc-macross/stdfix_macros.h"
#include "include/llvm-libc-macros/stdfix-macros.h"
#ifndef LIBC_COMPILER_HAS_FIXED_POINT
#error unsupported

View File

@ -31,6 +31,9 @@ function(add_unittest_framework_library name)
if(TARGET libc.src.time.clock)
target_compile_definitions(${lib} PRIVATE TARGET_SUPPORTS_CLOCK)
endif()
if(LIBC_COMPILER_HAS_FIXED_POINT)
target_compile_options(${lib} PUBLIC -ffixed-point)
endif()
endforeach()
target_include_directories(${name}.hermetic PRIVATE ${LIBC_BUILD_DIR}/include)
target_compile_options(${name}.hermetic