1 --- llvm-3.3.src/tools/clang/lib/Driver/ToolChains.cpp.orig 2014-09-16 11:54:43.000000000 +0000
2 +++ llvm-3.3.src/tools/clang/lib/Driver/ToolChains.cpp 2014-09-16 11:53:47.000000000 +0000
5 static const char *const X86_64LibDirs[] = { "/lib64", "/lib" };
6 static const char *const X86_64Triples[] = {
9 "x86_64-unknown-linux-gnu",
10 "x86_64-pc-linux-gnu",
13 static const char *const X86LibDirs[] = { "/lib32", "/lib" };
14 static const char *const X86Triples[] = {
27 @@ -2029,6 +2032,10 @@
28 return Distro >= UbuntuHardy && Distro <= UbuntuRaring;
31 +static bool IsTLD(enum Distro Distro) {
32 + return Distro == TLDLinux;
35 static Distro DetectDistro(llvm::Triple::ArchType Arch) {
36 OwningPtr<llvm::MemoryBuffer> File;
37 if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) {
39 if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists)
42 + if (!llvm::sys::fs::exists("/etc/tld-release", Exists) && Exists)
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 @@ -2253,11 +2263,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");