llvm: support cross compilation with useLLVM flag

You can build (partially) with LLVM toolchain using the useLLVM flag.
This works like so:

  nix-build -A hello --arg crossSystem '{ system =
    "aarch64-unknown-linux-musl"; useLLVM = true }'

also don’t separate debug info in lldClang

It doesn’t work currently with that setup hook. Missing build-id?
This commit is contained in:
Matthew Bauer
2019-02-26 19:45:35 -05:00
parent 77d7d60d8c
commit b86e62d30d
9 changed files with 710 additions and 14 deletions
+2
View File
@@ -54,6 +54,8 @@ in lib.init bootStages ++ [
then buildPackages.darwin.iosSdkPkgs.clang
else if crossSystem.useAndroidPrebuilt or false
then buildPackages."androidndkPkgs_${crossSystem.ndkVer}".gcc
else if crossSystem.useLLVM or false
then buildPackages.llvmPackages_7.lldClang
else buildPackages.gcc;
extraNativeBuildInputs = old.extraNativeBuildInputs