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
kernel: fix cross compilation after switch to gcc 7 #35091
Conversation
@Ericson2314 @bgamari Is this the right thing to do here? I'm not quite sure with respect to cross-compilers what set they should be coming from. |
Oh, right, I think, though I'm not very certain either. Plain |
BTW, the lines you're fixing are reverted on the |
Perhaps "overrideCC" (or a new variant) should check the platform of the compiler? As-is I think more or less all of its usage will result in this sort of breakage, and generally not be very clear why :). If nothing else, I think it'd make sense to replace all uses of "overrideCC X Y" with "overrideCC X buildPackages.Y"; although perhaps there are a few exceptions. Does that sound good? I can put together a PR doing so if that'd be useful. EDIT: I had overrideCC argument order wrong :) |
Hmm, I'll admit I'm not certain; it looks plausible but I think @Ericson2314 is probably best equipped to answer this. |
Oh, wait buildPackages is wrong in most circumstances anyway, nevermind. Want nativeBuildInputs but no package set for that :(. |
Hi I'm back. Uh oh, I think I need to write more docs if nobody knows the answer :D. This is exactly correct, Only issue is buildPackages.stdenv.cc might also be in use, but whatever. We don't care if temporary tools are made with that. |
Also, I should mention that I have noticed that the |
That's sad, as |
Time to fix things, then! 😁 |
@bgamari How do you reproduce this? Building a cross compiler or cross compiling GCC? I've successfully cross compiled a kernel for armv7l after the GCC 7 merge earlier today. |
Cross-compiling |
Motivation for this change
Kernel cross compilation no longer works after switching to gcc 7, because it uses the host's gcc7 package. This causes the derivation to attempt to cross-compile gcc, rather than building a cross compiler.
Things done
Switching to
buildPackages.gcc7
causes the build to use a compiler with the correct combination of platforms.build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)