]> TLD Linux GIT Repositories - packages/llvm.git/blob - llvm-tld.patch
fb62e20c6bbaeb7068f672720c96c855088f1fc3
[packages/llvm.git] / llvm-tld.patch
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
3 @@ -1333,6 +1333,7 @@
4  
5    static const char *const X86_64LibDirs[] = { "/lib64", "/lib" };
6    static const char *const X86_64Triples[] = {
7 +    "x86_64-pld-linux",
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",
11 @@ -1341,6 +1342,7 @@
12    static const char *const X32LibDirs[] = { "/libx32" };
13    static const char *const X86LibDirs[] = { "/lib32", "/lib" };
14    static const char *const X86Triples[] = {
15 +    "i686-pld-linux",
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",
19 @@ -2778,6 +2781,7 @@
20  
21  enum Distro {
22    ArchLinux,
23 +  TLDLinux,
24    DebianLenny,
25    DebianSqueeze,
26    DebianWheezy,
27 @@ -2820,6 +2824,10 @@
28    return Distro >= UbuntuHardy && Distro <= UbuntuTrusty;
29  }
30  
31 +static bool IsTLD(enum Distro Distro) {
32 +  return Distro == TLDLinux;
33 +}
34 +
35  static Distro DetectDistro(llvm::Triple::ArchType Arch) {
36    llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
37        llvm::MemoryBuffer::getFile("/etc/lsb-release");
38 @@ -2888,6 +2896,9 @@
39    if (llvm::sys::fs::exists("/etc/arch-release"))
40      return ArchLinux;
41  
42 +  if (!llvm::sys::fs::exists("/etc/tld-release"))
43 +    return TLDLinux;
44 +
45    return UnknownDistro;
46  }
47  
48 @@ -3029,7 +3040,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 @@ -3049,7 +3060,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 @@ -3058,11 +3069,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");