clang: Bump to 3.1

This commit is contained in:
Shea Levy 2012-10-08 01:57:39 -04:00
parent 5a6fd3d510
commit 4f178d1698
3 changed files with 70 additions and 80 deletions

View File

@ -1,49 +1,21 @@
diff -Naur clang-3.0.src-orig/lib/Driver/ToolChains.cpp clang-3.0.src/lib/Driver/ToolChains.cpp
--- clang-3.0.src-orig/lib/Driver/ToolChains.cpp 2011-11-17 02:40:32.000000000 -0500
+++ clang-3.0.src/lib/Driver/ToolChains.cpp 2011-12-19 06:29:27.562428830 -0500
@@ -1926,14 +1926,17 @@
diff -Naur clang-3.1.src-orig/lib/Driver/ToolChains.cpp clang-3.1.src/lib/Driver/ToolChains.cpp
--- clang-3.1.src-orig/lib/Driver/ToolChains.cpp 2012-05-11 20:16:02.000000000 -0400
+++ clang-3.1.src/lib/Driver/ToolChains.cpp 2012-10-08 01:13:01.044083509 -0400
@@ -2146,9 +2146,6 @@
if (DriverArgs.hasArg(options::OPT_nostdinc))
return;
+#if 0
if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/local/include");
+#endif
- if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
- addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/local/include");
-
if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
llvm::sys::Path P(D.ResourceDir);
P.appendComponent("include");
addSystemInclude(DriverArgs, CC1Args, P.str());
}
+#if 0
if (DriverArgs.hasArg(options::OPT_nostdlibinc))
return;
@@ -1998,6 +2001,8 @@
@@ -2264,6 +2261,7 @@
return;
addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/include");
+#endif
+ addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + C_INCLUDE_PATH);
}
static bool addLibStdCXXIncludePaths(Twine Base, Twine TargetArchDir,
@@ -2030,6 +2035,7 @@
bool IsTarget64Bit = (TargetArch == llvm::Triple::x86_64 ||
TargetArch == llvm::Triple::ppc64);
+#if 0
StringRef CxxIncludeRoot(CXX_INCLUDE_ROOT);
if (!CxxIncludeRoot.empty()) {
StringRef CxxIncludeArch(CXX_INCLUDE_ARCH);
@@ -2072,6 +2078,10 @@
GCCInstallation.getTriple() + Suffix,
DriverArgs, CC1Args);
}
+#endif
+ addLibStdCXXIncludePaths(CPP_INCLUDE_PATH,
+ CPP_HOST,
+ DriverArgs, CC1Args);
}
/// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly.
// Check if libc++ has been enabled and provide its include paths if so.
+ // !!! Will need to modify this if/when nixpkgs uses libc++
if (GetCXXStdlibType(DriverArgs) == ToolChain::CST_Libcxx) {
// libc++ is always installed at a fixed path on Linux currently.
addSystemInclude(DriverArgs, CC1Args,

View File

@ -1,38 +1,57 @@
diff -Naur clang-3.0.src-orig/lib/Driver/ToolChains.cpp clang-3.0.src/lib/Driver/ToolChains.cpp
--- clang-3.0.src-orig/lib/Driver/ToolChains.cpp 2011-11-17 02:40:32.000000000 -0500
+++ clang-3.0.src/lib/Driver/ToolChains.cpp 2011-12-19 05:32:38.695513475 -0500
@@ -1800,6 +1800,7 @@
diff -Naur clang-3.1.src-orig/lib/Driver/ToolChains.cpp clang-3.1.src/lib/Driver/ToolChains.cpp
--- clang-3.1.src-orig/lib/Driver/ToolChains.cpp 2012-05-11 20:16:02.000000000 -0400
+++ clang-3.1.src/lib/Driver/ToolChains.cpp 2012-10-08 01:22:53.458850737 -0400
@@ -2077,16 +2077,6 @@
addPathIfExists(LibPath + "/../" + Multilib, Paths);
}
}
- addPathIfExists(SysRoot + "/lib/" + MultiarchTriple, Paths);
- addPathIfExists(SysRoot + "/lib/../" + Multilib, Paths);
- addPathIfExists(SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
- addPathIfExists(SysRoot + "/usr/lib/../" + Multilib, Paths);
-
- // Try walking via the GCC triple path in case of multiarch GCC
- // installations with strange symlinks.
- if (GCCInstallation.isValid())
- addPathIfExists(SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
- "/../../" + Multilib, Paths);
Linker = GetProgramPath("ld");
+#if 0
LinuxDistro Distro = DetectLinuxDistro(Arch);
if (IsOpenSuse(Distro) || IsUbuntu(Distro)) {
@@ -1882,6 +1883,7 @@
addPathIfExists(SysRoot + "/lib", Paths);
addPathIfExists(SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
addPathIfExists(SysRoot + "/usr/lib", Paths);
+#endif
// Add the non-multilib suffixed paths (if potentially different).
if (GCCInstallation.isValid()) {
@@ -2100,8 +2090,6 @@
addPathIfExists(LibPath, Paths);
}
}
- addPathIfExists(SysRoot + "/lib", Paths);
- addPathIfExists(SysRoot + "/usr/lib", Paths);
}
bool Linux::HasNativeLLVMSupport() const {
diff -Naur clang-3.0.src-orig/lib/Driver/Tools.cpp clang-3.0.src/lib/Driver/Tools.cpp
--- clang-3.0.src-orig/lib/Driver/Tools.cpp 2011-11-07 05:27:39.000000000 -0500
+++ clang-3.0.src/lib/Driver/Tools.cpp 2011-12-19 05:34:44.075325534 -0500
@@ -4306,6 +4306,7 @@
diff -Naur clang-3.1.src-orig/lib/Driver/Tools.cpp clang-3.1.src/lib/Driver/Tools.cpp
--- clang-3.1.src-orig/lib/Driver/Tools.cpp 2012-04-18 17:32:25.000000000 -0400
+++ clang-3.1.src/lib/Driver/Tools.cpp 2012-10-08 01:25:23.913501995 -0400
@@ -5210,24 +5210,6 @@
ToolChain.getArch() == llvm::Triple::thumb ||
(!Args.hasArg(options::OPT_static) &&
!Args.hasArg(options::OPT_shared))) {
+#if 0
CmdArgs.push_back("-dynamic-linker");
if (ToolChain.getArch() == llvm::Triple::x86)
CmdArgs.push_back("/lib/ld-linux.so.2");
@@ -4318,6 +4319,7 @@
CmdArgs.push_back("/lib64/ld64.so.1");
else
CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2");
+#endif
- CmdArgs.push_back("-dynamic-linker");
- if (ToolChain.getArch() == llvm::Triple::x86)
- CmdArgs.push_back("/lib/ld-linux.so.2");
- else if (ToolChain.getArch() == llvm::Triple::arm ||
- ToolChain.getArch() == llvm::Triple::thumb)
- CmdArgs.push_back("/lib/ld-linux.so.3");
- else if (ToolChain.getArch() == llvm::Triple::mips ||
- ToolChain.getArch() == llvm::Triple::mipsel)
- CmdArgs.push_back("/lib/ld.so.1");
- else if (ToolChain.getArch() == llvm::Triple::mips64 ||
- ToolChain.getArch() == llvm::Triple::mips64el)
- CmdArgs.push_back("/lib64/ld.so.1");
- else if (ToolChain.getArch() == llvm::Triple::ppc)
- CmdArgs.push_back("/lib/ld.so.1");
- else if (ToolChain.getArch() == llvm::Triple::ppc64)
- CmdArgs.push_back("/lib64/ld64.so.1");
- else
- CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2");
}
CmdArgs.push_back("-o");

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, perl, groff, llvm, cmake }:
let version = "3.0"; in
let version = "3.1"; in
stdenv.mkDerivation {
name = "clang-${version}";
@ -10,20 +10,19 @@ stdenv.mkDerivation {
patches = stdenv.lib.optionals (stdenv.gcc.libc != null)
[ ./clang-include-paths.patch ./clang-ld-flags.patch ];
postPatch = stdenv.lib.optionalString (stdenv.gcc.libc != null) ''
sed -i -e 's,C_INCLUDE_PATH,"${stdenv.gcc.libc}/include/",' \
-e 's,CPP_HOST,"'$(${stdenv.gcc}/bin/cc -dumpmachine)'",' \
-e 's,CPP_INCLUDE_PATH,"${stdenv.gcc.gcc}/include/c++/${stdenv.gcc.gcc.version}",' \
lib/Driver/ToolChains.cpp
'';
cmakeFlags = [ "-DCLANG_PATH_TO_LLVM_BUILD=${llvm}" "-DCMAKE_BUILD_TYPE=Release" "-DLLVM_TARGETS_TO_BUILD=all"];
cmakeFlags = [
"-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"
"-DCMAKE_BUILD_TYPE=Release"
"-DLLVM_TARGETS_TO_BUILD=all"
] ++ stdenv.lib.optionals (stdenv.gcc.libc != null) [
"-DC_INCLUDE_DIRS=${stdenv.gcc.libc}/include/"
];
enableParallelBuilding = true;
src = fetchurl {
url = "http://llvm.org/releases/${version}/clang-${version}.tar.gz";
sha256 = "0v8j9rgmb7w74ihc44zfxa22q17c946n5b6prwl38z3d6pd74kmn";
url = "http://llvm.org/releases/${version}/clang-${version}.src.tar.gz";
sha256 = "11m7sm9f8qcrayckfg3z91zb3fimilpm0f7azn7q7qnkvhay4qzz";
};
passthru = { gcc = stdenv.gcc.gcc; };