]> git.pld-linux.org Git - packages/llvm.git/blob - llvm-pld.patch
Version: 3.9.0
[packages/llvm.git] / llvm-pld.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-pld-linux", "amd64-pld-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-pld-linux", "i586-pld-linux", "i486-pld-linux", "i386-pld-linux", "athlon-pld-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 @@ -1532,6 +1534,7 @@
21  
22    static const char *const PPCLibDirs[] = {"/lib32", "/lib"};
23    static const char *const PPCTriples[] = {
24 +      "powerpc-pld-linux",
25        "powerpc-linux-gnu", "powerpc-unknown-linux-gnu", "powerpc-linux-gnuspe",
26        "powerpc-suse-linux", "powerpc-montavista-linuxspe"};
27    static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
28 @@ -1544,14 +1547,14 @@
29        "powerpc64le-suse-linux", "ppc64le-redhat-linux"};
30  
31    static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"};
32 -  static const char *const SPARCv8Triples[] = {"sparc-linux-gnu",
33 +  static const char *const SPARCv8Triples[] = {"sparc-pld-linux", "sparc-linux-gnu",
34                                                 "sparcv8-linux-gnu"};
35    static const char *const SPARCv9LibDirs[] = {"/lib64", "/lib"};
36 -  static const char *const SPARCv9Triples[] = {"sparc64-linux-gnu",
37 +  static const char *const SPARCv9Triples[] = {"sparc64-pld-linux", "sparc64-linux-gnu",
38                                                 "sparcv9-linux-gnu"};
39  
40    static const char *const SystemZLibDirs[] = {"/lib64", "/lib"};
41 -  static const char *const SystemZTriples[] = {
42 +  static const char *const SystemZTriples[] = {"s390x-pld-linux",
43        "s390x-linux-gnu", "s390x-unknown-linux-gnu", "s390x-ibm-linux-gnu",
44        "s390x-suse-linux", "s390x-redhat-linux"};
45  
46 @@ -3716,6 +3719,7 @@
47    // in this enum, because some tests are done by integer comparison against
48    // the first and last known member in the family, e.g. IsRedHat().
49    ArchLinux,
50 +  PLDLinux,
51    DebianLenny,
52    DebianSqueeze,
53    DebianWheezy,
54 @@ -3761,6 +3765,10 @@
55    return Distro >= UbuntuHardy && Distro <= UbuntuXenial;
56  }
57  
58 +static bool IsPLD(enum Distro Distro) {
59 +  return Distro == PLDLinux;
60 +}
61 +
62  static Distro DetectDistro(const Driver &D, llvm::Triple::ArchType Arch) {
63    llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
64        llvm::MemoryBuffer::getFile("/etc/lsb-release");
65 @@ -3837,6 +3845,9 @@
66    if (D.getVFS().exists("/etc/arch-release"))
67      return ArchLinux;
68  
69 +  if (!llvm::sys::fs::exists("/etc/pld-release"))
70 +    return PLDLinux;
71 +
72    return UnknownDistro;
73  }
74  
75 @@ -4012,7 +4023,7 @@
76  
77    Distro Distro = DetectDistro(D, Arch);
78  
79 -  if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) {
80 +  if (IsOpenSUSE(Distro) || IsUbuntu(Distro) || IsPLD(Distro)) {
81      ExtraOpts.push_back("-z");
82      ExtraOpts.push_back("relro");
83    }
84 @@ -4032,7 +4043,7 @@
85    // ABI requires a mapping between the GOT and the symbol table.
86    // Android loader does not support .gnu.hash.
87    if (!IsMips && !IsAndroid) {
88 -    if (IsRedhat(Distro) || IsOpenSUSE(Distro) ||
89 +    if (IsRedhat(Distro) || IsOpenSUSE(Distro) || IsPLD(Distro) ||
90          (IsUbuntu(Distro) && Distro >= UbuntuMaverick))
91        ExtraOpts.push_back("--hash-style=gnu");
92  
93 @@ -4041,7 +4052,7 @@
94        ExtraOpts.push_back("--hash-style=both");
95    }
96  
97 -  if (IsRedhat(Distro) && Distro != RHEL5 && Distro != RHEL6)
98 +  if ((IsRedhat(Distro) && Distro != RHEL5 && Distro != RHEL6) || IsPLD(Distro))
99      ExtraOpts.push_back("--no-add-needed");
100  
101  #ifdef ENABLE_LINKER_BUILD_ID
This page took 0.072176 seconds and 4 git commands to generate.