1 --- llvm-3.5.0.src/tools/clang/lib/Driver/ToolChains.cpp.orig 2014-10-01 21:07:02.242822402 +0200
2 +++ llvm-3.5.0.src/tools/clang/lib/Driver/ToolChains.cpp 2014-10-01 21:29:07.449433463 +0200
5 static const char *const X86_64LibDirs[] = { "/lib64", "/lib" };
6 static const char *const X86_64Triples[] = {
8 "x86_64-linux-gnu", "x86_64-unknown-linux-gnu", "x86_64-pc-linux-gnu",
9 "x86_64-redhat-linux6E", "x86_64-redhat-linux", "x86_64-suse-linux",
10 "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", "x86_64-slackware-linux",
12 static const char *const X32LibDirs[] = { "/libx32" };
13 static const char *const X86LibDirs[] = { "/lib32", "/lib" };
14 static const char *const X86Triples[] = {
16 "i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu", "i386-linux-gnu",
17 "i386-redhat-linux6E", "i686-redhat-linux", "i586-redhat-linux",
18 "i386-redhat-linux", "i586-suse-linux", "i486-slackware-linux",
27 @@ -2820,6 +2824,10 @@
28 return Distro >= UbuntuHardy && Distro <= UbuntuTrusty;
31 +static bool IsTLD(enum Distro Distro) {
32 + return Distro == TLDLinux;
35 static Distro DetectDistro(llvm::Triple::ArchType Arch) {
36 llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
37 llvm::MemoryBuffer::getFile("/etc/lsb-release");
39 if (llvm::sys::fs::exists("/etc/arch-release"))
42 + if (!llvm::sys::fs::exists("/etc/tld-release"))
50 Distro Distro = DetectDistro(Arch);
52 - if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) {
53 + if (IsOpenSUSE(Distro) || IsUbuntu(Distro) || IsTLD(Distro)) {
54 ExtraOpts.push_back("-z");
55 ExtraOpts.push_back("relro");
58 // ABI requires a mapping between the GOT and the symbol table.
59 // Android loader does not support .gnu.hash.
60 if (!IsMips && !IsAndroid) {
61 - if (IsRedhat(Distro) || IsOpenSUSE(Distro) ||
62 + if (IsRedhat(Distro) || IsOpenSUSE(Distro) || IsTLD(Distro) ||
63 (IsUbuntu(Distro) && Distro >= UbuntuMaverick))
64 ExtraOpts.push_back("--hash-style=gnu");
66 @@ -3058,11 +3069,11 @@
67 ExtraOpts.push_back("--hash-style=both");
70 - if (IsRedhat(Distro))
71 + if (IsRedhat(Distro) || IsTLD(Distro))
72 ExtraOpts.push_back("--no-add-needed");
74 if (Distro == DebianSqueeze || Distro == DebianWheezy ||
75 - Distro == DebianJessie || IsOpenSUSE(Distro) ||
76 + Distro == DebianJessie || IsOpenSUSE(Distro) || IsTLD(Distro) ||
77 (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
78 (IsUbuntu(Distro) && Distro >= UbuntuKarmic))
79 ExtraOpts.push_back("--build-id");