ML-dev-crypto opened a new pull request, #19477:
URL: https://github.com/apache/nuttx/pull/19477

   ## Summary
   
   Building a Zig-based application (`CONFIG_EXAMPLES_HELLO_ZIG`, 
`CONFIG_EXAMPLES_LEDS_ZIG`) on the sim board fails with Zig 0.13.0. The 
generated target triple uses `LLVM_ABITYPE := sysv`, producing 
`x86_64-freestanding-sysv`. Zig does not recognize `sysv` as a valid ABI, 
causing the build to fail before any Zig source is compiled.
   
   After correcting the target triple, the build fails again at link time 
because `__zig_probe_stack` is undefined.
   
   ## Impact
   
   Introduce `ZIG_ABITYPE`, a Zig-specific mapping from `sysv` to `gnu`, used 
only when constructing the Zig target triple. `LLVM_ABITYPE` remains unchanged, 
so the existing behavior for the other toolchains is preserved.
   
   Also add `-fcompiler-rt` to `ZIGFLAGS` so Zig includes the required compiler 
runtime during linking and resolves the missing `__zig_probe_stack` symbol.
   
   ## Issues
   
   Fixes #19475
   
   ## Testing
   
   Host: WSL2 Ubuntu 24.04 x86_64
   
   Configuration: `sim:nsh`
   
   Enabled `CONFIG_EXAMPLES_HELLO_ZIG`.
   
   Before this change, the build failed while parsing the generated target 
triple. After correcting the target triple, the build failed because 
`__zig_probe_stack` was undefined.
   
   After applying this change, the project built successfully.
   
   Verified the application from NSH:
   
   ```text
   nsh> hello_zig
   [sim]: Hello, Zig!
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to