gcc: fix building cross-compiler on 32-bit host platforms#82510
gcc: fix building cross-compiler on 32-bit host platforms#82510vcunat merged 2 commits intoNixOS:stagingfrom
Conversation
|
Can we just get rid of that |
|
There is another fix already in master: b6ae819 |
|
That fix looks pretty broken IMO. It just creates an empty output to satisfy Nix, but the target libraries will be missing. Once master gets merged into staging, I will revert it in this PR. |
|
@lopsided98 just updated staging for you |
b755e65 to
b7b9f82
Compare
There was a problem hiding this comment.
Still want [ -z "$enableMultilib" ] though, right?
There was a problem hiding this comment.
Those directories should always be created. I think the logic for the conditional below is correct (other than is64bit referring to wrong platform). On 32-bit platforms, there should only be a lib directory. On 64-bit platforms, there should be lib and lib64, which should be linked unless multilib is enabled.
It doesn't seem to break anything to have lib64 on 32-bit as well (since it happens unintentionally in the armv7l cross compiler), but that kind of change seems out of scope for this PR.
There was a problem hiding this comment.
Well, I'm not sure we ever don't do enableMultilib, but I think without multilib it never prefixes any directories like that.
There was a problem hiding this comment.
Multilib is disabled for normal builds. In all the 64-bit GCCs I have built, lib64 is a symlink to lib. The only place I can find in nixpkgs where enableMultilib is true is gcc_multi.
There was a problem hiding this comment.
Oh oops I forgot the -z and got it backwards.
This reverts commit b6ae819.
b7b9f82 to
83fa0d9
Compare
vcunat
left a comment
There was a problem hiding this comment.
I see no issue with this. Thanks.
It was rightly noted that armv7l suffers from the same issue: https://hydra.nixos.org/build/114263466#tabs-buildsteps
Motivation for this change
Fixes building cross-compiler on 32-bit host platforms, which was broken by #81844.
Some quirk/bug of
moveToOutputseems to sometimes prevent it from creating the output if it does not already exist. Therefore we need to manually create the output. On 64-bit host platforms, the output gets created here: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/gcc/builder.sh#L208. Note that theis64bitvariable refers to the host platform, although it would probably make more sense for it to refer to the target platform. This is why this bug does not occur for 32-bit ARM cross-compilers.I'm not sure why #81844 triggered the problem with
moveToOutput, as that function's code is hard for me to understand: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/multiple-outputs.sh#L93Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)cc @matthewbauer @misuzu