gcc*: force building a cross compiler if host and target platform differ #123419
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
gcc's configure system has the nasty habit (for us) of judging for
itself if it is building a cross compiler (or cross compiling), but on
the limited information of the build, host and target platforms' config
which only contains a subset of the information we encode in
stdenv.*Platform
. The practical consequence was that prior to thischange building
pkgsLLVM.buildPackages.gcc
actually fails because itrefuses to use
--with-headers
with something it believes to not be across compiler.
As a workaround we force the appropriate variable in the configure
script to always be
yes
regardless of its own conditional check.At some point we probably should report this issue in some capacity, so
future gcc versions don't force us into workarounds like this and
acdc783.
Now the following works which failed pretty early previously (on staging):
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)