-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
llvmPackages_10: cross-compilation support #100574
llvmPackages_10: cross-compilation support #100574
Conversation
@thefloweringash Can you fix the merge conflict? |
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.
useLLVM support still works:
$ nix build github:thefloweringash/nixpkgs?ref=clang-10-cross-compile#pkgsCross.wasi32.hello
084e554
to
0fabc58
Compare
Rebased to fix the merge conflict, and updated to include current state of testing. |
`stdenv` takes tools from the previous stage, so: 1. `pkgsBuildBuild`: `(?1, x, x)` 2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)` while: 1. `pkgsBuildBuild`: `(?1, x, x)` 2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)` 3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
N.B. I started fixing conflicts and then got carried away; I'll try to open the patch to staging soon. |
@thefloweringash well I just edited that one' descriptions to point out I didn't really end up fixing all the cross things :) |
Testing the one use case I'm focused on right now (cross compiling unwrapped llvmPackages_11), it looks like it works as long as I remove |
@thefloweringash do you know why it's deemed needed at all? |
Also would you like to review #111487 ? We have quite little time before the 21.05 staging freeze. |
Hmm it was db29857. Fishy... I'll leave a comment there. |
Motivation for this change
Cross compilation of clang 10. Ultimately to make bootstrap tools for platforms that use clang in their stdenv.
Tested building on
x86_64-linux
withNote that presently I can't test the following due to a build cycle in gcc:
Note that while it's possible to build a wrapper, the wrapper uses the build platform's shell so I was unable to test it.
Some interesting points:
clang-tblgen
doesn't seem to have an install rule within clang, which suggests it's never meant to be installed. To export it without altering the interface I added atablegen
output.llvm-config
is installed by llvm to work a bit likepkg-config
and help locate components of llvm. Installing the native version to a different output didn't work, since it assumes it's installed alongside llvm. I made up the namellvm-config-native
to avoid a conflict, but I'm hoping there's a nicer way to do this. The two versions here are:llvm-config
. This tool is probably never used when building with nixpkgs.postInstall
asllvm-config-native
. This is required for thelld
andclang
builds.lld
would be required to build clang so I removed it. The build didn't fail, but I don't have a strong argument as for why it should or should not be included.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)