mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 12:53:59 +03:00
* Clang/LLVM updated to 2.8.
svn path=/nixpkgs/trunk/; revision=25777
This commit is contained in:
parent
596dca28d3
commit
4f87b5338c
@ -1,202 +1,36 @@
|
||||
diff --git a/tools/clang/lib/Frontend/InitHeaderSearch.cpp b/tools/clang/lib/Frontend/InitHeaderSearch.cpp
|
||||
index cd749d2..b5591f6 100644
|
||||
--- a/tools/clang/lib/Frontend/InitHeaderSearch.cpp
|
||||
+++ b/tools/clang/lib/Frontend/InitHeaderSearch.cpp
|
||||
@@ -393,51 +393,7 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple) {
|
||||
diff -ru -x '*~' a/tools/clang/lib/Frontend/InitHeaderSearch.cpp b/tools/clang/lib/Frontend/InitHeaderSearch.cpp
|
||||
--- a/tools/clang/lib/Frontend/InitHeaderSearch.cpp 2010-09-03 18:45:53.000000000 +0200
|
||||
+++ b/tools/clang/lib/Frontend/InitHeaderSearch.cpp 2011-02-05 14:59:08.669573190 +0100
|
||||
@@ -443,6 +443,7 @@
|
||||
AddPath(*i, System, false, false, false);
|
||||
return;
|
||||
}
|
||||
- llvm::Triple::OSType os = triple.getOS();
|
||||
- switch (os) {
|
||||
- case llvm::Triple::Win32:
|
||||
- {
|
||||
- std::string VSDir;
|
||||
- std::string WindowsSDKDir;
|
||||
- if (getVisualStudioDir(VSDir)) {
|
||||
- AddPath(VSDir + "\\VC\\include", System, false, false, false);
|
||||
- if (getWindowsSDKDir(WindowsSDKDir))
|
||||
- AddPath(WindowsSDKDir, System, false, false, false);
|
||||
- else
|
||||
- AddPath(VSDir + "\\VC\\PlatformSDK\\Include",
|
||||
- System, false, false, false);
|
||||
- }
|
||||
- else {
|
||||
- // Default install paths.
|
||||
- AddPath("C:/Program Files/Microsoft Visual Studio 9.0/VC/include",
|
||||
- System, false, false, false);
|
||||
- AddPath(
|
||||
- "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include",
|
||||
- System, false, false, false);
|
||||
- AddPath("C:/Program Files/Microsoft Visual Studio 8/VC/include",
|
||||
- System, false, false, false);
|
||||
- AddPath(
|
||||
- "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include",
|
||||
- System, false, false, false);
|
||||
- // For some clang developers.
|
||||
- AddPath("G:/Program Files/Microsoft Visual Studio 9.0/VC/include",
|
||||
- System, false, false, false);
|
||||
- AddPath(
|
||||
- "G:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include",
|
||||
- System, false, false, false);
|
||||
- }
|
||||
- }
|
||||
- break;
|
||||
- case llvm::Triple::MinGW64:
|
||||
- case llvm::Triple::MinGW32:
|
||||
- AddPath("c:/mingw/include", System, true, false, false);
|
||||
- break;
|
||||
- default:
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- AddPath("/usr/local/include", System, true, false, false);
|
||||
- AddPath("/usr/include", System, false, false, false);
|
||||
+#if 0
|
||||
llvm::Triple::OSType os = triple.getOS();
|
||||
switch (os) {
|
||||
case llvm::Triple::Win32:
|
||||
@@ -532,6 +533,8 @@
|
||||
}
|
||||
|
||||
AddPath("/usr/include", System, false, false, false);
|
||||
+#endif
|
||||
+ AddPath(C_INCLUDE_PATH, System, false, false, false);
|
||||
}
|
||||
|
||||
void InitHeaderSearch::AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple) {
|
||||
@@ -453,144 +409,9 @@ void InitHeaderSearch::AddDefaultCPlusPlusIncludePaths(const llvm::Triple &tripl
|
||||
CXX_INCLUDE_32BIT_DIR, CXX_INCLUDE_64BIT_DIR, triple);
|
||||
void InitHeaderSearch::
|
||||
@@ -550,6 +553,7 @@
|
||||
triple);
|
||||
return;
|
||||
}
|
||||
- // FIXME: temporary hack: hard-coded paths.
|
||||
- switch (os) {
|
||||
- case llvm::Triple::Cygwin:
|
||||
- AddPath("/lib/gcc/i686-pc-cygwin/3.4.4/include",
|
||||
- System, true, false, false);
|
||||
- AddPath("/lib/gcc/i686-pc-cygwin/3.4.4/include/c++",
|
||||
- System, true, false, false);
|
||||
- break;
|
||||
- case llvm::Triple::MinGW64:
|
||||
- // Try gcc 4.4.0
|
||||
- AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw64", "4.4.0");
|
||||
- // Try gcc 4.3.0
|
||||
- AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw64", "4.3.0");
|
||||
- // Fall through.
|
||||
- case llvm::Triple::MinGW32:
|
||||
- // Try gcc 4.4.0
|
||||
- AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.4.0");
|
||||
- // Try gcc 4.3.0
|
||||
- AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.3.0");
|
||||
- break;
|
||||
- case llvm::Triple::Darwin:
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1",
|
||||
- "i686-apple-darwin10", "", "x86_64", triple);
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0",
|
||||
- "i686-apple-darwin8", "", "", triple);
|
||||
- break;
|
||||
- case llvm::Triple::DragonFly:
|
||||
- AddPath("/usr/include/c++/4.1", System, true, false, false);
|
||||
- break;
|
||||
- case llvm::Triple::Linux:
|
||||
- // Exherbo (2010-01-25)
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3",
|
||||
- "x86_64-pc-linux-gnu", "32", "", triple);
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3",
|
||||
- "i686-pc-linux-gnu", "", "", triple);
|
||||
- // Debian sid
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4",
|
||||
- "x86_64-linux-gnu", "32", "", triple);
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4",
|
||||
- "i486-linux-gnu", "64", "", triple);
|
||||
- // Ubuntu 7.10 - Gutsy Gibbon
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.3",
|
||||
- "i486-linux-gnu", "", "", triple);
|
||||
- // Ubuntu 9.04
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.3",
|
||||
- "x86_64-linux-gnu","32", "", triple);
|
||||
- // Ubuntu 9.10
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.1",
|
||||
- "x86_64-linux-gnu", "32", "", triple);
|
||||
- // Fedora 8
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.2",
|
||||
- "i386-redhat-linux", "", "", triple);
|
||||
- // Fedora 9
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.0",
|
||||
- "i386-redhat-linux", "", "", triple);
|
||||
- // Fedora 10
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.2",
|
||||
- "i386-redhat-linux","", "", triple);
|
||||
-
|
||||
- // Fedora 10 x86_64
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.2",
|
||||
- "x86_64-redhat-linux", "32", "", triple);
|
||||
-
|
||||
- // Fedora 11
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.1",
|
||||
- "i586-redhat-linux","", "", triple);
|
||||
-
|
||||
- // Fedora 12
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.2",
|
||||
- "i686-redhat-linux","", "", triple);
|
||||
-
|
||||
- // Fedora 12 (February-2010+)
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3",
|
||||
- "i686-redhat-linux","", "", triple);
|
||||
-
|
||||
- // openSUSE 11.1 32 bit
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3",
|
||||
- "i586-suse-linux", "", "", triple);
|
||||
- // openSUSE 11.1 64 bit
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3",
|
||||
- "x86_64-suse-linux", "32", "", triple);
|
||||
- // openSUSE 11.2
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4",
|
||||
- "i586-suse-linux", "", "", triple);
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4",
|
||||
- "x86_64-suse-linux", "", "", triple);
|
||||
- // Arch Linux 2008-06-24
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.1",
|
||||
- "i686-pc-linux-gnu", "", "", triple);
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.1",
|
||||
- "x86_64-unknown-linux-gnu", "", "", triple);
|
||||
- // Gentoo x86 2009.1 stable
|
||||
- AddGnuCPlusPlusIncludePaths(
|
||||
- "/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4",
|
||||
- "i686-pc-linux-gnu", "", "", triple);
|
||||
- // Gentoo x86 2009.0 stable
|
||||
- AddGnuCPlusPlusIncludePaths(
|
||||
- "/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include/g++-v4",
|
||||
- "i686-pc-linux-gnu", "", "", triple);
|
||||
- // Gentoo x86 2008.0 stable
|
||||
- AddGnuCPlusPlusIncludePaths(
|
||||
- "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4",
|
||||
- "i686-pc-linux-gnu", "", "", triple);
|
||||
- // Ubuntu 8.10
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3",
|
||||
- "i486-pc-linux-gnu", "", "", triple);
|
||||
- // Ubuntu 9.04
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3",
|
||||
- "i486-linux-gnu","", "", triple);
|
||||
- // Gentoo amd64 stable
|
||||
- AddGnuCPlusPlusIncludePaths(
|
||||
- "/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4",
|
||||
- "i686-pc-linux-gnu", "", "", triple);
|
||||
-
|
||||
- // Gentoo amd64 gcc 4.3.2
|
||||
- AddGnuCPlusPlusIncludePaths(
|
||||
- "/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include/g++-v4",
|
||||
- "x86_64-pc-linux-gnu", "", "", triple);
|
||||
-
|
||||
- // Gentoo amd64 gcc 4.4.3
|
||||
- AddGnuCPlusPlusIncludePaths(
|
||||
- "/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/include/g++-v4",
|
||||
- "x86_64-pc-linux-gnu", "32", "", triple);
|
||||
-
|
||||
- break;
|
||||
- case llvm::Triple::FreeBSD:
|
||||
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", "", "", "", triple);
|
||||
- break;
|
||||
- case llvm::Triple::Solaris:
|
||||
- // Solaris - Fall though..
|
||||
- case llvm::Triple::AuroraUX:
|
||||
- // AuroraUX
|
||||
- AddGnuCPlusPlusIncludePaths("/opt/gcc4/include/c++/4.2.4",
|
||||
- "i386-pc-solaris2.11", "", "", triple);
|
||||
- break;
|
||||
- default:
|
||||
- break;
|
||||
- }
|
||||
+#if 0
|
||||
// FIXME: temporary hack: hard-coded paths.
|
||||
switch (os) {
|
||||
case llvm::Triple::Cygwin:
|
||||
@@ -769,6 +773,10 @@
|
||||
default:
|
||||
break;
|
||||
}
|
||||
+#endif
|
||||
+ AddGnuCPlusPlusIncludePaths(
|
||||
+ CPP_INCLUDE_PATH,
|
||||
+ CPP_HOST, "", "", triple);
|
||||
|
@ -1,16 +1,17 @@
|
||||
{stdenv, fetchurl, fetchsvn, gcc, flex, perl, libtool, groff
|
||||
, buildClang ? false}:
|
||||
{ stdenv, fetchurl, gcc, flex, perl, libtool, groff
|
||||
, buildClang ? false }:
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = "llvm-2.7";
|
||||
name = "llvm-2.8";
|
||||
|
||||
src = fetchurl {
|
||||
url = http://llvm.org/releases/2.7/llvm-2.7.tgz;
|
||||
sha256 = "19dwvfyxr851fjfsaxbm56gdj9mlivr37bv6h41hd8q3hpf4nrlr";
|
||||
url = http://llvm.org/releases/2.8/llvm-2.8.tgz;
|
||||
sha256 = "0fyl2gk2ld28isz9bq4f6r4dhqm9vljfj3pdfwlc2v0w5xsdpb95";
|
||||
};
|
||||
|
||||
buildInputs = [ gcc flex perl libtool groff ];
|
||||
buildInputs = [ gcc flex perl groff ];
|
||||
|
||||
configureFlags = [ "--enable-optimized" "--enable-shared" ];
|
||||
configureFlags = [ "--enable-optimized" "--enable-shared" "--disable-static" ];
|
||||
|
||||
meta = {
|
||||
homepage = http://llvm.org/;
|
||||
@ -20,8 +21,7 @@ stdenv.mkDerivation ({
|
||||
platforms = with stdenv.lib.platforms; all;
|
||||
};
|
||||
}
|
||||
//
|
||||
(if buildClang then
|
||||
// stdenv.lib.optionalAttrs buildClang (
|
||||
# I write the assert because 'gcc.libc' will be evaluated although 'triplet' would not
|
||||
# evaluate properly (in the preConfigure below)
|
||||
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
|
||||
@ -30,19 +30,19 @@ stdenv.mkDerivation ({
|
||||
else if (stdenv.system == "x86_64-linux") then "x86_64-unknown-linux-gnu"
|
||||
else throw "System not supported";
|
||||
in {
|
||||
name = "clang-2.7";
|
||||
name = "clang-2.8";
|
||||
|
||||
srcClang = fetchsvn {
|
||||
url = http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_27;
|
||||
rev = 105900;
|
||||
sha256 = "fe79988950319b62d3bca34848424f20a3f33c8182507df222f2ac93fbacf671";
|
||||
srcClang = fetchurl {
|
||||
url = http://llvm.org/releases/2.8/clang-2.8.tgz;
|
||||
sha256 = "1hg0vqmyr4wdy686l2bga0rpin41v0q9ds2k5659m8z6acali0zd";
|
||||
};
|
||||
|
||||
prePatch = ''
|
||||
pushd tools
|
||||
cp -R "$srcClang" clang
|
||||
chmod u+w -R clang
|
||||
unpackFile $srcClang
|
||||
mv clang-2.8 clang
|
||||
popd
|
||||
find
|
||||
'';
|
||||
|
||||
patches = [ ./clang-include-paths.patch ];
|
||||
@ -63,5 +63,4 @@ stdenv.mkDerivation ({
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
};
|
||||
}
|
||||
else {}
|
||||
))
|
||||
|
Loading…
Reference in New Issue
Block a user