Update to 3.7.0, attempt 1

This commit is contained in:
Evgenii Shatokhin 2015-11-23 18:58:46 +03:00
parent 37c4f70eae
commit 6c24cc7432
12 changed files with 173 additions and 450 deletions

View file

@ -1,6 +1,6 @@
sources: sources:
clang-tools-extra-3.5.0.src.tar.xz: 74a84493e3313c180490a4affbb92d61ee4f0d21 cfe-3.7.0.src.tar.xz: 4ff8100565528b13d99a73f807e9b426c3b3bed9
polly-3.5.0.src.tar.xz: 74a2c80f12dc2645e4e77d330c8b7e0f53a5709c clang-tools-extra-3.7.0.src.tar.xz: 99a8c8e04936d37b711664539a1a2271a9663825
compiler-rt-3.5.0.src.tar.xz: 61f3e78088ce4a0787835036f2d3c61ede11e928 compiler-rt-3.7.0.src.tar.xz: b61362b409bb7909a6d11097b5f69fded061073c
llvm-3.5.0.src.tar.xz: 58d817ac2ff573386941e7735d30702fe71267d5 llvm-3.7.0.src.tar.xz: 0355c2fe01a8d17c3315069e6f2ef80c281e7dad
cfe-3.5.0.src.tar.xz: 834cee2ed8dc6638a486d8d886b6dce3db675ffa polly-3.7.0.src.tar.xz: 16851c89d56c18442e76ad657c260bb3619a6745

View file

