This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 31b5ef357cc878aeb55dbd29262ae9ba7ce2f204 Author: fangxinyong <[email protected]> AuthorDate: Fri Oct 31 16:23:01 2025 +0800 libm/newlib: Include fenv sources for all ARCHs and extend x86 includes newlib/libm/fenv/*.c are the non-functional implementation that should be overridden by an architecture specific implementation in newlib/libm/machine/ARCH. Make the architecture check for including shared x86 sys headers for x86 and x86_64. Signed-off-by: fangxinyong <[email protected]> --- libs/libm/newlib/CMakeLists.txt | 8 +++----- libs/libm/newlib/Make.defs | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/libs/libm/newlib/CMakeLists.txt b/libs/libm/newlib/CMakeLists.txt index c05c578c6fa..eef4566355b 100644 --- a/libs/libm/newlib/CMakeLists.txt +++ b/libs/libm/newlib/CMakeLists.txt @@ -93,11 +93,9 @@ if(CONFIG_LIBM_NEWLIB) file(GLOB_RECURSE COMMON_CSRCS ${NEWLIB_DIR}/newlib/libm/common/*.c) file(GLOB_RECURSE COMPLEX_CSRCS ${NEWLIB_DIR}/newlib/libm/complex/*.c) - if(CONFIG_ARCH_X86_64) - file(GLOB_RECURSE ARCH_CSRCS ${NEWLIB_DIR}/newlib/libm/fenv/*.c) - endif() + file(GLOB_RECURSE FENV_CSRCS ${NEWLIB_DIR}/newlib/libm/fenv/*.c) - set(CSRCS ${COMMON_CSRCS} ${COMPLEX_CSRCS}) + set(CSRCS ${COMMON_CSRCS} ${COMPLEX_CSRCS} ${FENV_CSRCS}) # aggressive optimisation can replace occurrences of sinl() and cosl() with # sincosl(), but sincosl() is missing in newlib which causes error. So let's @@ -146,7 +144,7 @@ if(CONFIG_LIBM_NEWLIB) set(INCDIR ${CMAKE_CURRENT_LIST_DIR}/include ${NEWLIB_DIR}/newlib/libm/common) - if(CONFIG_ARCH_X86_64) + if(CONFIG_ARCH_X86_64 OR CONFIG_ARCH_X86) list(APPEND INCDIR ${NEWLIB_DIR}/newlib/libc/machine/shared_x86/sys) endif() diff --git a/libs/libm/newlib/Make.defs b/libs/libm/newlib/Make.defs index 895ca5d8dc0..f2fc5afcde9 100644 --- a/libs/libm/newlib/Make.defs +++ b/libs/libm/newlib/Make.defs @@ -88,12 +88,11 @@ VPATH += :newlib/newlib/newlib/libm/complex DEPPATH += --dep-path newlib/newlib/newlib/libm/common DEPPATH += --dep-path newlib/newlib/newlib/libm/complex -ifeq ($(CONFIG_ARCH_X86_64),y) CSRCS += $(wildcard newlib/newlib/newlib/libm/fenv/*.c) VPATH += :newlib/newlib/newlib/libm/fenv DEPPATH += --dep-path newlib/newlib/newlib/libm/fenv - +ifneq ($(CONFIG_ARCH_X86_64)$(CONFIG_ARCH_X86),) CFLAGS += ${INCDIR_PREFIX}newlib/newlib/newlib/libc/machine/shared_x86/sys endif
