Skip to content

Guard include/cxx with CONFIG_LIBMINIABI for C++ builds#18465

Open
arjav1528 wants to merge 2 commits intoapache:masterfrom
arjav1528:dev-issue-18088
Open

Guard include/cxx with CONFIG_LIBMINIABI for C++ builds#18465
arjav1528 wants to merge 2 commits intoapache:masterfrom
arjav1528:dev-issue-18088

Conversation

@arjav1528
Copy link
Contributor

@arjav1528 arjav1528 commented Feb 27, 2026

Fixes #18088

Summary

include/cxx was unconditionally added for all C++ builds when neither LIBCXX nor UCLIBCXX was selected. This incorrectly included CONFIG_LIBCXXTOOLCHAIN builds. include/cxx provides NuttX C++ ABI headers (like libcxxabi), not a full stdlib—using it with an external toolchain causes header conflicts (e.g. div_t/ldiv_t/lldiv_t via cstdlib/stdlib.h).
ETL logic unchanged.

Impact

  • CONFIG_LIBCXXTOOLCHAIN + LIBSUPCXX_TOOLCHAIN: No longer adds include/cxx (fixes conflict)
  • CONFIG_LIBMINIABI: Still adds include/cxx as before
  • CONFIG_LIBCXX / CONFIG_UCLIBCXX: No change

Testing

Host: macOS (Darwin), arm64
Boards: xmc4800-relax:nsh, sim:cxxtest

Config Result
xmc4800-relax:nsh (LIBCXXTOOLCHAIN) Configure OK; build fails on ARM toolchain C++ headers (algorithm, math.h)—pre-existing, unrelated to this fix
sim:cxxtest (UCLIBCXX) Configure OK; build fails on macOS sim host layer (timer_t, kill)—pre-existing platform issue, unrelated

Logic verified: CONFIG_UCLIBCXX uses include/uClibc++; this fix only affects the else branch (LIBCXXNONE/LIBCXXTOOLCHAIN). Full verification recommended in CI (Linux/Docker) with proper toolchain.

Logs

18088.txt
xmc4800_nsh_docker_build.txt

@github-actions github-actions bot added Area: Tooling Area: Build system Arch: arm Issues related to ARM (32-bit) architecture Arch: arm64 Issues related to ARM64 (64-bit) architecture Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Arch: tricore Issues related to the TriCore architecture from Infineon Arch: x86_64 Issues related to the x86_64 architecture Size: S The size of the change in this PR is small labels Feb 27, 2026
This update introduces a conditional check for CONFIG_LIBMINIABI in the ARCHXXINCLUDES section, ensuring that the appropriate include path is added when the mini ABI configuration is enabled.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
…tectures

This update introduces a conditional check for CONFIG_LIBMINIABI in the platform.cmake files for ARM, ARM64, RISC-V, Tricore, and x86_64 architectures, ensuring that the appropriate include path is added when the mini ABI configuration is enabled.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
@arjav1528
Copy link
Contributor Author

@xiaoxiang781216 could you restart the workflow, the failing workflow seems to be a timeout issue

@trns1997
Copy link
Contributor

trns1997 commented Feb 27, 2026

@arjav1528 C++ builds that use lib from toolchain will technically fail. Further investigation is required to provide a complete solution. See: #18088 (comment)

Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

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

Please attach the full test logs.

@arjav1528
Copy link
Contributor Author

Please attach the full test logs.

done, also could you please restart the workflows

@arjav1528 arjav1528 requested a review from linguini1 February 28, 2026 10:27
@trns1997
Copy link
Contributor

@arjav1528 C++ builds that use lib from toolchain will technically fail. Further investigation is required to provide a complete solution. See: #18088 (comment)

@arjav1528 I recommend you test xmc4800 nsh build in a docker container. You should face the issue I mentioned in the issue

@arjav1528
Copy link
Contributor Author

@arjav1528 C++ builds that use lib from toolchain will technically fail. Further investigation is required to provide a complete solution. See: #18088 (comment)

@arjav1528 I recommend you test xmc4800 nsh build in a docker container. You should face the issue I mentioned in the issue

@trns1997 I tested the xmc4800nsh build inside the CI docker container, as per your sugggestion. the build fails, which confirms the issue which you identified.
but the root cause is the bundled ARM toolchain in the image. main is the cstdlib and bits/stdabs.h which bypasses the nuttx's isystem and pulls in the toolchain's newlib stdlib.h direclty.
the failure is not caused by cxx being in the include path, so my PR is not related to this issue, it will happen regardless of the PR's changes, since the conflict is b/w nuttx's stdlib and toolchain's stdlib
btw I've attached the build logs in the PR description

@arjav1528 arjav1528 requested a review from trns1997 March 5, 2026 14:53
@arjav1528
Copy link
Contributor Author

so most probably its a timeout issue, can be fixed by restarting the workfllow
@linguini1 @xiaoxiang781216

@trns1997
Copy link
Contributor

trns1997 commented Mar 5, 2026

@arjav1528 C++ builds that use lib from toolchain will technically fail. Further investigation is required to provide a complete solution. See: #18088 (comment)

@arjav1528 I recommend you test xmc4800 nsh build in a docker container. You should face the issue I mentioned in the issue

@trns1997 I tested the xmc4800nsh build inside the CI docker container, as per your sugggestion. the build fails, which confirms the issue which you identified. but the root cause is the bundled ARM toolchain in the image. main is the cstdlib and bits/stdabs.h which bypasses the nuttx's isystem and pulls in the toolchain's newlib stdlib.h direclty. the failure is not caused by cxx being in the include path, so my PR is not related to this issue, it will happen regardless of the PR's changes, since the conflict is b/w nuttx's stdlib and toolchain's stdlib btw I've attached the build logs in the PR description

hmmm not sure the CI will pass, because the CI uses the same image :/ . So you do not have a choice but address this underlying issue. If i get time tomorrow i will look into it.

@arjav1528
Copy link
Contributor Author

arjav1528 commented Mar 6, 2026

@arjav1528 C++ builds that use lib from toolchain will technically fail. Further investigation is required to provide a complete solution. See: #18088 (comment)

@arjav1528 I recommend you test xmc4800 nsh build in a docker container. You should face the issue I mentioned in the issue

@trns1997 I tested the xmc4800nsh build inside the CI docker container, as per your sugggestion. the build fails, which confirms the issue which you identified. but the root cause is the bundled ARM toolchain in the image. main is the cstdlib and bits/stdabs.h which bypasses the nuttx's isystem and pulls in the toolchain's newlib stdlib.h direclty. the failure is not caused by cxx being in the include path, so my PR is not related to this issue, it will happen regardless of the PR's changes, since the conflict is b/w nuttx's stdlib and toolchain's stdlib btw I've attached the build logs in the PR description

hmmm not sure the CI will pass, because the CI uses the same image :/ . So you do not have a choice but address this underlying issue. If i get time tomorrow i will look into it.

@trns1997 @linguini1 @simbit18 @xiaoxiang781216 do you guys have any idea why is arm2 queued since 1 day 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Arch: arm64 Issues related to ARM64 (64-bit) architecture Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Arch: tricore Issues related to the TriCore architecture from Infineon Arch: x86_64 Issues related to the x86_64 architecture Area: Build system Area: Tooling Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] include/cxx is unconditionally added for C++ builds and should be guarded by LIBCXXMINI / LIBMINIABI

4 participants