Skip to content

include/nuttx/compiler.h: use the user label prefix in asm labels. - #21498

Merged
michallenc merged 1 commit into
apache:masterfrom
linumiz:rh850/compiler-h-v2
Nov 8, 2026
Merged

michallenc merged 1 commit into
apache:masterfrom
linumiz:rh850/compiler-h-v2

Conversation

@parthitce

@parthitce parthitce commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

v850 GCC adds "_" in front of C symbols (USER_LABEL_PREFIX), so the asm labels used by fortify_real and builtin_original did not match and string.h failed to link. Add the prefix to those labels. If the compiler does not define USER_LABEL_PREFIX, nothing changes.

Impact

None for targets without a prefix. Needed by the RH850 port (#21456).

Testing

Built the configs that failed CI before, plus sim:nsh and stm32f4discovery:nsh, in the CI image. RH850 qemu-rh850-u2c ostest passes on QEMU.

@parthitce

Copy link
Copy Markdown
Contributor Author

Adding @xiaoxiang781216 @raiden00pl @casaroli for review. Thanks.

xiaoxiang781216
xiaoxiang781216 previously approved these changes Nov 6, 2026
jerpelea
jerpelea previously approved these changes Nov 6, 2026
@github-actions github-actions Bot added Area: OS Components OS Components issues Size: S The size of the change in this PR is small Board: arm Board: renesas labels Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

qemu-armv8a

  • Code: .text.fpu_task +8 B (+0.0%, 360,940 B)

qemu-intel64

  • Code: .text +4 B (+0.0%, 8,694,084 B)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

@parthitce
parthitce dismissed stale reviews from jerpelea and xiaoxiang781216 via 9386470 November 6, 2026 17:23
@parthitce
parthitce force-pushed the rh850/compiler-h-v2 branch from 57f7c25 to 9386470 Compare November 6, 2026 17:23
@parthitce

Copy link
Copy Markdown
Contributor Author

The CI failure came from macro.h in compiler.h clashing with STRINGIFY in OpenSBI, the NMSIS headers and CPython. It now uses a local stringify. the board commit is dropped. The failing configs build now.

Please re-trigger the CI.

@casaroli casaroli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The PR body describes the old version. It says "compiler.h now builds those names with USER_LABEL_PREFIX and STRINGIFY from nuttx/macro.h", "The first commit drops the local STRINGIFY of six BBSRAM/SBRAM board files", "Programs built with NUTTX_NO_EXTENSIONS now also see the macro.h names." and tests "nucleo-f429zi with BBSRAM ... without the first commit". The PR now has one commit, a local stringify, no macro.h and no board files.
Fix: update the Summary, Impact and Testing sections to the current commit.

Comment thread include/nuttx/compiler.h Resolved
Comment thread include/nuttx/compiler.h Resolved
v850 GCC prefixes C symbols with "_".  The asm names in the builtin and
fortify wrappers now take the prefix into account, through a local
two-step stringify, so compiler.h does not define STRINGIFY for every
file that includes it.  Targets without a prefix get the same names as
before.

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
@parthitce
parthitce force-pushed the rh850/compiler-h-v2 branch from 9386470 to f183ecb Compare November 7, 2026 14:38
@parthitce

Copy link
Copy Markdown
Contributor Author

The PR body describes the old version. It says "compiler.h now builds those names with USER_LABEL_PREFIX and STRINGIFY from nuttx/macro.h", "The first commit drops the local STRINGIFY of six BBSRAM/SBRAM board files", "Programs built with NUTTX_NO_EXTENSIONS now also see the macro.h names." and tests "nucleo-f429zi with BBSRAM ... without the first commit". The PR now has one commit, a local stringify, no macro.h and no board files. Fix: update the Summary, Impact and Testing sections to the current commit.

Thanks for the review. Updated.

@michallenc
michallenc merged commit 47e9f90 into apache:master Nov 8, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: OS Components OS Components issues 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.

5 participants