ML-dev-crypto opened a new issue, #19475:
URL: https://github.com/apache/nuttx/issues/19475

   ### 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
   
   1. Configure NuttX for `sim:x86_64`.
   2. Enable the Zig hello example:
      ```
      CONFIG_EXAMPLES_HELLO_ZIG=y
      ```
   3. Build NuttX.
   
   The build first fails because `tools/Zig.defs` generates the following 
target:
   
   ```text
   -target x86_64-freestanding-sysv
   ```
   
   However, Zig reports:
   
   ```text
   error: unknown ABI: 'sysv'
   ```
   
   After locally changing the target to a Zig-supported ABI, the build proceeds 
further but then fails during linking with:
   
   ```text
   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:
   
   ```text
   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
   
   - [x] I have verified before submitting the report.


-- 
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