llvm-3.9: Fix cross compilation
It's now possible to cross compile llvm: `nix-build -E '(import ./. { crossSystem = import ./platform.nix; }).pkgs.llvm'`
This commit is contained in:
parent
3eee6ea7c1
commit
12bbc63024
@ -17,6 +17,9 @@
|
||||
, debugVersion ? false
|
||||
, enableSharedLibraries ? true
|
||||
, darwin
|
||||
, buildPackages
|
||||
, buildPlatform
|
||||
, hostPlatform
|
||||
}:
|
||||
|
||||
let
|
||||
@ -39,7 +42,13 @@ in stdenv.mkDerivation rec {
|
||||
|
||||
outputs = [ "out" ] ++ stdenv.lib.optional enableSharedLibraries "lib";
|
||||
|
||||
buildInputs = [ perl groff cmake libxml2 python libffi ]
|
||||
buildInputs = [
|
||||
buildPackages.perl
|
||||
buildPackages.buildPackages.cmake
|
||||
buildPackages.python
|
||||
groff
|
||||
libxml2
|
||||
libffi ]
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi ];
|
||||
|
||||
propagatedBuildInputs = [ ncurses zlib ];
|
||||
@ -88,6 +97,9 @@ in stdenv.mkDerivation rec {
|
||||
++ stdenv.lib.optionals (isDarwin) [
|
||||
"-DLLVM_ENABLE_LIBCXX=ON"
|
||||
"-DCAN_TARGET_i386=false"
|
||||
] ++ stdenv.lib.optionals (buildPlatform != hostPlatform) [
|
||||
"-DCMAKE_CROSSCOMPILING=True"
|
||||
"-DLLVM_TABLEGEN=${buildPackages.llvmPackages_39.llvm}/bin/llvm-tblgen"
|
||||
];
|
||||
|
||||
postBuild = ''
|
||||
|
Loading…
Reference in New Issue
Block a user