]>
Commit | Line | Data |
---|---|---|
4ad1976b PS |
1 | --- llvm-3.0./tools/clang/lib/Driver/ToolChains.cpp.orig 2012-02-09 11:41:41.000000000 +0100 |
2 | +++ llvm-3.0./tools/clang/lib/Driver/ToolChains.cpp 2012-02-09 12:25:54.844008378 +0100 | |
3 | @@ -1378,6 +1378,7 @@ | |
4 | ||
5 | enum LinuxDistro { | |
6 | ArchLinux, | |
7 | + PLDLinux, | |
8 | DebianLenny, | |
9 | DebianSqueeze, | |
10 | DebianWheezy, | |
11 | @@ -1426,6 +1427,10 @@ | |
12 | Distro == UbuntuNatty || Distro == UbuntuOneiric; | |
13 | } | |
14 | ||
15 | +static bool IsPLD(enum LinuxDistro Distro) { | |
16 | + return Distro == PLDLinux; | |
17 | +} | |
18 | + | |
19 | static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) { | |
20 | llvm::OwningPtr<llvm::MemoryBuffer> File; | |
21 | if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) { | |
22 | @@ -1507,6 +1512,9 @@ | |
23 | if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists) | |
24 | return ArchLinux; | |
25 | ||
26 | + if (!llvm::sys::fs::exists("/etc/pld-release", Exists) && Exists) | |
27 | + return PLDLinux; | |
28 | + | |
29 | return UnknownDistro; | |
30 | } | |
31 | ||
32 | @@ -1647,6 +1655,7 @@ | |
33 | } else if (HostArch == llvm::Triple::x86_64) { | |
34 | static const char *const X86_64LibDirs[] = { "/lib64", "/lib" }; | |
35 | static const char *const X86_64Triples[] = { | |
36 | + "x86_64-pld-linux", | |
37 | "x86_64-linux-gnu", | |
38 | "x86_64-unknown-linux-gnu", | |
39 | "x86_64-pc-linux-gnu", | |
40 | @@ -1664,6 +1673,8 @@ | |
41 | } else if (HostArch == llvm::Triple::x86) { | |
42 | static const char *const X86LibDirs[] = { "/lib32", "/lib" }; | |
43 | static const char *const X86Triples[] = { | |
44 | + "i486-pld-linux", | |
45 | + "i686-pld-linux", | |
46 | "i686-linux-gnu", | |
47 | "i686-pc-linux-gnu", | |
48 | "i486-linux-gnu", | |
49 | @@ -1802,7 +1813,7 @@ | |
50 | ||
51 | LinuxDistro Distro = DetectLinuxDistro(Arch); | |
52 | ||
53 | - if (IsOpenSuse(Distro) || IsUbuntu(Distro)) { | |
54 | + if (IsOpenSuse(Distro) || IsUbuntu(Distro) || IsPLD(Distro)) { | |
55 | ExtraOpts.push_back("-z"); | |
56 | ExtraOpts.push_back("relro"); | |
ce9cc204 | 57 | } |
4ad1976b PS |
58 | @@ -1811,18 +1822,18 @@ |
59 | ExtraOpts.push_back("-X"); | |
60 | ||
61 | if (IsRedhat(Distro) || IsOpenSuse(Distro) || Distro == UbuntuMaverick || | |
62 | - Distro == UbuntuNatty || Distro == UbuntuOneiric) | |
63 | + Distro == UbuntuNatty || Distro == UbuntuOneiric || IsPLD(Distro)) | |
64 | ExtraOpts.push_back("--hash-style=gnu"); | |
65 | ||
66 | if (IsDebian(Distro) || IsOpenSuse(Distro) || Distro == UbuntuLucid || | |
67 | Distro == UbuntuJaunty || Distro == UbuntuKarmic) | |
68 | ExtraOpts.push_back("--hash-style=both"); | |
69 | ||
70 | - if (IsRedhat(Distro)) | |
71 | + if (IsRedhat(Distro) || IsPLD(Distro)) | |
72 | ExtraOpts.push_back("--no-add-needed"); | |
ce9cc204 | 73 | |
4ad1976b PS |
74 | if (Distro == DebianSqueeze || Distro == DebianWheezy || |
75 | - IsOpenSuse(Distro) || | |
76 | + IsOpenSuse(Distro) || IsPLD(Distro) || | |
77 | (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) || | |
78 | Distro == UbuntuLucid || | |
79 | Distro == UbuntuMaverick || Distro == UbuntuKarmic || |