llvm: add 3.4, urge for versioned usage

The 3.4 code was tested preliminary in x-updates,
described by 2e4eab1228.

Updates to llvm break builds of dependent packages (in all cases I've seen),
and often upstream isn't too fast in porting to the newest version.
Consequently, it seems better to keep more versions (two ATM),
both in one file to share eventual changes.
Also, using versioned llvm_* attributes is proposed because of this.
This commit is contained in:
Vladimír Čunát 2014-01-13 21:38:44 +01:00
parent c31a4c927d
commit ae0c9b626f
2 changed files with 15 additions and 7 deletions

View File

@ -1,17 +1,21 @@
{ stdenv, fetchurl, perl, groff, cmake, python, libffi, binutils_gold }:
{ stdenv, fetchurl, perl, groff, cmake, python, libffi, binutils_gold, version }:
let version = "3.3"; in
with { inherit (stdenv.lib) optional; };
assert version == "3.4" || version == "3.3";
stdenv.mkDerivation rec {
name = "llvm-${version}";
src = fetchurl {
url = "http://llvm.org/releases/${version}/llvm-${version}.src.tar.gz";
sha256 = "0y3mfbb5qzcpw3v5qncn69x1hdrrrfirgs82ypi2annhf0g6nxk8";
sha256 =
if version == "3.4" then "0a169ba045r4apb9cv6ncrwl83l7yiajnzirkcdlhj1cd4nn3995"
else /*3.3*/ "0y3mfbb5qzcpw3v5qncn69x1hdrrrfirgs82ypi2annhf0g6nxk8";
};
# The default rlimits are too low for shared libraries.
patches = [ ./more-memory-for-bugpoint.patch ];
patches = optional (version == "3.3") [ ./more-memory-for-bugpoint.patch ];
# libffi was propagated before, but it wasn't even being used, so
# unless something needs it just an input is fine.
@ -25,8 +29,9 @@ stdenv.mkDerivation rec {
"-DCMAKE_BUILD_TYPE=Release"
"-DLLVM_ENABLE_FFI=ON"
"-DLLVM_BINUTILS_INCDIR=${binutils_gold}/include"
"-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=R600" # for mesa
] ++ lib.optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON";
]
++ optional (version == "3.3") "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=R600" # for mesa
++ optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON";
enableParallelBuilding = true;

View File

@ -2903,11 +2903,14 @@ let
lessc = callPackage ../development/compilers/lessc { };
llvm = callPackage ../development/compilers/llvm {
llvm = llvm_33; # deprecated, depend on llvm_* directly
llvm_34 = callPackage ../development/compilers/llvm {
version = "3.4";
stdenv = if stdenv.isDarwin
then stdenvAdapters.overrideGCC stdenv gccApple
else stdenv;
};
llvm_33 = llvm_34.override { version = "3.3"; };
mentorToolchains = recurseIntoAttrs (
callPackage_i686 ../development/compilers/mentor {}