]> TLD Linux GIT Repositories - packages/llvm.git/blob - llvm-tld.patch
- from PLD, TLDized
[packages/llvm.git] / llvm-tld.patch
1 --- llvm-3.2.src/tools/clang/lib/Driver/ToolChains.cpp.orig     2012-12-16 16:59:27.000000000 +0100
2 +++ llvm-3.2.src/tools/clang/lib/Driver/ToolChains.cpp  2013-01-24 12:42:19.582377854 +0100
3 @@ -1062,6 +1062,7 @@
4  
5    static const char *const X86_64LibDirs[] = { "/lib64", "/lib" };
6    static const char *const X86_64Triples[] = {
7 +    "x86_64-tld-linux",
8      "x86_64-linux-gnu",
9      "x86_64-unknown-linux-gnu",
10      "x86_64-pc-linux-gnu",
11 @@ -1074,6 +1075,7 @@
12    };
13    static const char *const X86LibDirs[] = { "/lib32", "/lib" };
14    static const char *const X86Triples[] = {
15 +    "i686-tld-linux",
16      "i686-linux-gnu",
17      "i686-pc-linux-gnu",
18      "i486-linux-gnu",
19 @@ -1830,6 +1834,7 @@
20  
21  enum LinuxDistro {
22    ArchLinux,
23 +  TLDLinux,
24    DebianLenny,
25    DebianSqueeze,
26    DebianWheezy,
27 @@ -1877,6 +1882,10 @@
28    return Distro >= UbuntuHardy && Distro <= UbuntuRaring;
29  }
30  
31 +static bool IsTLD(enum LinuxDistro Distro) {
32 +  return Distro == TLDLinux;
33 +}
34 +
35  static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
36    OwningPtr<llvm::MemoryBuffer> File;
37    if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) {
38 @@ -1955,6 +1964,9 @@
39    if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists)
40      return ArchLinux;
41  
42 +  if (!llvm::sys::fs::exists("/etc/tld-release", Exists) && Exists)
43 +    return TLDLinux;
44 +
45    return UnknownDistro;
46  }
47  
48 @@ -2072,7 +2084,7 @@
49  
50    LinuxDistro Distro = DetectLinuxDistro(Arch);
51  
52 -  if (IsOpenSuse(Distro) || IsUbuntu(Distro)) {
53 +  if (IsOpenSuse(Distro) || IsUbuntu(Distro) || IsTLD(Distro)) {
54      ExtraOpts.push_back("-z");
55      ExtraOpts.push_back("relro");
56    }
57 @@ -2088,7 +2100,7 @@
58    // ABI requires a mapping between the GOT and the symbol table.
59    // Android loader does not support .gnu.hash.
60    if (!isMipsArch(Arch) && !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");
65  
66 @@ -2097,11 +2109,11 @@
67        ExtraOpts.push_back("--hash-style=both");
68    }
69  
70 -  if (IsRedhat(Distro))
71 +  if (IsRedhat(Distro) || IsTLD(Distro))
72      ExtraOpts.push_back("--no-add-needed");
73  
74    if (Distro == DebianSqueeze || Distro == DebianWheezy ||
75 -      IsOpenSuse(Distro) ||
76 +      IsOpenSuse(Distro) || IsTLD(Distro) ||
77        (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
78        (IsUbuntu(Distro) && Distro >= UbuntuKarmic))
79      ExtraOpts.push_back("--build-id");