Description / Steps to reproduce the issue
Description / Steps to reproduce the issue
While testing the Zig hello_zig example on sim:x86_64, I found that it cannot be built with Zig 0.13.0 due to two build issues.
Steps to reproduce
- Configure NuttX for
sim:x86_64.
- Enable the Zig hello example:
CONFIG_EXAMPLES_HELLO_ZIG=y
- Build NuttX.
The build first fails because tools/Zig.defs generates the following target:
-target x86_64-freestanding-sysv
However, Zig reports:
error: unknown ABI: 'sysv'
After locally changing the target to a Zig-supported ABI, the build proceeds further but then fails during linking with:
undefined reference to `__zig_probe_stack'
The generated Zig object references __zig_probe_stack, but the required compiler runtime is not linked.
After applying local changes, the project builds successfully and the example runs correctly:
NuttShell (NSH)
nsh> hello_zig
[sim]: Hello, Zig!
At this point I'm unsure what the preferred upstream approach is for addressing these two build issues, so I'm opening this issue first before preparing a patch.
On which OS does this issue occur?
[OS: Linux]
What is the version of your OS?
Ubuntu 24.04 LTS (WSL2)
NuttX Version
master
Issue Architecture
[Arch: x86], [Arch: x86_64]
Issue Area
[Area: Build System]
Host information
Host information
- Zig 0.13.0
- GCC host toolchain
- x86_64 Linux (WSL2)
Verification
Description / Steps to reproduce the issue
Description / Steps to reproduce the issue
While testing the Zig
hello_zigexample onsim:x86_64, I found that it cannot be built with Zig 0.13.0 due to two build issues.Steps to reproduce
sim:x86_64.The build first fails because
tools/Zig.defsgenerates the following target:However, Zig reports:
After locally changing the target to a Zig-supported ABI, the build proceeds further but then fails during linking with:
The generated Zig object references
__zig_probe_stack, but the required compiler runtime is not linked.After applying local changes, the project builds successfully and the example runs correctly:
At this point I'm unsure what the preferred upstream approach is for addressing these two build issues, so I'm opening this issue first before preparing a patch.
On which OS does this issue occur?
[OS: Linux]
What is the version of your OS?
Ubuntu 24.04 LTS (WSL2)
NuttX Version
master
Issue Architecture
[Arch: x86], [Arch: x86_64]
Issue Area
[Area: Build System]
Host information
Host information
Verification