Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that correct libc headers are pulled by libstdc++ builds #797

Conversation

stephanosio
Copy link
Member

@stephanosio stephanosio commented Sep 23, 2024

This series pulls in the crosstool-ng and gcc patches that ensure correct libc headers are pulled by the libstdc++ builds for the companion libcs (newlib-nano and picolibc).

crosstool-ng PR: zephyrproject-rtos/crosstool-ng#29
gcc PR: zephyrproject-rtos/gcc#36

Fixes #760

@stephanosio stephanosio added ci-macos-aarch64 Run CI for AArch64 macOS host (for PR) area: libstdc++ Issues related to libstdc++ (GNU C++ Library) DNM DO NOT MERGE labels Sep 23, 2024
@stephanosio
Copy link
Member Author

stephanosio commented Sep 23, 2024

Initial test result: https://github.com/zephyrproject-rtos/sdk-ng/actions/runs/10992244350

This managed to fix the macos-aarch64 host build, at least.

However, there are still more problems with the Canadian cross toolchain builds (macos-x86_64 and windows-x86_64) as well as tests/lib/c_lib/thrd/libraries.libc.c11_threads.newlib in general.

@stephanosio
Copy link
Member Author

However, there are still more problems with the Canadian cross toolchain builds (macos-x86_64 and windows-x86_64) as well as tests/lib/c_lib/thrd/libraries.libc.c11_threads.newlib in general.

More detailed analysis on the symptom: #760 (comment)

@stephanosio stephanosio changed the title crosstool-ng: Pull in libstdc++ header path fix for additional libc Ensure that correct libc headers are pulled by libstdc++ builds Sep 24, 2024
This commit pulls in the crosstool-ng patch that fixes the wrong
libstdc++ C library header path, specified using `--with-headers`
argument, for additional libc variants such as newlib-nano and picolibc.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
GCC was adding the libc header directories to the target include search
path only when building non-Canadian cross compilers, which caused wrong
libc (newlib) headers to be picked up by the libstdc++ builds for
companion libcs such as newlib-nano and picolibc when building a
Canadian cross compiler.

This commit pulls in the GCC patch that ensures that the libc header
directories are always added to the include search path, even when
compiling a Canadian cross compiler.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This reverts commit ac8acc2 because
the non-Linux C++ build issue has been fixed.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
@stephanosio stephanosio force-pushed the ctng_fix_libstdcxx_libc_inc_path branch from 689801f to e05392d Compare September 24, 2024 13:59
@stephanosio
Copy link
Member Author

Two additional patches, one in crosstool-ng and another in gcc, have been added fixing the problems described in #760 (comment) and #760 (comment).

@stephanosio stephanosio marked this pull request as ready for review September 25, 2024 11:44
Copy link
Member Author

@stephanosio stephanosio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephanosio stephanosio added this to the 0.16.9 milestone Sep 25, 2024
@stephanosio stephanosio removed the DNM DO NOT MERGE label Sep 25, 2024
@stephanosio stephanosio merged commit 41449a8 into zephyrproject-rtos:main Sep 25, 2024
149 of 178 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: libstdc++ Issues related to libstdc++ (GNU C++ Library) ci-macos-aarch64 Run CI for AArch64 macOS host (for PR)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

undefined reference to `_impure_ptr' when building Zephyr C++ samples on non-Linux hosts
1 participant