]>
Commit | Line | Data |
---|---|---|
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 @@ | |
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 | @@ -1074,6 +1075,9 @@ | |
12 | }; | |
13 | static const char *const X86LibDirs[] = { "/lib32", "/lib" }; | |
14 | static const char *const X86Triples[] = { | |
15 | + "i686-pld-linux", | |
16 | + "i586-pld-linux", | |
17 | + "i486-pld-linux", | |
18 | "i686-linux-gnu", | |
19 | "i686-pc-linux-gnu", | |
20 | "i486-linux-gnu", | |
21 | @@ -1830,6 +1834,7 @@ | |
22 | ||
23 | enum LinuxDistro { | |
24 | ArchLinux, | |
25 | + PLDLinux, | |
26 | DebianLenny, | |
27 | DebianSqueeze, | |
28 | DebianWheezy, | |
29 | @@ -1877,6 +1882,10 @@ | |
30 | return Distro >= UbuntuHardy && Distro <= UbuntuRaring; | |
31 | } | |
32 | ||
33 | +static bool IsPLD(enum Distro Distro) { | |
34 | + return Distro == PLDLinux; | |
35 | +} | |
36 | + | |
37 | static Distro DetectDistro(llvm::Triple::ArchType Arch) { | |
38 | OwningPtr<llvm::MemoryBuffer> File; | |
39 | if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) { | |
40 | @@ -1955,6 +1964,9 @@ | |
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 | ||
50 | @@ -2072,7 +2084,7 @@ | |
51 | ||
52 | Distro Distro = DetectDistro(Arch); | |
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"); | |
58 | } | |
59 | @@ -2088,7 +2100,7 @@ | |
60 | // ABI requires a mapping between the GOT and the symbol table. | |
61 | // Android loader does not support .gnu.hash. | |
62 | if (!IsMips && !IsAndroid) { | |
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"); | |
67 | ||
68 | @@ -2128,11 +2128,11 @@ | |
69 | ExtraOpts.push_back("--hash-style=both"); | |
70 | } | |
71 | ||
72 | - if (IsRedhat(Distro)) | |
73 | + if (IsRedhat(Distro) || IsPLD(Distro)) | |
74 | ExtraOpts.push_back("--no-add-needed"); | |
75 | ||
76 | if (Distro == DebianSqueeze || Distro == DebianWheezy || | |
77 | - Distro == DebianJessie || IsOpenSuse(Distro) || | |
78 | + Distro == DebianJessie || IsOpenSuse(Distro) || IsPLD(Distro) || | |
79 | (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) || | |
80 | (IsUbuntu(Distro) && Distro >= UbuntuKarmic)) | |
81 | ExtraOpts.push_back("--build-id"); | |
82 |