@ -1,98 +1,114 @@
--- llvm-3.5/tools/clang/lib/Driver/ToolChains.cpp.mandriva~ 2014-08-22 22:54:39.000000000 +0200 --- clang/lib/Driver/ToolChains.cpp.mandriva~ 2015-06-26 20:37:15.000000000 +0200
+++ llvm-3.5/tools/clang/lib/Driver/ToolChains.cpp 2014-08-25 22:24:33.868906431 +0200 +++ clang/lib/Driver/ToolChains.cpp 2015-06-27 14:05:15.223881344 +0200
@@ -1315,16 +1315,43 @@ bool Generic_GCC::GCCInstallationDetecto @@ -1265,16 +1265,46 @@ bool Generic_GCC::GCCInstallationDetecto
static const char *const AArch64Triples[] = { "aarch64-none-linux-gnu", static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
"aarch64-linux-gnu", static const char *const AArch64Triples[] = {
"aarch64-linux-android", "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-linux-android",
- "aarch64-redhat-linux" }; - "aarch64-redhat-linux"};
- static const char *const AArch64beLibDirs[] = { "/lib" }; - static const char *const AArch64beLibDirs[] = {"/lib"};
+ "aarch64-redhat-linux", - static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu",
+ "aarch64-mandriva-linux-gnu", - "aarch64_be-linux-gnu"};
+ "aarch64-openmandriva-linux-gnu" }; + "aarch64-redhat-linux", "aarch64-mandriva-linux-gnu",
+ static const char *const AArch64beLibDirs[] = { "/lib64", "/lib" }; + "aarch64-openmandriva-linux-gnu", "aarch64-openmandriva-linux-musl"};
static const char *const AArch64beTriples[] = { "aarch64_be-none-linux-gnu", + static const char *const AArch64beLibDirs[] = {"/lib64", "/lib"};
- "aarch64_be-linux-gnu" }; + static const char *const AArch64beTriples[] = {
+ "aarch64_be-linux-gnu", + "aarch64_be-none-linux-gnu", "aarch64_be-linux-gnu",
+ "aarch64_be-linux-android", + "aarch64_be-linux-android", "aarch64_be-mandriva-linux-gnu",
+ "aarch64_be-mandriva-linux-gnu", + "aarch64_be-openmandriva-linux-gnu", "aarch64_be-openmandriva-linux-musl"
+ "aarch64_be-openmandriva-linux-gnu" }; + };
static const char *const ARMLibDirs[] = { "/lib" }; static const char *const ARMLibDirs[] = {"/lib"};
static const char *const ARMTriples[] = { "arm-linux-gnueabi", static const char *const ARMTriples[] = {"arm-linux-gnueabi",
- "arm-linux-androideabi" }; - "arm-linux-androideabi"};
+ "arm-linux-androideabi", - static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+ "arm-mandriva-linux-gnueabi", - "armv7hl-redhat-linux-gnueabi"};
+ "arm-openmandriva-linux-gnueabi", + "arm-linux-androideabi",
+ "armv6-mandriva-linux-gnueabi", + "arm-mandriva-linux-gnueabi",
+ "armv6-openmandriva-linux-gnueabi", + "arm-openmandriva-linux-gnueabi",
+ "armv7-mandriva-linux-gnueabi", + "arm-openmandriva-linux-musl",
+ "armv7-openmandriva-linux-gnueabi" }; + "arm-openmandriva-linux-musleabi",
static const char *const ARMHFTriples[] = { "arm-linux-gnueabihf", + "armv6-mandriva-linux-gnueabi",
- "armv7hl-redhat-linux-gnueabi" }; + "armv6-openmandriva-linux-gnueabi",
+ "armv7hl-redhat-linux-gnueabi", + "armv7-mandriva-linux-gnueabi",
+ "arm-mandriva-linux-gnueabihf", + "armv7-openmandriva-linux-gnueabi",
+ "arm-openmandriva-linux-gnueabihf", + "armv7-openmandriva-linux-musleabi"};
+ "arm-mandriva-linux-gnueabihf", + static const char *const ARMHFTriples[] = {
+ "arm-openmandriva-linux-gnueabihf", + "arm-linux-gnueabihf",
+ "armv6-mandriva-linux-gnueabihf", + "armv7hl-redhat-linux-gnueabi",
+ "armv6-openmandriva-linux-gnueabihf", + "arm-mandriva-linux-gnueabihf",
+ "armv7-mandriva-linux-gnueabihf", + "arm-openmandriva-linux-gnueabihf",
+ "armv7-openmandriva-linux-gnueabihf", + "arm-openmandriva-linux-musleabihf",
+ "armv6hl-mandriva-linux-gnueabi", + "armv7hl-openmandriva-linux-gnueabi",
+ "armv6hl-openmandriva-linux-gnueabi", + "armv7hl-openmandriva-linux-gnueabihf",
+ "armv7hl-mandriva-linux-gnueabi", + "armv7hnl-openmandriva-linux-gnueabi",
+ "armv7hl-openmandriva-linux-gnueabi", + "armv7hnl-openmandriva-linux-musleabi",
+ "armv6hl-mandriva-linux-gnueabihf", + "armv7nl-openmandriva-linux-gnueabihf",
+ "armv6hl-openmandriva-linux-gnueabihf", + "armv7nl-openmandriva-linux-musleabihf",
+ "armv7hl-mandriva-linux-gnueabihf", + "armv6hl-openmandriva-linux-gnueabi",
+ "armv7hl-openmandriva-linux-gnueabihf" }; + "armv6hl-openmandriva-linux-gnueabihf",
static const char *const ARMebLibDirs[] = { "/lib" }; + "armv6hnl-openmandriva-linux-gnueabi",
static const char *const ARMebTriples[] = { "armeb-linux-gnueabi", + "armv6hnl-openmandriva-linux-musleabi",
"armeb-linux-androideabi" }; + "armv6nl-openmandriva-linux-gnueabihf",
@@ -1336,7 +1363,7 @@ bool Generic_GCC::GCCInstallationDetecto + "armv6nl-openmandriva-linux-musleabihf"
"x86_64-linux-gnu", "x86_64-unknown-linux-gnu", "x86_64-pc-linux-gnu", + };
"x86_64-redhat-linux6E", "x86_64-redhat-linux", "x86_64-suse-linux", static const char *const ARMebLibDirs[] = {"/lib"};
"x86_64-manbo-linux-gnu", "x86_64-linux-gnu", "x86_64-slackware-linux", static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
- "x86_64-linux-android", "x86_64-unknown-linux" "armeb-linux-androideabi"};
+ "x86_64-linux-android", "x86_64-unknown-linux", "x86_64-mandriva-linux-gnu" @@ -1288,7 +1318,9 @@ bool Generic_GCC::GCCInstallationDetecto
}; "x86_64-redhat-linux", "x86_64-suse-linux",
static const char *const X32LibDirs[] = { "/libx32" }; "x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
static const char *const X86LibDirs[] = { "/lib32", "/lib" }; "x86_64-slackware-linux", "x86_64-linux-android",
@@ -1344,6 +1371,7 @@ bool Generic_GCC::GCCInstallationDetecto - "x86_64-unknown-linux"};
"i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu", "i386-linux-gnu", + "x86_64-unknown-linux", "x86_64-mandriva-linux-gnu",
"i386-redhat-linux6E", "i686-redhat-linux", "i586-redhat-linux", + "x86_64-openmandriva-linux-gnu",
"i386-redhat-linux", "i586-suse-linux", "i486-slackware-linux", + "x86_64-openmandriva-linux-musl"};
+ "i586-mandriva-linux-gnu", "i686-mandriva-linux-gnu", static const char *const X32LibDirs[] = {"/libx32"};
"i686-montavista-linux", "i686-linux-android", "i586-linux-gnu" static const char *const X86LibDirs[] = {"/lib32", "/lib"};
}; static const char *const X86Triples[] = {
@@ -1296,7 +1328,15 @@ bool Generic_GCC::GCCInstallationDetecto
"i386-linux-gnu", "i386-redhat-linux6E", "i686-redhat-linux",
"i586-redhat-linux", "i386-redhat-linux", "i586-suse-linux",
"i486-slackware-linux", "i686-montavista-linux", "i686-linux-android",
- "i586-linux-gnu"};
+ "i586-linux-gnu", "i586-mandriva-linux", "i586-mandriva-linux-gnu",
+ "i686-mandriva-linux", "i686-mandriva-linux-gnu",
+ "i586-openmandriva-linux",
+ "i586-openmandriva-linux-gnu",
+ "i586-openmandriva-linux-musl",
+ "i686-openmandriva-linux",
+ "i686-openmandriva-linux-gnu",
+ "i686-openmandriva-linux-musl"
+ };
@@ -1371,12 +1399,13 @@ bool Generic_GCC::GCCInstallationDetecto static const char *const MIPSLibDirs[] = {"/lib"};
static const char *const PPCLibDirs[] = { "/lib32", "/lib" }; static const char *const MIPSTriples[] = {
@@ -1317,11 +1357,12 @@ bool Generic_GCC::GCCInstallationDetecto
static const char *const PPCLibDirs[] = {"/lib32", "/lib"};
static const char *const PPCTriples[] = { static const char *const PPCTriples[] = {
"powerpc-linux-gnu", "powerpc-unknown-linux-gnu", "powerpc-linux-gnuspe", "powerpc-linux-gnu", "powerpc-unknown-linux-gnu", "powerpc-linux-gnuspe",
- "powerpc-suse-linux", "powerpc-montavista-linuxspe" - "powerpc-suse-linux", "powerpc-montavista-linuxspe"};
+ "powerpc-suse-linux", "powerpc-montavista-linuxspe", "powerpc-mandriva-linux-gnu" + "powerpc-suse-linux", "powerpc-montavista-linuxspe",
}; + "powerpc-mandriva-linux-gnu"};
static const char *const PPC64LibDirs[] = { "/lib64", "/lib" }; static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
static const char *const PPC64Triples[] = { "powerpc64-linux-gnu", static const char *const PPC64Triples[] = {
"powerpc64-unknown-linux-gnu", "powerpc64-linux-gnu", "powerpc64-unknown-linux-gnu",
"powerpc64-suse-linux", - "powerpc64-suse-linux", "ppc64-redhat-linux"};
+ "powerpc64-mandriva-linux", + "powerpc64-suse-linux", "ppc64-redhat-linux", "powerpc64-mandriva-linux"};
"ppc64-redhat-linux" }; static const char *const PPC64LELibDirs[] = {"/lib64", "/lib"};
static const char *const PPC64LELibDirs[] = { "/lib64", "/lib" }; static const char *const PPC64LETriples[] = {
static const char *const PPC64LETriples[] = { "powerpc64le-linux-gnu", "powerpc64le-linux-gnu", "powerpc64le-unknown-linux-gnu",
@@ -2801,6 +2830,9 @@ enum Distro { @@ -2864,6 +2905,9 @@ enum Distro {
UbuntuRaring, UbuntuUtopic,
UbuntuSaucy, UbuntuVivid,
UbuntuTrusty, UbuntuWily,
+ Mandriva, + Mandriva,
+ OpenMandriva, + OpenMandriva,
+ ROSA, + ROSA,
UnknownDistro UnknownDistro
}; };
@@ -2820,6 +2852,10 @@ static bool IsUbuntu(enum Distro Distro) @@ -2881,6 +2925,10 @@ static bool IsUbuntu(enum Distro Distro)
return Distro >= UbuntuHardy && Distro <= UbuntuTrusty; return Distro >= UbuntuHardy && Distro <= UbuntuWily;
} }
+static bool IsMandriva(enum Distro Distro) { +static bool IsMandriva(enum Distro Distro) {
@ -102,35 +118,34 @@
static Distro DetectDistro(llvm::Triple::ArchType Arch) { static Distro DetectDistro(llvm::Triple::ArchType Arch) {
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File = llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
llvm::MemoryBuffer::getFile("/etc/lsb-release"); llvm::MemoryBuffer::getFile("/etc/lsb-release");
@@ -2828,7 +2864,18 @@ static Distro DetectDistro(llvm::Triple: @@ -2889,7 +2937,17 @@ static Distro DetectDistro(llvm::Triple:
SmallVector<StringRef, 8> Lines; SmallVector<StringRef, 16> Lines;
Data.split(Lines, "\n"); Data.split(Lines, "\n");
Distro Version = UnknownDistro; Distro Version = UnknownDistro;
- for (unsigned i = 0, s = Lines.size(); i != s; ++i) - for (const StringRef Line : Lines)
+ for (unsigned i = 0, s = Lines.size(); i != s; ++i) { + for (const StringRef Line : Lines) {
+ if (Version == UnknownDistro && + if (Version == UnknownDistro && Line.startswith("DISTRIB_ID=MandrivaLinux"))
+ Lines[i].startswith("DISTRIB_ID=MandrivaLinux"))
+ // It's either Mandriva or a close derivate, will get details + // It's either Mandriva or a close derivate, will get details
+ // from DISTRIB_DESCRIPTION + // from DISTRIB_DESCRIPTION
+ Version = Mandriva; + Version = Mandriva;
+ if (Version == Mandriva && Lines[i].startswith("DISTRIB_DESCRIPTION=")) { + if (Version == Mandriva && Line.startswith("DISTRIB_DESCRIPTION=")) {
+ if(Lines[i].substr(20).find("ROSA") != StringRef::npos) + if(Line.substr(20).find("ROSA") != StringRef::npos)
+ Version = ROSA; + Version = ROSA;
+ else if(Lines[i].substr(20).find("Open") != StringRef::npos) + else if(Line.substr(20).find("Open") != StringRef::npos)
+ Version = OpenMandriva; + Version = OpenMandriva;
+ } + }
if (Version == UnknownDistro && Lines[i].startswith("DISTRIB_CODENAME=")) if (Version == UnknownDistro && Line.startswith("DISTRIB_CODENAME="))
Version = llvm::StringSwitch<Distro>(Lines[i].substr(17)) Version = llvm::StringSwitch<Distro>(Line.substr(17))
.Case("hardy", UbuntuHardy) .Case("hardy", UbuntuHardy)
@@ -2845,6 +2892,7 @@ static Distro DetectDistro(llvm::Triple: @@ -2908,6 +2966,7 @@ static Distro DetectDistro(llvm::Triple:
.Case("saucy", UbuntuSaucy) .Case("vivid", UbuntuVivid)
.Case("trusty", UbuntuTrusty) .Case("wily", UbuntuWily)
.Default(UnknownDistro); .Default(UnknownDistro);
+ } + }
return Version; return Version;
} }
@@ -3005,11 +3053,16 @@ static StringRef getOSLibDir(const llvm: @@ -3083,11 +3142,16 @@ static StringRef getOSLibDir(const llvm:
// with a 'lib32' library search path being considered. So we only enable // with a 'lib32' library search path being considered. So we only enable
// them when we know we may need it. // them when we know we may need it.
// //
@ -149,7 +164,7 @@
return "lib32"; return "lib32";
if (Triple.getArch() == llvm::Triple::x86_64 && if (Triple.getArch() == llvm::Triple::x86_64 &&
@@ -3042,7 +3095,7 @@ Linux::Linux(const Driver &D, const llvm @@ -3121,7 +3185,7 @@ Linux::Linux(const Driver &D, const llvm
Distro Distro = DetectDistro(Arch); Distro Distro = DetectDistro(Arch);
@ -158,7 +173,7 @@
ExtraOpts.push_back("-z"); ExtraOpts.push_back("-z");
ExtraOpts.push_back("relro"); ExtraOpts.push_back("relro");
} }
@@ -3062,7 +3115,7 @@ Linux::Linux(const Driver &D, const llvm @@ -3141,7 +3205,7 @@ Linux::Linux(const Driver &D, const llvm
// ABI requires a mapping between the GOT and the symbol table. // ABI requires a mapping between the GOT and the symbol table.
// Android loader does not support .gnu.hash. // Android loader does not support .gnu.hash.
if (!IsMips && !IsAndroid) { if (!IsMips && !IsAndroid) {
@ -167,12 +182,12 @@
(IsUbuntu(Distro) && Distro >= UbuntuMaverick)) (IsUbuntu(Distro) && Distro >= UbuntuMaverick))
ExtraOpts.push_back("--hash-style=gnu"); ExtraOpts.push_back("--hash-style=gnu");
@@ -3075,12 +3128,12 @@ Linux::Linux(const Driver &D, const llvm @@ -3153,12 +3217,12 @@ Linux::Linux(const Driver &D, const llvm
if (IsRedhat(Distro))
ExtraOpts.push_back("--no-add-needed"); ExtraOpts.push_back("--no-add-needed");
if (Distro == DebianSqueeze || Distro == DebianWheezy || - if ((IsDebian(Distro) && Distro >= DebianSqueeze) || IsOpenSUSE(Distro) ||
- Distro == DebianJessie || IsOpenSUSE(Distro) || + if ((IsDebian(Distro) && Distro >= DebianSqueeze) || IsOpenSUSE(Distro) || IsMandriva(Distro) ||
+ Distro == DebianJessie || IsOpenSUSE(Distro) || IsMandriva(Distro) ||
(IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) || (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
(IsUbuntu(Distro) && Distro >= UbuntuKarmic)) (IsUbuntu(Distro) && Distro >= UbuntuKarmic))
ExtraOpts.push_back("--build-id"); ExtraOpts.push_back("--build-id");

View file

@ -1,56 +0,0 @@
From 37aee898ae3a8041aad2a7cc595b8a6cf7438b52 Mon Sep 17 00:00:00 2001
From: Tim Murray <timmurray@google.com>
Date: Thu, 3 Apr 2014 11:14:41 -0700
Subject: [PATCH 04/15] Add support for 64-bit longs.
Change-Id: I7d50c91b8324fa81c29595a8dc19f2180653a4f2
---
lib/Target/ARM/ARM.td | 4 ++++
lib/Target/ARM/ARMSubtarget.cpp | 1 +
lib/Target/ARM/ARMSubtarget.h | 3 +++
3 files changed, 8 insertions(+)
diff --git a/lib/Target/ARM/ARM.td b/lib/Target/ARM/ARM.td
index 7916ccc..25385a6 100644
--- a/lib/Target/ARM/ARM.td
+++ b/lib/Target/ARM/ARM.td
@@ -267,6 +267,10 @@ def FeatureAPCS : SubtargetFeature<"apcs", "TargetABI", "ARM_ABI_APCS",
def FeatureAAPCS : SubtargetFeature<"aapcs", "TargetABI", "ARM_ABI_AAPCS",
"Use the AAPCS ABI">;
+// RenderScript-specific support for 64-bit long types on all targets
+def FeatureLong64 : SubtargetFeature<"long64", "UseLong64",
+ "true",
+ "long type is forced to be 64-bit">;
class ProcNoItin<string Name, list<SubtargetFeature> Features>
: Processor<Name, NoItineraries, Features>;
diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp
index 5222c1b..73e2018 100644
--- a/lib/Target/ARM/ARMSubtarget.cpp
+++ b/lib/Target/ARM/ARMSubtarget.cpp
@@ -139,6 +139,7 @@ void ARMSubtarget::initializeEnvironment() {
Thumb2DSP = false;
UseNaClTrap = false;
UnsafeFPMath = false;
+ UseLong64 = false;
}
void ARMSubtarget::resetSubtargetFeatures(const MachineFunction *MF) {
diff --git a/lib/Target/ARM/ARMSubtarget.h b/lib/Target/ARM/ARMSubtarget.h
index 804f238..3855419 100644
--- a/lib/Target/ARM/ARMSubtarget.h
+++ b/lib/Target/ARM/ARMSubtarget.h
@@ -197,6 +197,9 @@ protected:
/// NaCl TRAP instruction is generated instead of the regular TRAP.
bool UseNaClTrap;
+ /// Force long to be a 64-bit type (RenderScript-specific)
+ bool UseLong64;
+
/// Target machine allowed unsafe FP math (such as use of NEON fp)
bool UnsafeFPMath;
--
1.9.0

View file

@ -1,11 +0,0 @@
--- llvm-3.5/lib/CodeGen/GlobalMerge.cpp.EnableGlobalMerge~ 2014-06-19 15:03:05.515698194 +0200
+++ llvm-3.5/lib/CodeGen/GlobalMerge.cpp 2014-06-19 15:03:46.846698327 +0200
@@ -72,7 +72,7 @@ using namespace llvm;
#define DEBUG_TYPE "global-merge"
-static cl::opt<bool>
+cl::opt<bool>
EnableGlobalMerge("enable-global-merge", cl::Hidden,
cl::desc("Enable global merge pass"),
cl::init(true));

View file

@ -1,39 +0,0 @@
--- llvm-3.5/tools/clang/include/clang/Driver/Options.td.fuseLd~ 2014-08-22 22:54:39.000000000 +0200
+++ llvm-3.5/tools/clang/include/clang/Driver/Options.td 2014-08-25 22:26:24.253526434 +0200
@@ -533,6 +533,7 @@ def funsafe_math_optimizations : Flag<["
Group<f_Group>;
def fno_unsafe_math_optimizations : Flag<["-"], "fno-unsafe-math-optimizations">,
Group<f_Group>;
+def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>;
def fassociative_math : Flag<["-"], "fassociative-math">, Group<f_Group>;
def fno_associative_math : Flag<["-"], "fno-associative-math">, Group<f_Group>;
def freciprocal_math : Flag<["-"], "freciprocal-math">, Group<f_Group>;
@@ -1597,7 +1598,6 @@ def fprofile_dir : Joined<["-"], "fprofi
defm profile_use : BooleanFFlag<"profile-use">, Group<clang_ignored_gcc_optimization_f_Group>;
def fprofile_use_EQ : Joined<["-"], "fprofile-use=">, Group<clang_ignored_gcc_optimization_f_Group>;
-def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>;
defm align_functions : BooleanFFlag<"align-functions">, Group<clang_ignored_gcc_optimization_f_Group>;
def falign_functions_EQ : Joined<["-"], "falign-functions=">, Group<clang_ignored_gcc_optimization_f_Group>;
--- llvm-3.5/tools/clang/lib/Driver/ToolChain.cpp.fuseLd~ 2014-08-22 22:54:39.000000000 +0200
+++ llvm-3.5/tools/clang/lib/Driver/ToolChain.cpp 2014-08-25 22:25:41.383062388 +0200
@@ -145,6 +145,18 @@ std::string ToolChain::GetFilePath(const
}
std::string ToolChain::GetProgramPath(const char *Name) const {
+ if(!strcmp(Name, "ld")) {
+ // Handle -fuse-ld=XXX the way gcc does
+ if (Arg *A = Args.getLastArg(options::OPT_fuse_ld_EQ)) {
+ StringRef Value = A->getValue();
+ if(Value.empty())
+ return D.GetProgramPath(Name, *this);
+ const char *suffix = Value.str().c_str();
+ char *newName = (char *) alloca(strlen(Name) + strlen(suffix) + 2);
+ sprintf(newName, "%s.%s", Name, suffix);
+ return D.GetProgramPath(newName, *this);
+ }
+ }
return D.GetProgramPath(Name, *this);
}

View file

@ -9,17 +9,6 @@
return false; return false;
} }
--- llvm-3.5/tools/clang/lib/Driver/Tools.cpp.gcc49~ 2014-08-22 22:54:39.000000000 +0200
+++ llvm-3.5/tools/clang/lib/Driver/Tools.cpp 2014-08-25 22:24:57.689608632 +0200
@@ -6249,7 +6249,7 @@ void openbsd::Link::ConstructJob(Compila
if (Triple.substr(0, 6) == "x86_64")
Triple.replace(0, 6, "amd64");
CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc-lib/" + Triple +
- "/4.2.1"));
+ "/4.9.1"));
Args.AddAllArgs(CmdArgs, options::OPT_L);
Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
--- llvm-3.5/tools/clang/lib/Frontend/InitPreprocessor.cpp.gcc49~ 2014-08-22 22:54:39.000000000 +0200 --- llvm-3.5/tools/clang/lib/Frontend/InitPreprocessor.cpp.gcc49~ 2014-08-22 22:54:39.000000000 +0200
+++ llvm-3.5/tools/clang/lib/Frontend/InitPreprocessor.cpp 2014-08-25 22:24:57.689608632 +0200 +++ llvm-3.5/tools/clang/lib/Frontend/InitPreprocessor.cpp 2014-08-25 22:24:57.689608632 +0200
@@ -462,9 +462,9 @@ static void InitializePredefinedMacros(c @@ -462,9 +462,9 @@ static void InitializePredefinedMacros(c
@ -68,3 +57,14 @@
// SPARC:#define __WCHAR_MAX__ 2147483647 // SPARC:#define __WCHAR_MAX__ 2147483647
// SPARC:#define __WCHAR_TYPE__ int // SPARC:#define __WCHAR_TYPE__ int
// SPARC:#define __WCHAR_WIDTH__ 32 // SPARC:#define __WCHAR_WIDTH__ 32
--- llvm-3.6.0.src/include/llvm/Support/Compiler.h.omv~ 2014-10-28 18:09:47.260731249 +0100
+++ llvm-3.6.0.src/include/llvm/Support/Compiler.h 2014-10-28 18:09:59.930572854 +0100
@@ -288,7 +288,7 @@
/// \macro LLVM_ASSUME_ALIGNED
/// \brief Returns a pointer with an assumed alignment.
-#if __has_builtin(__builtin_assume_aligned) || LLVM_GNUC_PREREQ(4, 7, 0)
+#if __has_builtin(__builtin_assume_aligned) || (!defined(__clang__) && LLVM_GNUC_PREREQ(4, 7, 0))
# define LLVM_ASSUME_ALIGNED(p, a) __builtin_assume_aligned(p, a)
#elif defined(LLVM_BUILTIN_UNREACHABLE)
// As of today, clang does not support __builtin_assume_aligned.

View file

@ -1,26 +0,0 @@
--- llvm-3.5/tools/clang/lib/Driver/Tools.cpp.armhf 2014-05-05 13:42:31.046661612 +0200
+++ llvm-3.5/tools/clang/lib/Driver/Tools.cpp 2014-05-05 13:44:21.643278964 +0200
@@ -626,7 +626,7 @@ StringRef tools::arm::getARMFloatABI(con
if (FloatABI != "soft" && FloatABI != "softfp" && FloatABI != "hard") {
D.Diag(diag::err_drv_invalid_mfloat_abi)
<< A->getAsString(Args);
- FloatABI = "soft";
+ FloatABI = "hard";
}
}
}
@@ -692,11 +692,11 @@ StringRef tools::arm::getARMFloatABI(con
break;
}
default:
- // Assume "soft", but warn the user we are guessing.
- FloatABI = "soft";
+ // Assume "hard", but warn the user we are guessing.
+ FloatABI = "hard";
if (Triple.getOS() != llvm::Triple::UnknownOS ||
!Triple.isOSBinFormatMachO())
- D.Diag(diag::warn_drv_assuming_mfloat_abi_is) << "soft";
+ D.Diag(diag::warn_drv_assuming_mfloat_abi_is) << "hard";
break;
}
}

View file

@ -5,7 +5,7 @@
# Add soname to the library. # Add soname to the library.
ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU GNU/kFreeBSD)) ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU GNU/kFreeBSD))
- LLVMLibsOptions += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT) - LLVMLibsOptions += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT)
+ LLVMLibsOptions += -Wl,-soname,lib$(LIBRARYNAME)-$(LLVM_VERSION_MAJOR).$(LLVM_VERSION_MINOR)$(SHLIBEXT) + LLVMLibsOptions += -Wl,-soname,lib$(LIBRARYNAME)-$(LLVMVersion)$(SHLIBEXT)
endif endif
ifeq ($(ENABLE_CLANG_ARCMT),1) ifeq ($(ENABLE_CLANG_ARCMT),1)

View file

@ -1,92 +0,0 @@
--- llvm-3.5.0.src/lib/Support/Triple.cpp.detectHardfloat~ 2014-07-18 16:28:19.000000000 +0200
+++ llvm-3.5.0.src/lib/Support/Triple.cpp 2014-09-05 22:24:04.378819536 +0200
@@ -335,8 +335,8 @@ static Triple::OSType parseOS(StringRef
.Default(Triple::UnknownOS);
}
-static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
- return StringSwitch<Triple::EnvironmentType>(EnvironmentName)
+static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName, StringRef ArchName, StringRef VendorName) {
+ Triple::EnvironmentType t = StringSwitch<Triple::EnvironmentType>(EnvironmentName)
.StartsWith("eabihf", Triple::EABIHF)
.StartsWith("eabi", Triple::EABI)
.StartsWith("gnueabihf", Triple::GNUEABIHF)
@@ -349,6 +349,15 @@ static Triple::EnvironmentType parseEnvi
.StartsWith("itanium", Triple::Itanium)
.StartsWith("cygnus", Triple::Cygnus)
.Default(Triple::UnknownEnvironment);
+ if(t == Triple::GNUEABI) {
+ // There's some special cases where -gnueabi actually means
+ // GNUEABIHF, such as
+ // armv7hl-linux-gnueabi (Fedora) and
+ // armv7a-hardfloat-linux-gnueabi (Gentoo)
+ if(ArchName.find('h') != StringRef::npos || VendorName.equals("hardfloat"))
+ return Triple::GNUEABIHF;
+ }
+ return t;
}
static Triple::ObjectFormatType parseFormat(StringRef EnvironmentName) {
@@ -409,7 +418,7 @@ Triple::Triple(const Twine &Str)
SubArch(parseSubArch(getArchName())),
Vendor(parseVendor(getVendorName())),
OS(parseOS(getOSName())),
- Environment(parseEnvironment(getEnvironmentName())),
+ Environment(parseEnvironment(getEnvironmentName(), getArchName(), getVendorName())),
ObjectFormat(parseFormat(getEnvironmentName())) {
if (ObjectFormat == Triple::UnknownObjectFormat)
ObjectFormat = getDefaultFormat(*this);
@@ -444,7 +453,7 @@ Triple::Triple(const Twine &ArchStr, con
SubArch(parseSubArch(ArchStr.str())),
Vendor(parseVendor(VendorStr.str())),
OS(parseOS(OSStr.str())),
- Environment(parseEnvironment(EnvironmentStr.str())),
+ Environment(parseEnvironment(EnvironmentStr.str(), ArchStr.str(), VendorStr.str())),
ObjectFormat(parseFormat(EnvironmentStr.str())) {
if (ObjectFormat == Triple::UnknownObjectFormat)
ObjectFormat = getDefaultFormat(*this);
@@ -471,7 +480,7 @@ std::string Triple::normalize(StringRef
OS = parseOS(Components[2]);
EnvironmentType Environment = UnknownEnvironment;
if (Components.size() > 3)
- Environment = parseEnvironment(Components[3]);
+ Environment = parseEnvironment(Components[3], Components[0], Components[1]);
ObjectFormatType ObjectFormat = UnknownObjectFormat;
if (Components.size() > 4)
ObjectFormat = parseFormat(Components[4]);
@@ -514,7 +523,7 @@ std::string Triple::normalize(StringRef
Valid = OS != UnknownOS;
break;
case 3:
- Environment = parseEnvironment(Comp);
+ Environment = parseEnvironment(Comp, Components[0], Components[1]);
Valid = Environment != UnknownEnvironment;
if (!Valid) {
ObjectFormat = parseFormat(Comp);
--- llvm-3.5.0.src/tools/clang/lib/Driver/Tools.cpp.detectHardfloat~ 2014-09-05 22:22:15.101354343 +0200
+++ llvm-3.5.0.src/tools/clang/lib/Driver/Tools.cpp 2014-09-05 22:22:15.104687701 +0200
@@ -635,7 +635,7 @@ StringRef tools::arm::getARMFloatABI(con
FloatABI = "hard";
break;
case llvm::Triple::GNUEABI:
- FloatABI = "softfp";
+ FloatABI = (Triple.getVendorName().equals("hardfloat") || Triple.getArchName().find('h')!=StringRef::npos) ? "hard" : "softfp";
break;
case llvm::Triple::EABIHF:
FloatABI = "hard";
@@ -7197,13 +7197,13 @@ static StringRef getLinuxDynamicLinker(c
return "/lib/ld-linux-aarch64_be.so.1";
else if (ToolChain.getArch() == llvm::Triple::arm ||
ToolChain.getArch() == llvm::Triple::thumb) {
- if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
+ if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF || (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABI && (ToolChain.getTriple().getVendorName().equals("hardfloat") || ToolChain.getTriple().getArchName().find('h')!=StringRef::npos)))
return "/lib/ld-linux-armhf.so.3";
else
return "/lib/ld-linux.so.3";
} else if (ToolChain.getArch() == llvm::Triple::armeb ||
ToolChain.getArch() == llvm::Triple::thumbeb) {
- if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
+ if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF || (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABI && (ToolChain.getTriple().getVendorName().equals("hardfloat") || ToolChain.getTriple().getArchName().find('h')!=StringRef::npos)))
return "/lib/ld-linux-armhf.so.3"; /* TODO: check which dynamic linker name. */
else
return "/lib/ld-linux.so.3"; /* TODO: check which dynamic linker name. */

View file

@ -1,43 +0,0 @@
commit 080fb498017d17af2e4d7563608c7d8a848f20da
Author: Sanjoy Das <sanjoy at azulsystems.com>
Date: Thu Jun 19 15:38:02 2014 -0700
Fix the --enable-shared build.
Currently a build configured with ./configure --enable-shared breaks
with an undefined "llvm::cl::parser<llvm::PassInfo
const*>::getOption(unsigned int) const" symbol when linking opt. This
body for this symbol gets emitted into Pass.o (along with the destructor
for PassNameParser), but gets linked into libLLVM-3.5svn.so with local
visibility, causing the link error.
This fix uses the existing EXTERN_TEMPLATE machinery to force a globally
visible definition for the functions in parser<const PassInfo *> into
Pass.o.
diff --git a/include/llvm/IR/LegacyPassNameParser.h b/include/llvm/IR/LegacyPassNameParser.h
index e2e4912..a07e3fd 100644
--- a/include/llvm/IR/LegacyPassNameParser.h
+++ b/include/llvm/IR/LegacyPassNameParser.h
@@ -95,6 +95,8 @@ private:
}
};
+EXTERN_TEMPLATE_INSTANTIATION(class cl::parser<const PassInfo *>);
+
///===----------------------------------------------------------------------===//
/// FilteredPassNameParser class - Make use of the pass registration
/// mechanism to automatically add a command line argument to opt for
diff --git a/lib/IR/Pass.cpp b/lib/IR/Pass.cpp
index 91d86ae..00ce223 100644
--- a/lib/IR/Pass.cpp
+++ b/lib/IR/Pass.cpp
@@ -234,6 +234,8 @@ PassNameParser::~PassNameParser() {
// attempting to remove the registration listener is an error.
}
+TEMPLATE_INSTANTIATION(class cl::parser<const PassInfo *>);
+
//===----------------------------------------------------------------------===//
// AnalysisUsage Class Implementation
//

View file

@ -1,14 +0,0 @@
--- llvm-3.5/tools/clang/lib/Driver/Tools.cpp.omv~ 2014-05-26 20:50:58.405041023 +0200
+++ llvm-3.5/tools/clang/lib/Driver/Tools.cpp 2014-05-26 20:54:00.388516198 +0200
@@ -1391,7 +1391,11 @@ static void AddGoldPlugin(const ToolChai
// as gold requires -plugin to come before any -plugin-opt that -Wl might
// forward.
CmdArgs.push_back("-plugin");
+#if defined(__x86_64__) || defined(__aarch64__)
+ std::string Plugin = ToolChain.getDriver().Dir + "/../lib64/LLVMgold.so";
+#else
std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
+#endif
CmdArgs.push_back(Args.MakeArgString(Plugin));
// Try to pass driver level flags relevant to LTO code generation down to

View file

@ -10,13 +10,13 @@
%bcond_without clang %bcond_without clang
%bcond_with ocaml %bcond_with ocaml
%define major_ver 3.5 %define major_ver 3.7
%define minor_ver 0 %define minor_ver 0
Summary: Low Level Virtual Machine (LLVM) Summary: Low Level Virtual Machine (LLVM)
Name: llvm Name: llvm
Version: %{major_ver}.%{minor_ver} Version: %{major_ver}.%{minor_ver}
Release: 4 Release: 1
License: NCSA License: NCSA
Group: Development/Other Group: Development/Other
Url: http://llvm.org/ Url: http://llvm.org/
@ -35,24 +35,9 @@ Source1000: llvm.rpmlintrc
Patch0: clang-soname.patch Patch0: clang-soname.patch
# Adjust search paths to match the OS # Adjust search paths to match the OS
Patch1: 0000-clang-mandriva.patch Patch1: 0000-clang-mandriva.patch
# ARM hardfloat hack
# see http://llvm.org/bugs/show_bug.cgi?id=15557
# and https://bugzilla.redhat.com/show_bug.cgi?id=803433
Patch2: clang-hardfloat-hack.patch
# Locate LLVMgold.so on 64bit systems too
Patch3: llvm-3.5-locate-LLVMgold.patch
# Patches from AOSP
Patch4: 0000-llvm-Add-support-for-64-bit-longs.patch
Patch5: 0001-llvm-Make-EnableGlobalMerge-non-static-so-we-can-modify-i.patch
Patch6: llvm-3.5-detect-hardfloat.patch
# Claim compatibility with gcc 4.9.1 rather than 4.2.1, it's # Claim compatibility with gcc 4.9.1 rather than 4.2.1, it's
# much much closer in terms of standards supported etc. # much much closer in terms of standards supported etc.
Patch7: clang-gcc-compat.patch Patch7: clang-gcc-compat.patch
# Support -fuse-ld=XXX properly
Patch8: clang-fuse-ld.patch
# Fix build with --enable-shared (it failed with undefined symbol
# "llvm::cl::parser<llvm::PassInfo const*>::getOption(unsigned int) const")
Patch9: llvm-3.5-fix-enable-shared-build.patch
BuildRequires: bison BuildRequires: bison
BuildRequires: binutils-devel BuildRequires: binutils-devel
@ -68,8 +53,8 @@ BuildRequires: sed
BuildRequires: tcl BuildRequires: tcl
BuildRequires: zip BuildRequires: zip
BuildRequires: libstdc++-devel BuildRequires: libstdc++-devel
BuildRequires: pkgconfig(cloog-isl) #BuildRequires: pkgconfig(cloog-isl)
BuildRequires: pkgconfig(isl) >= 0.13 #BuildRequires: pkgconfig(isl) >= 0.13
BuildRequires: pkgconfig(libffi) BuildRequires: pkgconfig(libffi)
BuildRequires: pkgconfig(libtirpc) BuildRequires: pkgconfig(libtirpc)
%if %{compile_apidox} %if %{compile_apidox}
@ -378,30 +363,30 @@ mv clang-tools-extra-%{version}.src tools/clang/tools/extra
mv compiler-rt-%{version}.src projects/compiler-rt mv compiler-rt-%{version}.src projects/compiler-rt
cd tools/clang cd tools/clang
%patch0 -p0 -b .soname~ %patch0 -p0 -b .soname~
%patch1 -p3 -b .mandriva~ %patch1 -p1 -b .mandriva~
%patch7 -p3 -b .gcc49~ #patch8 -p3 -b .fuseLd~
%patch8 -p3 -b .fuseLd~
cd - cd -
%patch2 -p1 -b .armhf~ #patch2 -p1 -b .armhf~
%patch3 -p1 -b .LLVMgold~ #patch3 -p1 -b .LLVMgold~
%patch4 -p1 -b .64bitLongs~ #patch4 -p1 -b .64bitLongs~
%patch5 -p1 -b .EnableGlobalMerge~ #patch5 -p1 -b .EnableGlobalMerge~
%endif %endif
%patch6 -p1 -b .detectHardfloat~ %patch7 -p1 -b .gcc49~
%patch9 -p1 -b .enableShared~ #patch6 -p1 -b .detectHardfloat~
#patch9 -p1 -b .enableShared~
# Upstream tends to forget to remove "rc" and "svn" markers from version
# numbers before making releases
sed -i -re 's|^(AC_INIT[^,]*,\[)([0-9.]*)([^]])*(.*)|\1\2\4|' autoconf/configure.ac
sed -i -re "s|(PACKAGE_VERSION='[0-9.]*)([^']*)(.*)|\1\3|g;s|(PACKAGE_STRING='LLVM [0-9.]*)([^']*)(.*)|\1\3|g" configure
sed -i -re "s|^LLVM_VERSION_SUFFIX=.*|LLVM_VERSION_SUFFIX=|g" autoconf/configure.ac configure
%build %build
mkdir build
cd build
ln -s ../configure .
# Build with gcc/g++, not clang if it happens to be installed # Build with gcc/g++, not clang if it happens to be installed
# (blino) clang < 3.1 does not handle system headers from gcc 4.7 export CC=gcc
# http://llvm.org/bugs/show_bug.cgi?id=11916 export CXX=g++
export CC=%__cc
export CXX=%__cxx # A workaround for https://llvm.org/bugs/show_bug.cgi?id=20080 and
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61659.
export CXXFLAGS="%{optflags} -fno-devirtualize"
%configure2_5x \ %configure2_5x \
--libdir=%{_libdir}/%{name} \ --libdir=%{_libdir}/%{name} \
@ -414,14 +399,16 @@ export CXX=%__cxx
--enable-optimized \ --enable-optimized \
--enable-keep-symbols \ --enable-keep-symbols \
--enable-targets=all \ --enable-targets=all \
--enable-experimental-targets=R600 \
--disable-expensive-checks \ --disable-expensive-checks \
--enable-debug-runtime \ --enable-debug-runtime \
--disable-assertions \ --disable-assertions \
--enable-threads \ --enable-threads \
--with-cloog=%{_prefix} \
--with-isl=%{_prefix} \
--with-binutils-include=%{_includedir} \ --with-binutils-include=%{_includedir} \
%if %{with ocaml}
--enable-bindings=ocaml \
%else
--enable-bindings=none \
%endif
%if %{compile_apidox} %if %{compile_apidox}
--enable-doxygen --enable-doxygen
%endif %endif
@ -432,7 +419,9 @@ sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config
# FIXME upstream need to fix this # FIXME upstream need to fix this
# llvm-config.cpp hardcodes lib in it # llvm-config.cpp hardcodes lib in it
cd ..
sed -i 's|ActiveLibDir = ActivePrefix + "/lib"|ActiveLibDir = ActivePrefix + "/%{_lib}/%{name}"|g' tools/llvm-config/llvm-config.cpp sed -i 's|ActiveLibDir = ActivePrefix + "/lib"|ActiveLibDir = ActivePrefix + "/%{_lib}/%{name}"|g' tools/llvm-config/llvm-config.cpp
cd build
%make %make