Skip to content

{bp-19477} tools/Zig.defs: Fix Zig builds on sim:x86_64 - #19631

Merged
xiaoxiang781216 merged 1 commit into
apache:releases/13.0from
jerpelea:bp-19477
Aug 3, 2026
Merged

{bp-19477} tools/Zig.defs: Fix Zig builds on sim:x86_64#19631
xiaoxiang781216 merged 1 commit into
apache:releases/13.0from
jerpelea:bp-19477

Conversation

@jerpelea

@jerpelea jerpelea commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Building Zig applications on sim:x86_64 with Zig 0.13.0 fails because the generated target "x86_64-freestanding-sysv" is not recognized by Zig. Introduce a Zig-specific ABI mapping that translates "sysv" to "gnu" without affecting other toolchains.

After correcting the target ABI, linking still fails due to unresolved references to __zig_probe_stack. Add -fcompiler-rt so Zig includes the required compiler runtime during linking.

Verified on sim:nsh with CONFIG_EXAMPLES_HELLO_ZIG=y:

nsh> hello_zig
[sim]: Hello, Zig!

Fixes #19475

Impact

RELEASE

Testing

CI

Building Zig applications on sim:x86_64 with Zig 0.13.0 fails because
the generated target "x86_64-freestanding-sysv" is not recognized by
Zig. Introduce a Zig-specific ABI mapping that translates "sysv" to
"gnu" without affecting other toolchains.

After correcting the target ABI, linking still fails due to unresolved
references to __zig_probe_stack. Add -fcompiler-rt so Zig includes the
required compiler runtime during linking.

Verified on sim:nsh with CONFIG_EXAMPLES_HELLO_ZIG=y:

  nsh> hello_zig
  [sim]: Hello, Zig!

Fixes apache#19475

Signed-off-by: Ansh Rai <anshrai331@gmail.com>
@github-actions github-actions Bot added Area: Tooling Size: XS The size of the change in this PR is very small labels Aug 3, 2026
@cederom

cederom commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

-> releases/13.0 not 13.0.1 or 13.1.0 ? :-)

@jerpelea

jerpelea commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

-> releases/13.0 not 13.0.1 or 13.1.0 ? :-)

@cederom

13.0.1 fix release (ASAP)
13.1.0 minor release (end of September)

@xiaoxiang781216
xiaoxiang781216 merged commit abafe75 into apache:releases/13.0 Aug 3, 2026
16 of 41 checks passed
@jerpelea
jerpelea deleted the bp-19477 branch August 3, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Tooling Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants