-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
AVR compilation target leads to unreachable code #3634
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
Comments
I'm not certain, but should ABI really be none there? Wouldn't EABI be more appropriate? |
|
Nevermind, I accidentally set the architecture to Arm, which worked perfectly fine. The build still fails with AVR. |
This looks frustrating - I have a few AVR boards lying around, I'll try and see if I can get this working in my spare time over the coming weekend. |
Sounds awesome, thank you very much :) |
A bunch of things came up, sorry for the delay; this is on my todo list for tomorrow. |
The unreachable error is due to Zig not providing an emulation argument for the AVR target. This is understandable, considering that I have been getting around this by building an object file and then using |
@layneson Cool, thanks for the info. Did you put the |
Yes, I added a few system command build steps into my I will publish an example/experiment repo with a build file soon; I'll link it here when it's up so that anyone who runs into this issue can see a potential workaround. |
That last sentence describes my experience with custom build processes in Zig quite well. It always seems like a makeshift solution, but in the end it works perfectly fine. |
@LemonBoy Wow, that was quick and unexpected! I'll keep a close eye on that. |
This seems to have long since been fixed. |
I'm running macOS 10.15 and tried to cross-compile the default
init-exe
code to AVR, but this leads to unreachable code ingetLDMOption
. Here's the only change in the build script:const Builder = @import("std").build.Builder; const builtin = @import("builtin"); pub fn build(b: *Builder) void { const mode = b.standardReleaseOptions(); const exe = b.addExecutable("zig-avr", "src/main.zig"); exe.setBuildMode(mode); + exe.setTarget(builtin.Arch.avr, builtin.Os.freestanding, builtin.Abi.none); exe.install(); const run_cmd = exe.run(); run_cmd.step.dependOn(b.getInstallStep()); const run_step = b.step("run", "Run the app"); run_step.dependOn(&run_cmd.step); }
And here's the actual error:
The text was updated successfully, but these errors were encountered: