fxysunshine opened a new pull request, #17407: URL: https://github.com/apache/nuttx/pull/17407
## Summary This PR continues the work from https://github.com/apache/nuttx/pull/15022. While the build system defines a source file inclusion order to prevent common source code from being included alongside architecture-specific implementations, some build environments cannot guarantee this ordering. This can result in multiple definition errors during the linking stage. The Makefile build with newlib works correctly because it uses VPATH, which gives priority to the first matching path. However, CMake does not utilize per-subdirectory search paths in the same way and requires filename-based filtering to prevent duplicate file inclusions. This commit series refines the build configuration for the newlib libm component to improve cross-architecture compatibility and resolve potential duplicate file issues. ## Change ### 1. Implements filename-based filtering for libm source lists Adds filtering logic to exclude duplicate files from source lists. Ensures architecture-specific files (ARCH_CSRCS) take precedence over files from common or other directories, guaranteeing the correct implementation is selected. ### 2. Expands inclusion of fenv sources and x86 headers Includes newlib/libm/fenv/*.c (non-functional fallback implementations) for all architectures. These are designed to be overridden by architecture-specific implementations in newlib/libm/machine/ARCH. Extends the architecture check logic to include shared x86 system headers for both x86 and x86_64 architectures. ## Impact Prevents common source code from being included alongside architecture-specific implementations in the final library. Eliminates multiple definition errors during the linking stage. ## Testing Internal CI testing on ARM Cortex-M55 with the BES platform using newlib. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
