LLVM-3.9: disable shared libraries in cross builds

The current cc-wrapper script seems to have trouble setting the rpath
correctly. Hopefully #25047 will fix this.
This commit is contained in:
Joe Hermaszewski 2017-04-26 14:01:35 +00:00
parent bad5ca0525
commit 7b7ffc4999

@ -15,13 +15,15 @@
, compiler-rt_src , compiler-rt_src
, libcxxabi , libcxxabi
, debugVersion ? false , debugVersion ? false
, enableSharedLibraries ? true , enableSharedLibraries ? (buildPlatform == hostPlatform)
, darwin , darwin
, buildPackages , buildPackages
, buildPlatform , buildPlatform
, hostPlatform , hostPlatform
}: }:
assert (hostPlatform != buildPlatform) -> !enableSharedLibraries;
let let
src = fetch "llvm" "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z"; src = fetch "llvm" "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z";
shlib = if stdenv.isDarwin then "dylib" else "so"; shlib = if stdenv.isDarwin then "dylib" else "so";
@ -84,12 +86,6 @@ in stdenv.mkDerivation rec {
preBuild = '' preBuild = ''
mkdir -p $out/ mkdir -p $out/
ln -sv $PWD/lib $out ln -sv $PWD/lib $out
''
+ # This is a good candidate for using the `placeholder` primitive when it's released
# This should hopefully be unnecessary once
# https://github.com/NixOS/nixpkgs/pull/25047 is merged
stdenv.lib.optionalString (buildPlatform != hostPlatform && enableSharedLibraries) ''
export NIX_CROSS_LDFLAGS="-rpath $lib/lib -rpath $lib/lib64 $NIX_CROSS_LDFLAGS"
''; '';
cmakeFlags = with stdenv; [ cmakeFlags = with stdenv; [