gcc: only use zerocallusedregs on gcc11+ x86, aarch64#377690
gcc: only use zerocallusedregs on gcc11+ x86, aarch64#377690conroy-cheers wants to merge 1 commit intoNixOS:masterfrom
Conversation
0eec75a to
3b33990
Compare
3b33990 to
e701dda
Compare
e701dda to
8fab1b7
Compare
|
It was less an oversight, more that the limited supported platforms is helpfully not documented (https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fzero-call-used-regs) and I struggled to find reliable information on this short of reading the (byzantine) gcc source. I'd be interested to know what information we're basing the set of supported platforms on - for instance I'm pretty sure this hasn't caused issues on i686 or risc-v since it was enabled by default, both of which this would disable it for. |
|
For context, I originally ran into this compiling embedded firmware for |
Signed-off-by: conroy-cheers <conroy@corncheese.org>
8fab1b7 to
90c37d3
Compare
risicle
left a comment
There was a problem hiding this comment.
Just going to put my above objections to this on the record lest someone see the above approval and reach for the merge button. This goes too far and disables zerocallusedregs for platforms it seems to work fine on.
Possibly we should explicitly disable it for some targets it's known not to work for, but TBH I don't think people should be using wrapped compilers for embedded targets anyway. cc-wrapper makes a lot of assumptions that it's building something for running on a general-purpose os and it's a bit of an accident that it works at all for embedded targets.
See also the rat's nest of issues around #323869 which exposed a bunch of places in nixpkgs that were using wrapped compilers to build GPU kernels, BPF filters etc.
-fzero-call-used-regsflag isn't supported by all platforms; for example, the following currently fails to build on master:This change restricts the
-fzero-call-used-regsflag to x86 and aarch64 platforms.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.