Skip to content

Commit 31b5ef3

Browse files
fxysunshinexiaoxiang781216
authored andcommitted
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]>
1 parent d956699 commit 31b5ef3

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

libs/libm/newlib/CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,9 @@ if(CONFIG_LIBM_NEWLIB)
9393
file(GLOB_RECURSE COMMON_CSRCS ${NEWLIB_DIR}/newlib/libm/common/*.c)
9494
file(GLOB_RECURSE COMPLEX_CSRCS ${NEWLIB_DIR}/newlib/libm/complex/*.c)
9595

96-
if(CONFIG_ARCH_X86_64)
97-
file(GLOB_RECURSE ARCH_CSRCS ${NEWLIB_DIR}/newlib/libm/fenv/*.c)
98-
endif()
96+
file(GLOB_RECURSE FENV_CSRCS ${NEWLIB_DIR}/newlib/libm/fenv/*.c)
9997

100-
set(CSRCS ${COMMON_CSRCS} ${COMPLEX_CSRCS})
98+
set(CSRCS ${COMMON_CSRCS} ${COMPLEX_CSRCS} ${FENV_CSRCS})
10199

102100
# aggressive optimisation can replace occurrences of sinl() and cosl() with
103101
# sincosl(), but sincosl() is missing in newlib which causes error. So let's
@@ -146,7 +144,7 @@ if(CONFIG_LIBM_NEWLIB)
146144

147145
set(INCDIR ${CMAKE_CURRENT_LIST_DIR}/include ${NEWLIB_DIR}/newlib/libm/common)
148146

149-
if(CONFIG_ARCH_X86_64)
147+
if(CONFIG_ARCH_X86_64 OR CONFIG_ARCH_X86)
150148
list(APPEND INCDIR ${NEWLIB_DIR}/newlib/libc/machine/shared_x86/sys)
151149
endif()
152150

libs/libm/newlib/Make.defs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,11 @@ VPATH += :newlib/newlib/newlib/libm/complex
8888
DEPPATH += --dep-path newlib/newlib/newlib/libm/common
8989
DEPPATH += --dep-path newlib/newlib/newlib/libm/complex
9090

91-
ifeq ($(CONFIG_ARCH_X86_64),y)
9291
CSRCS += $(wildcard newlib/newlib/newlib/libm/fenv/*.c)
9392
VPATH += :newlib/newlib/newlib/libm/fenv
9493
DEPPATH += --dep-path newlib/newlib/newlib/libm/fenv
9594

96-
95+
ifneq ($(CONFIG_ARCH_X86_64)$(CONFIG_ARCH_X86),)
9796
CFLAGS += ${INCDIR_PREFIX}newlib/newlib/newlib/libc/machine/shared_x86/sys
9897
endif
9998

0 commit comments

Comments
 (0)