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
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[] = {
28 @@ -1860,6 +1864,10 @@
29 return Distro >= UbuntuHardy && Distro <= UbuntuPrecise;
32 +static bool IsPLD(enum LinuxDistro Distro) {
33 + return Distro == PLDLinux;
36 static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
37 OwningPtr<llvm::MemoryBuffer> File;
38 if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) {
40 if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists)
43 + if (!llvm::sys::fs::exists("/etc/pld-release", Exists) && Exists)
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");
59 // ABI requires a mapping between the GOT and the symbol table.
60 // Android loader does not support .gnu.hash.
61 if (!IsMips && !IsAndroid) {
62 - if (IsRedhat(Distro) || IsOpenSuse(Distro) ||
63 + if (IsRedhat(Distro) || IsOpenSuse(Distro) || IsPLD(Distro) ||
64 (IsUbuntu(Distro) && Distro >= UbuntuMaverick))
65 ExtraOpts.push_back("--hash-style=gnu");
67 @@ -2033,11 +2044,11 @@
68 ExtraOpts.push_back("--hash-style=both");
71 - if (IsRedhat(Distro))
72 + if (IsRedhat(Distro) || IsPLD(Distro))
73 ExtraOpts.push_back("--no-add-needed");
75 if (Distro == DebianSqueeze || Distro == DebianWheezy ||
76 - IsOpenSuse(Distro) ||
77 + IsOpenSuse(Distro) || IsPLD(Distro) ||
78 (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
79 (IsUbuntu(Distro) && Distro >= UbuntuKarmic))
80 ExtraOpts.push_back("--build-id");