clang: Update to 3.3

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-06-21 19:50:56 -04:00
parent 9b502a9ae1
commit 6425ad2847
2 changed files with 70 additions and 45 deletions

View File

@ -1,8 +1,8 @@
diff -Naur clang-3.2.src-orig/lib/Driver/ToolChains.cpp clang-3.2.src/lib/Driver/ToolChains.cpp diff -Naur cfe-3.3.src-orig/lib/Driver/ToolChains.cpp cfe-3.3.src/lib/Driver/ToolChains.cpp
--- clang-3.2.src-orig/lib/Driver/ToolChains.cpp 2012-12-16 10:59:27.000000000 -0500 --- cfe-3.3.src-orig/lib/Driver/ToolChains.cpp 2013-05-06 12:26:41.000000000 -0400
+++ clang-3.2.src/lib/Driver/ToolChains.cpp 2013-01-22 14:16:55.787547681 -0500 +++ cfe-3.3.src/lib/Driver/ToolChains.cpp 2013-06-21 19:28:12.120364372 -0400
@@ -2153,16 +2153,6 @@ @@ -2318,17 +2318,6 @@
addPathIfExists(LibPath + "/../" + GCCTriple.str() + "/lib", Paths); Paths);
} }
} }
- addPathIfExists(SysRoot + "/lib/" + MultiarchTriple, Paths); - addPathIfExists(SysRoot + "/lib/" + MultiarchTriple, Paths);
@ -15,29 +15,30 @@ diff -Naur clang-3.2.src-orig/lib/Driver/ToolChains.cpp clang-3.2.src/lib/Driver
- if (GCCInstallation.isValid()) - if (GCCInstallation.isValid())
- addPathIfExists(SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() + - addPathIfExists(SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
- "/../../" + Multilib, Paths); - "/../../" + Multilib, Paths);
-
// Add the non-multilib suffixed paths (if potentially different). // Add the non-multilib suffixed paths (if potentially different).
if (GCCInstallation.isValid()) { if (GCCInstallation.isValid()) {
@@ -2176,8 +2166,6 @@ const std::string &LibPath = GCCInstallation.getParentLibPath();
@@ -2341,8 +2330,6 @@
addPathIfExists(LibPath, Paths); addPathIfExists(LibPath, Paths);
} }
} }
- addPathIfExists(SysRoot + "/lib", Paths); - addPathIfExists(SysRoot + "/lib", Paths);
- addPathIfExists(SysRoot + "/usr/lib", Paths); - addPathIfExists(SysRoot + "/usr/lib", Paths);
}
bool Linux::HasNativeLLVMSupport() const { IsPIEDefault = SanitizerArgs(*this, Args).hasZeroBaseShadow();
@@ -2228,9 +2216,6 @@ }
@@ -2395,9 +2382,6 @@
if (DriverArgs.hasArg(options::OPT_nostdinc)) if (DriverArgs.hasArg(options::OPT_nostdinc))
return; return;
- if (!DriverArgs.hasArg(options::OPT_nostdlibinc)) - if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
- addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/local/include"); - addSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/local/include");
- -
if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) { if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
llvm::sys::Path P(D.ResourceDir); llvm::sys::Path P(D.ResourceDir);
P.appendComponent("include"); P.appendComponent("include");
@@ -2295,24 +2280,6 @@ @@ -2479,26 +2463,6 @@
"/usr/include/powerpc64-linux-gnu" "/usr/include/powerpc64-linux-gnu"
}; };
ArrayRef<StringRef> MultiarchIncludeDirs; ArrayRef<StringRef> MultiarchIncludeDirs;
@ -45,6 +46,8 @@ diff -Naur clang-3.2.src-orig/lib/Driver/ToolChains.cpp clang-3.2.src/lib/Driver
- MultiarchIncludeDirs = X86_64MultiarchIncludeDirs; - MultiarchIncludeDirs = X86_64MultiarchIncludeDirs;
- } else if (getTriple().getArch() == llvm::Triple::x86) { - } else if (getTriple().getArch() == llvm::Triple::x86) {
- MultiarchIncludeDirs = X86MultiarchIncludeDirs; - MultiarchIncludeDirs = X86MultiarchIncludeDirs;
- } else if (getTriple().getArch() == llvm::Triple::aarch64) {
- MultiarchIncludeDirs = AArch64MultiarchIncludeDirs;
- } else if (getTriple().getArch() == llvm::Triple::arm) { - } else if (getTriple().getArch() == llvm::Triple::arm) {
- if (getTriple().getEnvironment() == llvm::Triple::GNUEABIHF) - if (getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
- MultiarchIncludeDirs = ARMHFMultiarchIncludeDirs; - MultiarchIncludeDirs = ARMHFMultiarchIncludeDirs;
@ -62,7 +65,7 @@ diff -Naur clang-3.2.src-orig/lib/Driver/ToolChains.cpp clang-3.2.src/lib/Driver
for (ArrayRef<StringRef>::iterator I = MultiarchIncludeDirs.begin(), for (ArrayRef<StringRef>::iterator I = MultiarchIncludeDirs.begin(),
E = MultiarchIncludeDirs.end(); E = MultiarchIncludeDirs.end();
I != E; ++I) { I != E; ++I) {
@@ -2324,13 +2291,6 @@ @@ -2510,13 +2474,6 @@
if (getTriple().getOS() == llvm::Triple::RTEMS) if (getTriple().getOS() == llvm::Triple::RTEMS)
return; return;
@ -70,24 +73,30 @@ diff -Naur clang-3.2.src-orig/lib/Driver/ToolChains.cpp clang-3.2.src/lib/Driver
- // Add an include of '/include' directly. This isn't provided by default by - // Add an include of '/include' directly. This isn't provided by default by
- // system GCCs, but is often used with cross-compiling GCCs, and harmless to - // system GCCs, but is often used with cross-compiling GCCs, and harmless to
- // add even when Clang is acting as-if it were a system compiler. - // add even when Clang is acting as-if it were a system compiler.
- addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include"); - addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/include");
- -
- addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/include"); - addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include");
} }
/// \brief Helper to add the thre variant paths for a libstdc++ installation. /// \brief Helper to add the three variant paths for a libstdc++ installation.
diff -Naur clang-3.2.src-orig/lib/Driver/Tools.cpp clang-3.2.src/lib/Driver/Tools.cpp diff -Naur cfe-3.3.src-orig/lib/Driver/Tools.cpp cfe-3.3.src/lib/Driver/Tools.cpp
--- clang-3.2.src-orig/lib/Driver/Tools.cpp 2012-11-21 02:56:23.000000000 -0500 --- cfe-3.3.src-orig/lib/Driver/Tools.cpp 2013-05-30 14:01:30.000000000 -0400
+++ clang-3.2.src/lib/Driver/Tools.cpp 2013-01-22 14:24:37.167212186 -0500 +++ cfe-3.3.src/lib/Driver/Tools.cpp 2013-06-21 19:30:51.604726574 -0400
@@ -5972,34 +5972,6 @@ @@ -5976,43 +5976,6 @@
ToolChain.getArch() == llvm::Triple::thumb || }
(!Args.hasArg(options::OPT_static) && }
!Args.hasArg(options::OPT_shared))) {
- if (ToolChain.getArch() == llvm::Triple::arm ||
- ToolChain.getArch() == llvm::Triple::thumb ||
- (!Args.hasArg(options::OPT_static) &&
- !Args.hasArg(options::OPT_shared))) {
- CmdArgs.push_back("-dynamic-linker"); - CmdArgs.push_back("-dynamic-linker");
- if (isAndroid) - if (isAndroid)
- CmdArgs.push_back("/system/bin/linker"); - CmdArgs.push_back("/system/bin/linker");
- else if (ToolChain.getArch() == llvm::Triple::x86) - else if (ToolChain.getArch() == llvm::Triple::x86)
- CmdArgs.push_back("/lib/ld-linux.so.2"); - CmdArgs.push_back("/lib/ld-linux.so.2");
- else if (ToolChain.getArch() == llvm::Triple::aarch64)
- CmdArgs.push_back("/lib/ld-linux-aarch64.so.1");
- else if (ToolChain.getArch() == llvm::Triple::arm || - else if (ToolChain.getArch() == llvm::Triple::arm ||
- ToolChain.getArch() == llvm::Triple::thumb) { - ToolChain.getArch() == llvm::Triple::thumb) {
- if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF) - if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
@ -107,31 +116,47 @@ diff -Naur clang-3.2.src-orig/lib/Driver/Tools.cpp clang-3.2.src/lib/Driver/Tool
- } - }
- else if (ToolChain.getArch() == llvm::Triple::ppc) - else if (ToolChain.getArch() == llvm::Triple::ppc)
- CmdArgs.push_back("/lib/ld.so.1"); - CmdArgs.push_back("/lib/ld.so.1");
- else if (ToolChain.getArch() == llvm::Triple::ppc64) - else if (ToolChain.getArch() == llvm::Triple::ppc64 ||
- ToolChain.getArch() == llvm::Triple::systemz)
- CmdArgs.push_back("/lib64/ld64.so.1"); - CmdArgs.push_back("/lib64/ld64.so.1");
- else - else
- CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2"); - CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2");
} - }
-
CmdArgs.push_back("-o"); CmdArgs.push_back("-o");
diff -Naur clang-3.2.src-orig/lib/Frontend/InitHeaderSearch.cpp clang-3.2.src/lib/Frontend/InitHeaderSearch.cpp CmdArgs.push_back(Output.getFilename());
--- clang-3.2.src-orig/lib/Frontend/InitHeaderSearch.cpp 2012-10-24 12:19:39.000000000 -0400
+++ clang-3.2.src/lib/Frontend/InitHeaderSearch.cpp 2013-01-22 14:20:32.803925775 -0500 diff -Naur cfe-3.3.src-orig/lib/Frontend/InitHeaderSearch.cpp cfe-3.3.src/lib/Frontend/InitHeaderSearch.cpp
@@ -221,8 +221,6 @@ --- cfe-3.3.src-orig/lib/Frontend/InitHeaderSearch.cpp 2013-04-29 21:21:43.000000000 -0400
case llvm::Triple::Bitrig: +++ cfe-3.3.src/lib/Frontend/InitHeaderSearch.cpp 2013-06-21 19:32:47.627016565 -0400
break; @@ -225,20 +225,6 @@
default: const HeaderSearchOptions &HSOpts) {
llvm::Triple::OSType os = triple.getOS();
- if (HSOpts.UseStandardSystemIncludes) {
- switch (os) {
- case llvm::Triple::FreeBSD:
- case llvm::Triple::NetBSD:
- case llvm::Triple::OpenBSD:
- case llvm::Triple::Bitrig:
- break;
- default:
- // FIXME: temporary hack: hard-coded paths. - // FIXME: temporary hack: hard-coded paths.
- AddPath("/usr/local/include", System, true, false, false); - AddPath("/usr/local/include", System, false);
break; - break;
} - }
} - }
@@ -330,8 +328,6 @@ -
// Builtin includes use #include_next directives and should be positioned
// just prior C include dirs.
if (HSOpts.UseBuiltinIncludes) {
@@ -332,9 +318,6 @@
default:
break; break;
} }
-
- if ( os != llvm::Triple::RTEMS ) - if ( os != llvm::Triple::RTEMS )
- AddPath("/usr/include", System, false, false, false); - AddPath("/usr/include", ExternCSystem, false);
} }
void InitHeaderSearch:: void InitHeaderSearch::

