1 diff -dur -x '*~' -x '*.orig' -x '*.rej' llvm-3.9.0.src.orig/tools/clang/lib/Driver/ToolChains.cpp llvm-3.9.0.src/tools/clang/lib/Driver/ToolChains.cpp
2 --- llvm-3.9.0.src.orig/tools/clang/lib/Driver/ToolChains.cpp 2016-08-18 19:56:48.000000000 +0200
3 +++ llvm-3.9.0.src/tools/clang/lib/Driver/ToolChains.cpp 2016-11-03 12:18:35.000000000 +0100
6 static const char *const X86_64LibDirs[] = {"/lib64", "/lib"};
7 static const char *const X86_64Triples[] = {
9 "x86_64-linux-gnu", "x86_64-unknown-linux-gnu",
10 "x86_64-pc-linux-gnu", "x86_64-redhat-linux6E",
11 "x86_64-redhat-linux", "x86_64-suse-linux",
13 static const char *const X32LibDirs[] = {"/libx32"};
14 static const char *const X86LibDirs[] = {"/lib32", "/lib"};
15 static const char *const X86Triples[] = {
17 "i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu",
18 "i386-linux-gnu", "i386-redhat-linux6E", "i686-redhat-linux",
19 "i586-redhat-linux", "i386-redhat-linux", "i586-suse-linux",
20 static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
22 // in this enum, because some tests are done by integer comparison against
23 // the first and last known member in the family, e.g. IsRedHat().
29 @@ -3761,6 +3765,10 @@
30 return Distro >= UbuntuHardy && Distro <= UbuntuXenial;
33 +static bool IsTLD(enum Distro Distro) {
34 + return Distro == TLDLinux;
37 static Distro DetectDistro(const Driver &D, llvm::Triple::ArchType Arch) {
38 llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
39 llvm::MemoryBuffer::getFile("/etc/lsb-release");
41 if (D.getVFS().exists("/etc/arch-release"))
44 + if (!llvm::sys::fs::exists("/etc/tld-release"))
52 Distro Distro = DetectDistro(D, Arch);
54 - if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) {
55 + if (IsOpenSUSE(Distro) || IsUbuntu(Distro) || IsTLD(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 (!IsMips && !IsAndroid) {
63 - if (IsRedhat(Distro) || IsOpenSUSE(Distro) ||
64 + if (IsRedhat(Distro) || IsOpenSUSE(Distro) || IsTLD(Distro) ||
65 (IsUbuntu(Distro) && Distro >= UbuntuMaverick))
66 ExtraOpts.push_back("--hash-style=gnu");
69 ExtraOpts.push_back("--hash-style=both");
72 - if (IsRedhat(Distro) && Distro != RHEL5 && Distro != RHEL6)
73 + if ((IsRedhat(Distro) && Distro != RHEL5 && Distro != RHEL6) || IsTLD(Distro))
74 ExtraOpts.push_back("--no-add-needed");
76 #ifdef ENABLE_LINKER_BUILD_ID