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
5 static const char *const X86_64LibDirs[] = { "/lib64", "/lib" };
6 static const char *const X86_64Triples[] = {
9 "x86_64-unknown-linux-gnu",
10 "x86_64-pc-linux-gnu",
13 static const char *const X86LibDirs[] = { "/lib32", "/lib" };
14 static const char *const X86Triples[] = {
29 @@ -1877,6 +1882,10 @@
30 return Distro >= UbuntuHardy && Distro <= UbuntuRaring;
33 +static bool IsPLD(enum LinuxDistro Distro) {
34 + return Distro == PLDLinux;
37 static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
38 OwningPtr<llvm::MemoryBuffer> File;
39 if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) {
41 if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists)
44 + if (!llvm::sys::fs::exists("/etc/pld-release", Exists) && Exists)
52 LinuxDistro Distro = DetectLinuxDistro(Arch);
54 - if (IsOpenSuse(Distro) || IsUbuntu(Distro)) {
55 + if (IsOpenSuse(Distro) || IsUbuntu(Distro) || IsPLD(Distro)) {
56 ExtraOpts.push_back("-z");
57 ExtraOpts.push_back("relro");
60 // ABI requires a mapping between the GOT and the symbol table.
61 // Android loader does not support .gnu.hash.
62 if (!isMipsArch(Arch) && !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");
68 @@ -2097,11 +2109,11 @@
69 ExtraOpts.push_back("--hash-style=both");
72 - if (IsRedhat(Distro))
73 + if (IsRedhat(Distro) || IsPLD(Distro))
74 ExtraOpts.push_back("--no-add-needed");
76 if (Distro == DebianSqueeze || Distro == DebianWheezy ||
77 - IsOpenSuse(Distro) ||
78 + IsOpenSuse(Distro) || IsPLD(Distro) ||
79 (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
80 (IsUbuntu(Distro) && Distro >= UbuntuKarmic))
81 ExtraOpts.push_back("--build-id");