View File

@ -1,14 +1,14 @@
{ stdenv, fetchurl, perl, groff, llvm, cmake, libxml2 }: { stdenv, fetchurl, perl, groff, llvm, cmake, libxml2, python }:
let let
version = "3.2"; version = "3.3";
gccReal = if (stdenv.gcc.gcc or null) == null then stdenv.gcc else stdenv.gcc.gcc; gccReal = if (stdenv.gcc.gcc or null) == null then stdenv.gcc else stdenv.gcc.gcc;
in in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "clang-${version}"; name = "clang-${version}";
buildInputs = [ perl llvm groff cmake libxml2 ]; buildInputs = [ perl llvm groff cmake libxml2 python ];
patches = stdenv.lib.optional (stdenv.gcc.libc != null) ./clang-purity.patch; patches = stdenv.lib.optional (stdenv.gcc.libc != null) ./clang-purity.patch;
@ -24,8 +24,8 @@ stdenv.mkDerivation {
enableParallelBuilding = true; enableParallelBuilding = true;
src = fetchurl { src = fetchurl {
url = "http://llvm.org/releases/${version}/clang-${version}.src.tar.gz"; url = "http://llvm.org/releases/${version}/cfe-${version}.src.tar.gz";
sha256 = "0n2nzw3pw2v7fk67f2k2qyzd9wibvi3i5j7cjzz1csqgghzz1aia"; sha256 = "15mrvw43s4frk1j49qr4v5viq68h8qlf10qs6ghd6mrsmgj5vddi";
}; };
passthru = { gcc = stdenv.gcc.gcc; }; passthru = { gcc = stdenv.gcc.gcc; };