]> TLD Linux GIT Repositories - packages/llvm.git/blob - llvm-tld.patch
cbe0f364447bdce56019b1fa783d4467289a6c11
[packages/llvm.git] / llvm-tld.patch
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
3 @@ -1091,6 +1091,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 @@ -1103,6 +1104,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 @@ -1981,6 +1983,7 @@
20  
21  enum Distro {
22    ArchLinux,
23 +  TLDLinux,
24    DebianLenny,
25    DebianSqueeze,
26    DebianWheezy,
27 @@ -2029,6 +2032,10 @@
28    return Distro >= UbuntuHardy && Distro <= UbuntuRaring;
29  }
30  
31 +static bool IsTLD(enum LinuxDistro Distro) {
32 +  return Distro == TLDLinux;
33 +}
34 +
35  static Distro DetectDistro(llvm::Triple::ArchType Arch) {
36    OwningPtr<llvm::MemoryBuffer> File;
37    if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) {
38 @@ -2109,6 +2116,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 @@ -2224,7 +2234,7 @@
49  
50    Distro Distro = DetectDistro(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 @@ -2244,7 +2254,7 @@
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");
65  
66 @@ -2253,11 +2263,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 -      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");