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
11 @@ -1426,6 +1427,10 @@
12 Distro == UbuntuNatty || Distro == UbuntuOneiric;
15 +static bool IsPLD(enum LinuxDistro Distro) {
16 + return Distro == PLDLinux;
19 static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
20 llvm::OwningPtr<llvm::MemoryBuffer> File;
21 if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) {
23 if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists)
26 + if (!llvm::sys::fs::exists("/etc/pld-release", Exists) && Exists)
33 } else if (HostArch == llvm::Triple::x86_64) {
34 static const char *const X86_64LibDirs[] = { "/lib64", "/lib" };
35 static const char *const X86_64Triples[] = {
38 "x86_64-unknown-linux-gnu",
39 "x86_64-pc-linux-gnu",
41 } else if (HostArch == llvm::Triple::x86) {
42 static const char *const X86LibDirs[] = { "/lib32", "/lib" };
43 static const char *const X86Triples[] = {
51 LinuxDistro Distro = DetectLinuxDistro(Arch);
53 - if (IsOpenSuse(Distro) || IsUbuntu(Distro)) {
54 + if (IsOpenSuse(Distro) || IsUbuntu(Distro) || IsPLD(Distro)) {
55 ExtraOpts.push_back("-z");
56 ExtraOpts.push_back("relro");
58 @@ -1811,18 +1822,18 @@
59 ExtraOpts.push_back("-X");
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");
66 if (IsDebian(Distro) || IsOpenSuse(Distro) || Distro == UbuntuLucid ||
67 Distro == UbuntuJaunty || Distro == UbuntuKarmic)
68 ExtraOpts.push_back("--hash-style=both");
70 - if (IsRedhat(Distro))
71 + if (IsRedhat(Distro) || IsPLD(Distro))
72 ExtraOpts.push_back("--no-add-needed");
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 ||