Skip to content

Zig build run fails on Raspberry Pi 5 #18819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Uthedris opened this issue Feb 4, 2024 · 4 comments
Closed

Zig build run fails on Raspberry Pi 5 #18819

Uthedris opened this issue Feb 4, 2024 · 4 comments

Comments

@Uthedris
Copy link
Contributor

Uthedris commented Feb 4, 2024

Zig Version

0.12.0-dev.2550+a65bc8d07

Steps to Reproduce and Observed Behavior

To Reproduce in Ras Pi 5:

mkdir zig-test
cd zig-test
zig init
zig build run

zig goes through the build process and then stops with:

thread 1998 panic: reached unreachable code
Panicked during a panic. Aborting.
error: the following build command crashed:
/home/craig/zig-test/zig-cache/o/5ab4d18f2ddd1ccfdec54cc769e36159/build /opt/zig-linux-aarch64-0.12.0-dev.2550+a65bc8d07/zig /home/craig/zig-test /home/craig/zig-test/zig-cache /home/craig/.cache/zig --seed 0x33ed21e0 run

I have also tried with zig 0.11.0 with equivalent results.

I followed exact same procedure on a Raspberry Pi 4B (with same OS version) and it worked fine.

As a side node running the code with:

zig run src/main.zig

works as expected on both platforms.

Expected Behavior

See: All your codebase are belong to us.

@Uthedris Uthedris added the bug Observed behavior contradicts documented or intended behavior label Feb 4, 2024
@RossComputerGuy
Copy link
Contributor

Known issue, will be resolved once #17382 is merged.

@Uthedris
Copy link
Contributor Author

Perhaps dupe of #16331

@andrewrk
Copy link
Member

Dupe of #16331

@andrewrk andrewrk closed this as not planned Won't fix, can't repro, duplicate, stale Aug 15, 2024
@andrewrk andrewrk removed the bug Observed behavior contradicts documented or intended behavior label Aug 15, 2024
@bfreis
Copy link
Contributor

bfreis commented Nov 14, 2024

FWIW, if you're willing to change your Pi 5 configuration, it's possible to work around this issue.

By adding kernel=kernel8.img to /boot/firmware/config.txt, you instruct the Pi 5 to load kernel8.img instead of kernel_2712.img. The kernel8.img is configured with 4k page size, while the 2712, specific for the Pi 5, is configured with 16k page size. When I made the change and rebooted, I was able to use Zig build just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants