diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix index bed6bf1fc13b..7ef7adfa324e 100644 --- a/pkgs/development/compilers/llvm/default.nix +++ b/pkgs/development/compilers/llvm/default.nix @@ -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; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c7d86057fb4f..0a0ac731cd75 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 {}