Merge staging into closure-size

The most complex problems were from dealing with switches reverted in
the meantime (gcc5, gmp6, ncurses6).
It's likely that darwin is (still) broken nontrivially.
This commit is contained in:
Vladimír Čunát
2015-11-20 14:32:58 +01:00
1278 changed files with 105731 additions and 30012 deletions
+11 -3
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, perl, groff, cmake, python, libffi, binutils }:
{ stdenv, fetchurl, perl, groff, cmake, python, libffi, binutils, debugVersion ? false }:
let
version = "3.3";
in stdenv.mkDerivation rec {
@@ -14,9 +14,17 @@ in stdenv.mkDerivation rec {
./no-rule-aarch64.patch # http://llvm.org/bugs/show_bug.cgi?id=16625
# Patch needed for Julia, backports fixes from LLVM 3.5
(fetchurl {
url = "https://raw.githubusercontent.com/JuliaLang/julia/3bdda3750efc4ebf8ce7eda8a0888ffef3851605/deps/llvm-3.3.patch";
url = "https://raw.githubusercontent.com/JuliaLang/julia/release-0.4/deps/llvm-3.3.patch";
sha256 = "0j6chyx4k8zr1qha5dks8lqlcraqrj4q1hwnk2kj3qi6cajsd8k3";
})
(fetchurl {
url = "https://raw.githubusercontent.com/JuliaLang/julia/release-0.4/deps/instcombine-llvm-3.3.patch";
sha256 = "161frq3wxrkxah78krb24hp4zkcnphzcgnvkwfq1abq2vjx3f8sn";
})
(fetchurl {
url = "https://raw.githubusercontent.com/JuliaLang/julia/release-0.4/deps/int128-vector.llvm-3.3.patch";
sha256 = "0lzkv6hvsdaalwsyf6sq0vdrf8x5nk58qg6nn5dlw7n3hxaxpm4m";
})
];
buildInputs = [ perl groff cmake python libffi ];
@@ -26,7 +34,7 @@ in stdenv.mkDerivation rec {
in "export ${LD}_LIBRARY_PATH='$$${LD}_LIBRARY_PATH:'`pwd`/lib";
cmakeFlags = with stdenv; [
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
"-DLLVM_BUILD_TESTS=ON"
"-DLLVM_ENABLE_FFI=ON"
"-DLLVM_BINUTILS_INCDIR=${binutils}/include"
+2 -1
View File
@@ -12,6 +12,7 @@
, version
, zlib
, compiler-rt_src
, debugVersion ? false
}:
let
@@ -41,7 +42,7 @@ in stdenv.mkDerivation rec {
'';
cmakeFlags = with stdenv; [
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
"-DLLVM_BUILD_TESTS=ON"
"-DLLVM_ENABLE_FFI=ON"
"-DLLVM_REQUIRES_RTTI=1"
+2 -1
View File
@@ -12,6 +12,7 @@
, version
, zlib
, compiler-rt_src
, debugVersion ? false
}:
let
@@ -38,7 +39,7 @@ in stdenv.mkDerivation rec {
'';
cmakeFlags = with stdenv; [
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
"-DLLVM_BUILD_TESTS=ON"
"-DLLVM_ENABLE_FFI=ON"
"-DLLVM_REQUIRES_RTTI=1"
+2 -1
View File
@@ -12,6 +12,7 @@
, version
, zlib
, compiler-rt_src
, debugVersion ? false
}:
let
@@ -38,7 +39,7 @@ in stdenv.mkDerivation rec {
'';
cmakeFlags = with stdenv; [
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
"-DLLVM_BUILD_TESTS=ON"
"-DLLVM_ENABLE_FFI=ON"
"-DLLVM_ENABLE_RTTI=ON"
@@ -12,15 +12,6 @@ stdenv.mkDerivation rec {
preConfigure = ''
# Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$NIX_BUILD_TOP/libcxxabi-${version}.src/include")
'' +
stdenv.lib.optionalString stdenv.isDarwin ''
# instead of allowing libc++ to link with /usr/lib/libc++abi.dylib,
# force it to link with our copy
substituteInPlace lib/CMakeLists.txt \
--replace 'OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib' \
'OSX_RE_EXPORT_LINE "${libcxxabi}/lib/libc++abi.dylib' \
--replace '"''${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib"' \
'"${libcxxabi}/lib/libc++abi.dylib"'
'';
patches = [ ./darwin.patch ];
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
done
make install
install -d 755 $out/include
install -m 644 ../include/cxxabi.h $out/include
install -m 644 ../include/*.h $out/include
''
else ''
install -d -m 755 $out/include $out/lib
+6 -3
View File
@@ -12,6 +12,8 @@
, version
, zlib
, compiler-rt_src
, libcxxabi
, debugVersion ? false
}:
let
@@ -27,7 +29,8 @@ in stdenv.mkDerivation rec {
mv compiler-rt-* $sourceRoot/projects/compiler-rt
'';
buildInputs = [ perl groff cmake libxml2 python libffi ] /* ++ stdenv.lib.optional stdenv.isLinux valgrind */;
buildInputs = [ perl groff cmake libxml2 python libffi ]
++ stdenv.lib.optional stdenv.isDarwin libcxxabi;
propagatedBuildInputs = [ ncurses zlib ];
@@ -38,7 +41,7 @@ in stdenv.mkDerivation rec {
'';
cmakeFlags = with stdenv; [
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
"-DLLVM_INSTALL_UTILS=ON" # Needed by rustc
"-DLLVM_BUILD_TESTS=ON"
"-DLLVM_ENABLE_FFI=ON"
@@ -47,7 +50,7 @@ in stdenv.mkDerivation rec {
"-DBUILD_SHARED_LIBS=ON"
"-DLLVM_BINUTILS_INCDIR=${binutils}/include"
] ++ stdenv.lib.optionals ( isDarwin) [
"-DCMAKE_CXX_FLAGS=-stdlib=libc++"
"-DLLVM_ENABLE_LIBCXX=ON"
"-DCAN_TARGET_i386=false"
];