]> TLD Linux GIT Repositories - packages/llvm.git/blob - llvm-tld.patch
- merged 3.9.1 from PLD, TLDized
[packages/llvm.git] / llvm-tld.patch
1 diff -dur -x '*~' -x '*.orig' -x '*.rej' llvm-3.9.0.src.orig/tools/clang/lib/Driver/ToolChains.cpp llvm-3.9.0.src/tools/clang/lib/Driver/ToolChains.cpp
2 --- llvm-3.9.0.src.orig/tools/clang/lib/Driver/ToolChains.cpp   2016-08-18 19:56:48.000000000 +0200
3 +++ llvm-3.9.0.src/tools/clang/lib/Driver/ToolChains.cpp        2016-11-03 12:18:35.000000000 +0100
4 @@ -1498,6 +1498,7 @@
5  
6    static const char *const X86_64LibDirs[] = {"/lib64", "/lib"};
7    static const char *const X86_64Triples[] = {
8 +      "x86_64-tld-linux",
9        "x86_64-linux-gnu",       "x86_64-unknown-linux-gnu",
10        "x86_64-pc-linux-gnu",    "x86_64-redhat-linux6E",
11        "x86_64-redhat-linux",    "x86_64-suse-linux",
12 @@ -1507,6 +1508,7 @@
13    static const char *const X32LibDirs[] = {"/libx32"};
14    static const char *const X86LibDirs[] = {"/lib32", "/lib"};
15    static const char *const X86Triples[] = {
16 +      "i686-tld-linux",
17        "i686-linux-gnu",       "i686-pc-linux-gnu",     "i486-linux-gnu",
18        "i386-linux-gnu",       "i386-redhat-linux6E",   "i686-redhat-linux",
19        "i586-redhat-linux",    "i386-redhat-linux",     "i586-suse-linux",
20    static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
21 @@ -3716,6 +3719,7 @@
22    // in this enum, because some tests are done by integer comparison against
23    // the first and last known member in the family, e.g. IsRedHat().
24    ArchLinux,
25 +  TLDLinux,
26    DebianLenny,
27    DebianSqueeze,
28    DebianWheezy,
29 @@ -3761,6 +3765,10 @@
30    return Distro >= UbuntuHardy && Distro <= UbuntuXenial;
31  }
32  
33 +static bool IsTLD(enum Distro Distro) {
34 +  return Distro == TLDLinux;
35 +}
36 +
37  static Distro DetectDistro(const Driver &D, llvm::Triple::ArchType Arch) {
38    llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
39        llvm::MemoryBuffer::getFile("/etc/lsb-release");
40 @@ -3837,6 +3845,9 @@
41    if (D.getVFS().exists("/etc/arch-release"))
42      return ArchLinux;
43  
44 +  if (!llvm::sys::fs::exists("/etc/tld-release"))
45 +    return TLDLinux;
46 +
47    return UnknownDistro;
48  }
49  
50 @@ -4012,7 +4023,7 @@
51  
52    Distro Distro = DetectDistro(D, Arch);
53  
54 -  if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) {
55 +  if (IsOpenSUSE(Distro) || IsUbuntu(Distro) || IsTLD(Distro)) {
56      ExtraOpts.push_back("-z");
57      ExtraOpts.push_back("relro");
58    }
59 @@ -4032,7 +4043,7 @@
60    // ABI requires a mapping between the GOT and the symbol table.
61    // Android loader does not support .gnu.hash.
62    if (!IsMips && !IsAndroid) {
63 -    if (IsRedhat(Distro) || IsOpenSUSE(Distro) ||
64 +    if (IsRedhat(Distro) || IsOpenSUSE(Distro) || IsTLD(Distro) ||
65          (IsUbuntu(Distro) && Distro >= UbuntuMaverick))
66        ExtraOpts.push_back("--hash-style=gnu");
67  
68 @@ -4041,7 +4052,7 @@
69        ExtraOpts.push_back("--hash-style=both");
70    }
71  
72 -  if (IsRedhat(Distro) && Distro != RHEL5 && Distro != RHEL6)
73 +  if ((IsRedhat(Distro) && Distro != RHEL5 && Distro != RHEL6) || IsTLD(Distro))
74      ExtraOpts.push_back("--no-add-needed");
75  
76  #ifdef ENABLE_LINKER_BUILD_ID