llvmPackages_10: cross-compilation support#100574
llvmPackages_10: cross-compilation support#100574thefloweringash wants to merge 2 commits intoNixOS:masterfrom
Conversation
|
@thefloweringash Can you fix the merge conflict? |
matthewbauer
left a comment
There was a problem hiding this comment.
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-linuxwithNote 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-tblgendoesn'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 atablegenoutput.llvm-configis installed by llvm to work a bit likepkg-configand 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-nativeto 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.postInstallasllvm-config-native. This is required for thelldandclangbuilds.lldwould 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
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)