]>
Commit | Line | Data |
---|---|---|
036156f1 JK |
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 @@ | |
f981d747 | 5 | |
41876fe7 | 6 | static const char *const X86_64LibDirs[] = {"/lib64", "/lib"}; |
f981d747 | 7 | static const char *const X86_64Triples[] = { |
41876fe7 JR |
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", | |
036156f1 | 12 | @@ -1507,6 +1508,7 @@ |
41876fe7 JR |
13 | static const char *const X32LibDirs[] = {"/libx32"}; |
14 | static const char *const X86LibDirs[] = {"/lib32", "/lib"}; | |
f981d747 | 15 | static const char *const X86Triples[] = { |
41876fe7 JR |
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", | |
036156f1 | 20 | @@ -1532,6 +1534,7 @@ |
b883cf1e | 21 | |
41876fe7 | 22 | static const char *const PPCLibDirs[] = {"/lib32", "/lib"}; |
b883cf1e | 23 | static const char *const PPCTriples[] = { |
41876fe7 JR |
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"}; | |
036156f1 JK |
28 | @@ -1544,14 +1547,14 @@ |
29 | "powerpc64le-suse-linux", "ppc64le-redhat-linux"}; | |
b883cf1e | 30 | |
41876fe7 JR |
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"}; | |
b883cf1e | 39 | |
41876fe7 | 40 | static const char *const SystemZLibDirs[] = {"/lib64", "/lib"}; |
b883cf1e | 41 | - static const char *const SystemZTriples[] = { |
41876fe7 JR |
42 | + static const char *const SystemZTriples[] = {"s390x-pld-linux", |
43 | "s390x-linux-gnu", "s390x-unknown-linux-gnu", "s390x-ibm-linux-gnu", | |
036156f1 | 44 | "s390x-suse-linux", "s390x-redhat-linux"}; |
4ad1976b | 45 | |
036156f1 JK |
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(). | |
4ad1976b PS |
49 | ArchLinux, |
50 | + PLDLinux, | |
51 | DebianLenny, | |
52 | DebianSqueeze, | |
53 | DebianWheezy, | |
036156f1 | 54 | @@ -3761,6 +3765,10 @@ |
6461a7a9 | 55 | return Distro >= UbuntuHardy && Distro <= UbuntuXenial; |
4ad1976b PS |
56 | } |
57 | ||
1628dc68 | 58 | +static bool IsPLD(enum Distro Distro) { |
4ad1976b PS |
59 | + return Distro == PLDLinux; |
60 | +} | |
61 | + | |
6461a7a9 | 62 | static Distro DetectDistro(const Driver &D, llvm::Triple::ArchType Arch) { |
b883cf1e JB |
63 | llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File = |
64 | llvm::MemoryBuffer::getFile("/etc/lsb-release"); | |
036156f1 JK |
65 | @@ -3837,6 +3845,9 @@ |
66 | if (D.getVFS().exists("/etc/arch-release")) | |
4ad1976b PS |
67 | return ArchLinux; |
68 | ||
11b6f380 | 69 | + if (!llvm::sys::fs::exists("/etc/pld-release")) |
4ad1976b PS |
70 | + return PLDLinux; |
71 | + | |
72 | return UnknownDistro; | |
73 | } | |
74 | ||
036156f1 | 75 | @@ -4012,7 +4023,7 @@ |
4ad1976b | 76 | |
036156f1 | 77 | Distro Distro = DetectDistro(D, Arch); |
4ad1976b | 78 | |
11b6f380 JB |
79 | - if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) { |
80 | + if (IsOpenSUSE(Distro) || IsUbuntu(Distro) || IsPLD(Distro)) { | |
4ad1976b PS |
81 | ExtraOpts.push_back("-z"); |
82 | ExtraOpts.push_back("relro"); | |
ce9cc204 | 83 | } |
036156f1 | 84 | @@ -4032,7 +4043,7 @@ |
f981d747 PS |
85 | // ABI requires a mapping between the GOT and the symbol table. |
86 | // Android loader does not support .gnu.hash. | |
c999855f | 87 | if (!IsMips && !IsAndroid) { |
11b6f380 JB |
88 | - if (IsRedhat(Distro) || IsOpenSUSE(Distro) || |
89 | + if (IsRedhat(Distro) || IsOpenSUSE(Distro) || IsPLD(Distro) || | |
f981d747 PS |
90 | (IsUbuntu(Distro) && Distro >= UbuntuMaverick)) |
91 | ExtraOpts.push_back("--hash-style=gnu"); | |
11b6f380 | 92 | |
036156f1 | 93 | @@ -4041,7 +4052,7 @@ |
f981d747 PS |
94 | ExtraOpts.push_back("--hash-style=both"); |
95 | } | |
4ad1976b | 96 | |
036156f1 JK |
97 | - if (IsRedhat(Distro) && Distro != RHEL5 && Distro != RHEL6) |
98 | + if ((IsRedhat(Distro) && Distro != RHEL5 && Distro != RHEL6) || IsPLD(Distro)) | |
4ad1976b | 99 | ExtraOpts.push_back("--no-add-needed"); |
ce9cc204 | 100 | |
036156f1 | 101 | #ifdef ENABLE_LINKER_BUILD_ID |