]> git.pld-linux.org Git - packages/llvm.git/blob - llvm-pld.patch
17406c10b0a20f01fd2bdf55de4fdf206a1bd6e3
[packages/llvm.git] / llvm-pld.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", "amd64-pld-linux",
8        "x86_64-linux-gnu",       "x86_64-unknown-linux-gnu",
9        "x86_64-pc-linux-gnu",    "x86_64-redhat-linux6E",
10        "x86_64-redhat-linux",    "x86_64-suse-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", "i586-pld-linux", "i486-pld-linux", "i386-pld-linux", "athlon-pld-linux",
16        "i686-linux-gnu",       "i686-pc-linux-gnu",     "i486-linux-gnu",
17        "i386-linux-gnu",       "i386-redhat-linux6E",   "i686-redhat-linux",
18        "i586-redhat-linux",    "i386-redhat-linux",     "i586-suse-linux",
19 @@ -1370,6 +1372,7 @@
20  
21    static const char *const PPCLibDirs[] = {"/lib32", "/lib"};
22    static const char *const PPCTriples[] = {
23 +      "powerpc-pld-linux",
24        "powerpc-linux-gnu", "powerpc-unknown-linux-gnu", "powerpc-linux-gnuspe",
25        "powerpc-suse-linux", "powerpc-montavista-linuxspe"};
26    static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
27 @@ -1385,14 +1388,14 @@
28                                                  "ppc64le-redhat-linux" };
29  
30    static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"};
31 -  static const char *const SPARCv8Triples[] = {"sparc-linux-gnu",
32 +  static const char *const SPARCv8Triples[] = {"sparc-pld-linux", "sparc-linux-gnu",
33                                                 "sparcv8-linux-gnu"};
34    static const char *const SPARCv9LibDirs[] = {"/lib64", "/lib"};
35 -  static const char *const SPARCv9Triples[] = {"sparc64-linux-gnu",
36 +  static const char *const SPARCv9Triples[] = {"sparc64-pld-linux", "sparc64-linux-gnu",
37                                                 "sparcv9-linux-gnu"};
38  
39    static const char *const SystemZLibDirs[] = {"/lib64", "/lib"};
40 -  static const char *const SystemZTriples[] = {
41 +  static const char *const SystemZTriples[] = {"s390x-pld-linux",
42        "s390x-linux-gnu", "s390x-unknown-linux-gnu", "s390x-ibm-linux-gnu",
43        "s390x-suse-linux", "s390x-redhat-linux"
44    };
45 @@ -2778,6 +2781,7 @@
46  
47  enum Distro {
48    ArchLinux,
49 +  PLDLinux,
50    DebianLenny,
51    DebianSqueeze,
52    DebianWheezy,
53 @@ -2820,6 +2824,10 @@
54    return Distro >= UbuntuHardy && Distro <= UbuntuXenial;
55  }
56  
57 +static bool IsPLD(enum Distro Distro) {
58 +  return Distro == PLDLinux;
59 +}
60 +
61  static Distro DetectDistro(const Driver &D, llvm::Triple::ArchType Arch) {
62    llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
63        llvm::MemoryBuffer::getFile("/etc/lsb-release");
64 @@ -2888,6 +2896,9 @@
65    if (llvm::sys::fs::exists("/etc/arch-release"))
66      return ArchLinux;
67  
68 +  if (!llvm::sys::fs::exists("/etc/pld-release"))
69 +    return PLDLinux;
70 +
71    return UnknownDistro;
72  }
73  
74 @@ -3029,7 +3040,7 @@
75  
76    Distro Distro = DetectDistro(Arch);
77  
78 -  if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) {
79 +  if (IsOpenSUSE(Distro) || IsUbuntu(Distro) || IsPLD(Distro)) {
80      ExtraOpts.push_back("-z");
81      ExtraOpts.push_back("relro");
82    }
83 @@ -3049,7 +3060,7 @@
84    // ABI requires a mapping between the GOT and the symbol table.
85    // Android loader does not support .gnu.hash.
86    if (!IsMips && !IsAndroid) {
87 -    if (IsRedhat(Distro) || IsOpenSUSE(Distro) ||
88 +    if (IsRedhat(Distro) || IsOpenSUSE(Distro) || IsPLD(Distro) ||
89          (IsUbuntu(Distro) && Distro >= UbuntuMaverick))
90        ExtraOpts.push_back("--hash-style=gnu");
91  
92 @@ -3058,10 +3069,10 @@
93        ExtraOpts.push_back("--hash-style=both");
94    }
95  
96 -  if (IsRedhat(Distro))
97 +  if (IsRedhat(Distro) || IsPLD(Distro))
98      ExtraOpts.push_back("--no-add-needed");
99  
100 -  if ((IsDebian(Distro) && Distro >= DebianSqueeze) || IsOpenSUSE(Distro) ||
101 +  if ((IsDebian(Distro) && Distro >= DebianSqueeze) || IsOpenSUSE(Distro) || IsPLD(Distro) ||
102        (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
103        (IsUbuntu(Distro) && Distro >= UbuntuKarmic))
104      ExtraOpts.push_back("--build-id");
This page took 0.076272 seconds and 3 git commands to generate.