-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
cc-wrapper: make machine configuration configurable #59225
Conversation
@@ -86,7 +86,7 @@ rec { | |||
i486 = { bits = 32; significantByte = littleEndian; family = "x86"; }; | |||
i586 = { bits = 32; significantByte = littleEndian; family = "x86"; }; | |||
i686 = { bits = 32; significantByte = littleEndian; family = "x86"; }; | |||
x86_64 = { bits = 64; significantByte = littleEndian; family = "x86"; }; | |||
x86_64 = { bits = 64; significantByte = littleEndian; family = "x86"; arch = "x86-64"; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html I think GCC also wants armv7-a
etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really great change! Just add those arm arch
entries, and let's ship!
af469aa
to
462be75
Compare
@matthewbauer perhaps we could make a single list go in the file, rather than a bunch of |
edb08c7
to
c66cda7
Compare
Think this needs a rebase :) |
c66cda7
to
e32c909
Compare
Nope I am still working on it. It's just takes a long time to test things out. |
e32c909
to
73ee263
Compare
f0f46b8
to
f6bf5ae
Compare
@volth for reference here is the issue I am getting with armv7l-hf-multiplatform:
This looks bad - it should be using hard floats here but somehow libgcc is built without them! |
597ccb8
to
f6bf5ae
Compare
It is useful to make these dynamic and not bake them into gcc. This means we don’t have to rebuild gcc to change these values. Instead, we will pass cflags to gcc based on platform values. This was already done hackily for android gcc (which is multi-target), but not for our own gccs which are single target. To accomplish this, we need to add a few things: - add ‘arch’ to cpu - add NIX_CFLAGS_COMPILE_BEFORE flag (goes before args) - set -march everywhere - set mcpu, mfpu, mmode, and mtune based on targetPlatform.gcc flags cc-wrapper: only set -march when it is in the cpu type Some architectures don’t have a good mapping of -march. For instance POWER architecture doesn’t support the -march flag at all! https://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html#RS_002f6000-and-PowerPC-Options
f6bf5ae
to
d180cb9
Compare
It looks like those platform flags are really needed for single lib gcc. Adding the |
Ok that's annoying |
We could either revert this pr or remove the "or" case here: https://github.com/NixOS/nixpkgs/blob/staging/pkgs/build-support/cc-wrapper/default.nix#L323 to prevent this from breaking things |
Yes if we could make cc-wrapper remove conflicting flags from |
Fix for #59225 regression proposed by @matthewbauer #59225 (comment) (cherry picked from commit a6ea72a)
It is useful to make these dynamic and not bake them into gcc. This
means we don’t have to rebuild gcc to change these values. Instead, we
will pass cflags to gcc based on platform values. This was already
done hackily for android gcc (which is multi-target), but not for our
own gccs which are single target.
To accomplish this, we need to add a few things:
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)