mirror of
https://github.com/apache/nuttx.git
synced 2025-12-06 09:01:15 +08:00
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 <fangxinyong@xiaomi.com>
This commit is contained in:
@@ -93,11 +93,9 @@ if(CONFIG_LIBM_NEWLIB)
|
|||||||
file(GLOB_RECURSE COMMON_CSRCS ${NEWLIB_DIR}/newlib/libm/common/*.c)
|
file(GLOB_RECURSE COMMON_CSRCS ${NEWLIB_DIR}/newlib/libm/common/*.c)
|
||||||
file(GLOB_RECURSE COMPLEX_CSRCS ${NEWLIB_DIR}/newlib/libm/complex/*.c)
|
file(GLOB_RECURSE COMPLEX_CSRCS ${NEWLIB_DIR}/newlib/libm/complex/*.c)
|
||||||
|
|
||||||
if(CONFIG_ARCH_X86_64)
|
file(GLOB_RECURSE FENV_CSRCS ${NEWLIB_DIR}/newlib/libm/fenv/*.c)
|
||||||
file(GLOB_RECURSE ARCH_CSRCS ${NEWLIB_DIR}/newlib/libm/fenv/*.c)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(CSRCS ${COMMON_CSRCS} ${COMPLEX_CSRCS})
|
set(CSRCS ${COMMON_CSRCS} ${COMPLEX_CSRCS} ${FENV_CSRCS})
|
||||||
|
|
||||||
# aggressive optimisation can replace occurrences of sinl() and cosl() with
|
# aggressive optimisation can replace occurrences of sinl() and cosl() with
|
||||||
# sincosl(), but sincosl() is missing in newlib which causes error. So let's
|
# 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)
|
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)
|
list(APPEND INCDIR ${NEWLIB_DIR}/newlib/libc/machine/shared_x86/sys)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -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/common
|
||||||
DEPPATH += --dep-path newlib/newlib/newlib/libm/complex
|
DEPPATH += --dep-path newlib/newlib/newlib/libm/complex
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_X86_64),y)
|
|
||||||
CSRCS += $(wildcard newlib/newlib/newlib/libm/fenv/*.c)
|
CSRCS += $(wildcard newlib/newlib/newlib/libm/fenv/*.c)
|
||||||
VPATH += :newlib/newlib/newlib/libm/fenv
|
VPATH += :newlib/newlib/newlib/libm/fenv
|
||||||
DEPPATH += --dep-path 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
|
CFLAGS += ${INCDIR_PREFIX}newlib/newlib/newlib/libc/machine/shared_x86/sys
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user