]>
Commit | Line | Data |
---|---|---|
dd9350c7 JB |
1 | --- llvm-3.2.src/tools/clang/lib/Driver/ToolChains.cpp.orig 2012-12-16 16:59:27.000000000 +0100 |
2 | +++ llvm-3.2.src/tools/clang/lib/Driver/ToolChains.cpp 2013-01-24 12:42:19.582377854 +0100 | |
3 | @@ -1062,6 +1062,7 @@ | |
f981d747 PS |
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", | |
dd9350c7 | 11 | @@ -1074,6 +1075,9 @@ |
f981d747 PS |
12 | }; |
13 | static const char *const X86LibDirs[] = { "/lib32", "/lib" }; | |
14 | static const char *const X86Triples[] = { | |
15 | + "i686-pld-linux", | |
dd9350c7 | 16 | + "i586-pld-linux", |
f981d747 PS |
17 | + "i486-pld-linux", |
18 | "i686-linux-gnu", | |
19 | "i686-pc-linux-gnu", | |
20 | "i486-linux-gnu", | |
dd9350c7 | 21 | @@ -1830,6 +1834,7 @@ |
4ad1976b PS |
22 | |
23 | enum LinuxDistro { | |
24 | ArchLinux, | |
25 | + PLDLinux, | |
26 | DebianLenny, | |
27 | DebianSqueeze, | |
28 | DebianWheezy, | |
dd9350c7 JB |
29 | @@ -1877,6 +1882,10 @@ |
30 | return Distro >= UbuntuHardy && Distro <= UbuntuRaring; | |
4ad1976b PS |
31 | } |
32 | ||
1628dc68 | 33 | +static bool IsPLD(enum Distro Distro) { |
4ad1976b PS |
34 | + return Distro == PLDLinux; |
35 | +} | |
36 | + | |
1628dc68 | 37 | static Distro DetectDistro(llvm::Triple::ArchType Arch) { |
f981d747 | 38 | OwningPtr<llvm::MemoryBuffer> File; |
4ad1976b | 39 | if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) { |
dd9350c7 | 40 | @@ -1955,6 +1964,9 @@ |
4ad1976b PS |
41 | if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists) |
42 | return ArchLinux; | |
43 | ||
44 | + if (!llvm::sys::fs::exists("/etc/pld-release", Exists) && Exists) | |
45 | + return PLDLinux; | |
46 | + | |
47 | return UnknownDistro; | |
48 | } | |
49 | ||
dd9350c7 | 50 | @@ -2072,7 +2084,7 @@ |
4ad1976b | 51 | |
1628dc68 | 52 | Distro Distro = DetectDistro(Arch); |
4ad1976b PS |
53 | |
54 | - if (IsOpenSuse(Distro) || IsUbuntu(Distro)) { | |
55 | + if (IsOpenSuse(Distro) || IsUbuntu(Distro) || IsPLD(Distro)) { | |
56 | ExtraOpts.push_back("-z"); | |
57 | ExtraOpts.push_back("relro"); | |
ce9cc204 | 58 | } |
dd9350c7 | 59 | @@ -2088,7 +2100,7 @@ |
f981d747 PS |
60 | // ABI requires a mapping between the GOT and the symbol table. |
61 | // Android loader does not support .gnu.hash. | |
dd9350c7 | 62 | if (!isMipsArch(Arch) && !IsAndroid) { |
f981d747 PS |
63 | - if (IsRedhat(Distro) || IsOpenSuse(Distro) || |
64 | + if (IsRedhat(Distro) || IsOpenSuse(Distro) || IsPLD(Distro) || | |
65 | (IsUbuntu(Distro) && Distro >= UbuntuMaverick)) | |
66 | ExtraOpts.push_back("--hash-style=gnu"); | |
1628dc68 AM |
67 | |
68 | @@ -2128,11 +2128,11 @@ | |
f981d747 PS |
69 | ExtraOpts.push_back("--hash-style=both"); |
70 | } | |
4ad1976b PS |
71 | |
72 | - if (IsRedhat(Distro)) | |
73 | + if (IsRedhat(Distro) || IsPLD(Distro)) | |
74 | ExtraOpts.push_back("--no-add-needed"); | |
ce9cc204 | 75 | |
4ad1976b | 76 | if (Distro == DebianSqueeze || Distro == DebianWheezy || |
1628dc68 AM |
77 | - Distro == DebianJessie || IsOpenSuse(Distro) || |
78 | + Distro == DebianJessie || IsOpenSuse(Distro) || IsPLD(Distro) || | |
4ad1976b | 79 | (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) || |
f981d747 PS |
80 | (IsUbuntu(Distro) && Distro >= UbuntuKarmic)) |
81 | ExtraOpts.push_back("--build-id"); | |
1628dc68 | 82 |