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
Misc fixes for armv6 bare metal cross #82882
Conversation
newlib is the default for most tools when no kernel is provided. Other exist, but this seems like a safe default. (cherry picked from commit 8009c20)
Sometimes it is useful for it to be slightly different. Going forward we should, however, try to make this fallback rarely needed.
We only want to refer to GCC under these conditions.
Lumping it in with the target platform libraries was incorrect, and caused eval failures when gcc couldn't be built for the target platform.
- Cross to bare metal with GCC works - Flags are deduplicated - Darwin bootstrapping for 8 and 0 closer. - Flags are same across versions.
@@ -23,7 +23,7 @@ let | |||
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" | |||
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" | |||
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags | |||
'' + stdenv.lib.optionalString stdenv.targetPlatform.isLinux '' | |||
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc && !(stdenv.targetPlatform.useLLVM or false)) '' |
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 still don't really understand the use for clang.gcc
if clang was built using gcc isn't it equivalent to stdenv.cc.cc
? It would be nice not to have that conditional attribute IMHO.
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.
It is gross, but clang.gcc
is not necessary the one used to build clang
. clang-unwrapped
is target-agnostic, but the gcc
appears in its passthru
based on the target.
It's all stupid, but at least it is consistent across LLVM versions now. The right thing to do is always build libstdc++
and gcc
separately.
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.
Yeah, that would improve multiple things, anyway this was more of a question than a review comment.
…llvm10?) Misc fixes for armv6 bare metal cross (cherry picked from commit 19a0b38)
…edded (+llvm10?)" (revisit rebuilds) This reverts commit 991f0a5.
Motivation for this change
Best to review commit by commit.
The thing that makes this novel is it's doing cross compilation with clang without
useLLVM = true
, which forces us for the first time to make the ugly clang + gcc hacks work with cross.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)