-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
zig 0.10.1: SIGILL on SSE4a instruction insertq #214356
Comments
Thanks for reporting! I am investigating this. |
On my Zen 3 machine, Nix' Zig works fine. I can reproduce the bug by using qemu:
Adding Now to figure out a good fix... |
Proposed fix: #214440 |
I think I hit this too. I'm on NixOS Unstable and I keep getting On my laptop with an Intel processor (i5-1135G7), Trying to build a package like
The substitute from the repo works fine. |
I am seeing |
(same as sagehane) |
I did talk to @ifreund over River's IRC room and he did say this:
I presume this would be a different from the approach given in #214440? |
Yes,
#214440 affects the Zig compiler itself too. |
Regardless of how the discussion in #214440 ends up, a patch that passes I don't use or contribute to nixos personally, but from my outside perspective it seems sensible to merge that simple fix now while the discussion on the longer term direction to take on #214440 continues. I personally think some kind of helper function to automatically pass Changing the defaults compared to upstream zig for all users of nix seems very heavy handed and will cause confusion long term. |
Sometimes it is useful to use a "raw" |
Thanks @ifreund. It seems that is what is missing. I will test this when i have my laptop open next. |
Hi all, I'm away at a conference and do not have time to give this issue my full and complete attention, but I wanted to note that upstream is willing to add a feature or enhancement to make this situation easier for Nix, as well as other package distributions, to deal with. In particular we have this upstream issue: ziglang/zig#14281 Perhaps, for example, it could be a flag passed to Let us discuss this possible feature, if it is amenable, and then I will go implement it upstream. |
26b9a2f changes Zig 0.10 to build the compiler (notably *not* its outputs, at least not by default) with its baseline CPU target, but we should ideally do it for both versions to increase reproducibility, as well as increase the number of users who are able to use Hydra-provided Zig binaries. This also adds a comment above the flag in 0.10, to explain why we're adding the flag, as we do with the RPATH one. See NixOS#214356 and NixOS#185665 for further context.
26b9a2f changes Zig 0.10 to build the compiler (notably *not* its outputs, at least not by default) with its baseline CPU target, but we should ideally do it for both versions to increase reproducibility, as well as increase the number of users who are able to use Hydra-provided Zig binaries. This also adds a comment above the flag in 0.10, to explain why we're adding the flag, as we do with the RPATH one. See NixOS#214356 and NixOS#185665 for further context.
@edrex Please read my above comment :) unless you think we should move to the other issue? |
I think the reported issue here has been fixed, and #185665 sums up the remaining issue quite well, so +1 to close once fix is verified. |
Describe the bug
Using Zig version 0.10.1 from 006c3bd, certain operations (
zig build
,zig run
,zig fmt
on some files, possibly others) crash with SIGILL. A bit of debugging reveals it's the SSE4a-only instructioninsertq
(unavailable on Intel chips according to wikipedia).Steps To Reproduce
Steps to reproduce the behavior:
1.
$ nix run github:NixOS/nixpkgs/006c3bd4dd2f5d1d2094047f307cbf9e2b73d9c5#zig -- run hello.zig
Expected behavior
Hello, world!
Actual behaviour
Screenshots
Additional context
Presumably happening because Zig 0.10 is the first to include the self-hosted compiler, which compiles with
-march=native
by default. See also #185665.Notify maintainers
@aiotter @andrewrk @AndersonTorres @strager
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: