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
linux: don't add HOSTCC to PATH during build #34882
Conversation
Verified that now it's really effective (non-cross):
And
|
Failure on x86_64-darwin (full log) Partial log (click to expand)
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
It also fixes the regressed build of |
Failure on x86_64-linux (full log) Partial log (click to expand)
|
@vcunat for a non-cross build, This makes |
@Ericson2314: the problem is with overridability. We have Why doesn't it exist? For me it resolves to working gcc for non-cross build (i.e. "native", right?), and I thought it's the correct version for cross builds also. |
Ok makes sense. And I'm warming to your solution, actually :). At first I thought you needed to exploit a native-only special case, and that gave me pause. But actually, you were hampered by a native-only special case, namely that two different compilers were clobbering each other.
Nevermind, it does exists but it wouldn't for cross. You'd have to do "HOSTCC=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" |
@vcunat So the thing is, though, it's sketch to not have the How about we define |
You mean this way ^^ ? |
@@ -267,7 +267,8 @@ stdenv.mkDerivation ((drvAttrs config hostPlatform.platform kernelPatches config | |||
hardeningDisable = [ "bindnow" "format" "fortify" "stackprotector" "pic" ]; | |||
|
|||
makeFlags = commonMakeFlags ++ [ | |||
"HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc" | |||
"CC=${stdenv.cc}/bin/cc" |
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.
still need the stdenv.cc.targetPrefix
like below, but otherwise good. Thanks!
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.
OK, I assumed stdenv.cc
is always prefix-less.
Failure on x86_64-darwin (full log) Partial log (click to expand)
|
HOSTCC was taking precedence before stdenv's normal CC, at least in case of non-cross build.
8070efb
to
3d24c5e
Compare
Failure on x86_64-darwin (full log) Partial log (click to expand)
|
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.
I went ahead and just made the one change, so merge whenever @vcunat!
Success on aarch64-linux (full log) Partial log (click to expand)
|
Success on aarch64-linux (full log) Partial log (click to expand)
|
Failure on x86_64-linux (full log) Partial log (click to expand)
|
Uh, I accidentally re-pushed again, deleting your comment in the file, but otherwise the contents should be the same. Feel free to overwrite it again :-) (GitHub seems to have lost the commit immediately.) I have a setup that force-mirrors all branches that match a pattern, and sometimes this bites me. |
8070efb
to
3d24c5e
Compare
No worries, easy to force push. |
Success on aarch64-linux (full log) Partial log (click to expand)
|
Failure on x86_64-darwin (full log) Partial log (click to expand)
|
Failure on x86_64-linux (full log) Partial log (click to expand)
|
This is needed to really build linux with gcc7 after ae04052.
Failure on x86_64-linux (full log) Partial log (click to expand)
|
It was taking precedence before stdenv's normal CC, at least in case of non-cross build.
Motivation for this change
Finishing the retpoline workaround, hopefully without breaking cross-compilation.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)