]> git.pld-linux.org Git - packages/llvm.git/blob - llvm-pld.patch
- updated to 3.1.
[packages/llvm.git] / llvm-pld.patch
1 --- llvm-3.0./tools/clang/lib/Driver/ToolChains.cpp.orig        2012-02-09 11:41:41.000000000 +0100
2 +++ llvm-3.0./tools/clang/lib/Driver/ToolChains.cpp     2012-02-09 12:25:54.844008378 +0100
3 @@ -1190,6 +1190,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",
9      "x86_64-unknown-linux-gnu",
10      "x86_64-pc-linux-gnu",
11 @@ -1202,6 +1203,8 @@
12    };
13    static const char *const X86LibDirs[] = { "/lib32", "/lib" };
14    static const char *const X86Triples[] = {
15 +    "i686-pld-linux",
16 +    "i486-pld-linux",
17      "i686-linux-gnu",
18      "i686-pc-linux-gnu",
19      "i486-linux-gnu",
20 @@ -1815,6 +1818,7 @@
21  
22  enum LinuxDistro {
23    ArchLinux,
24 +  PLDLinux,
25    DebianLenny,
26    DebianSqueeze,
27    DebianWheezy,
28 @@ -1860,6 +1864,10 @@
29    return Distro >= UbuntuHardy && Distro <= UbuntuPrecise;
30  }
31  
32 +static bool IsPLD(enum LinuxDistro Distro) {
33 +  return Distro == PLDLinux;
34 +}
35 +
36  static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
37    OwningPtr<llvm::MemoryBuffer> File;
38    if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) {
39 @@ -1936,6 +1944,9 @@
40    if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists)
41      return ArchLinux;
42  
43 +  if (!llvm::sys::fs::exists("/etc/pld-release", Exists) && Exists)
44 +    return PLDLinux;
45 +
46    return UnknownDistro;
47  }
48  
49 @@ -2003,7 +2014,7 @@
50  
51    LinuxDistro Distro = DetectLinuxDistro(Arch);
52  
53 -  if (IsOpenSuse(Distro) || IsUbuntu(Distro)) {
54 +  if (IsOpenSuse(Distro) || IsUbuntu(Distro) || IsPLD(Distro)) {
55      ExtraOpts.push_back("-z");
56      ExtraOpts.push_back("relro");
57    }
58 @@ -2024,7 +2035,7 @@
59    // ABI requires a mapping between the GOT and the symbol table.
60    // Android loader does not support .gnu.hash.
61    if (!IsMips && !IsAndroid) {
62 -    if (IsRedhat(Distro) || IsOpenSuse(Distro) ||
63 +    if (IsRedhat(Distro) || IsOpenSuse(Distro) || IsPLD(Distro) ||
64          (IsUbuntu(Distro) && Distro >= UbuntuMaverick))
65        ExtraOpts.push_back("--hash-style=gnu");
66  
67 @@ -2033,11 +2044,11 @@
68        ExtraOpts.push_back("--hash-style=both");
69    }
70  
71 -  if (IsRedhat(Distro))
72 +  if (IsRedhat(Distro) || IsPLD(Distro))
73      ExtraOpts.push_back("--no-add-needed");
74  
75    if (Distro == DebianSqueeze || Distro == DebianWheezy ||
76 -      IsOpenSuse(Distro) ||
77 +      IsOpenSuse(Distro) || IsPLD(Distro) ||
78        (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
79        (IsUbuntu(Distro) && Distro >= UbuntuKarmic))
80      ExtraOpts.push_back("--build-id");
This page took 0.67935 seconds and 4 git commands to generate.