---- llvm-3.2.src/tools/clang/lib/Driver/ToolChains.cpp.orig 2012-12-16 16:59:27.000000000 +0100
-+++ llvm-3.2.src/tools/clang/lib/Driver/ToolChains.cpp 2013-01-24 12:42:19.582377854 +0100
-@@ -1062,6 +1062,7 @@
+diff -urNp -x '*.orig' llvm-11.0.1.src.org/tools/clang/include/clang/Driver/Distro.h llvm-11.0.1.src/tools/clang/include/clang/Driver/Distro.h
+--- llvm-11.0.1.src.org/tools/clang/include/clang/Driver/Distro.h 2020-12-18 20:57:38.000000000 +0100
++++ llvm-11.0.1.src/tools/clang/include/clang/Driver/Distro.h 2021-03-25 22:27:39.173689051 +0100
+@@ -28,6 +28,7 @@ public:
+ // the first and last known member in the family, e.g. IsRedHat().
+ AlpineLinux,
+ ArchLinux,
++ TLDLinux,
+ DebianLenny,
+ DebianSqueeze,
+ DebianWheezy,
+@@ -132,6 +133,10 @@ public:
- static const char *const X86_64LibDirs[] = { "/lib64", "/lib" };
- static const char *const X86_64Triples[] = {
-+ "x86_64-tld-linux",
- "x86_64-linux-gnu",
- "x86_64-unknown-linux-gnu",
- "x86_64-pc-linux-gnu",
-@@ -1074,6 +1075,7 @@
- };
- static const char *const X86LibDirs[] = { "/lib32", "/lib" };
- static const char *const X86Triples[] = {
-+ "i686-tld-linux",
- "i686-linux-gnu",
- "i686-pc-linux-gnu",
- "i486-linux-gnu",
-@@ -1830,6 +1834,7 @@
-
- enum LinuxDistro {
- ArchLinux,
-+ TLDLinux,
- DebianLenny,
- DebianSqueeze,
- DebianWheezy,
-@@ -1877,6 +1882,10 @@
- return Distro >= UbuntuHardy && Distro <= UbuntuRaring;
- }
+ bool IsGentoo() const { return DistroVal == Gentoo; }
-+static bool IsTLD(enum LinuxDistro Distro) {
-+ return Distro == TLDLinux;
-+}
++ bool IsTLD() {
++ return DistroVal == TLDLinux;
++ }
+
- static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
- OwningPtr<llvm::MemoryBuffer> File;
- if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) {
-@@ -1955,6 +1964,9 @@
- if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists)
- return ArchLinux;
+ /// @}
+ };
-+ if (!llvm::sys::fs::exists("/etc/tld-release", Exists) && Exists)
-+ return TLDLinux;
+diff -urNp -x '*.orig' llvm-11.0.1.src.org/tools/clang/lib/Driver/Distro.cpp llvm-11.0.1.src/tools/clang/lib/Driver/Distro.cpp
+--- llvm-11.0.1.src.org/tools/clang/lib/Driver/Distro.cpp 2020-12-18 20:57:38.000000000 +0100
++++ llvm-11.0.1.src/tools/clang/lib/Driver/Distro.cpp 2021-03-25 22:27:39.173689051 +0100
+@@ -165,6 +165,9 @@ static Distro::DistroType DetectDistro(l
+ if (VFS.exists("/etc/gentoo-release"))
+ return Distro::Gentoo;
+
++ if (VFS.exists("/etc/tld-release"))
++ return Distro::TLDLinux;
+
- return UnknownDistro;
+ return Distro::UnknownDistro;
}
-@@ -2072,7 +2084,7 @@
+diff -urNp -x '*.orig' llvm-11.0.1.src.org/tools/clang/lib/Driver/ToolChains/Gnu.cpp llvm-11.0.1.src/tools/clang/lib/Driver/ToolChains/Gnu.cpp
+--- llvm-11.0.1.src.org/tools/clang/lib/Driver/ToolChains/Gnu.cpp 2020-12-18 20:57:38.000000000 +0100
++++ llvm-11.0.1.src/tools/clang/lib/Driver/ToolChains/Gnu.cpp 2021-03-25 22:27:39.173689051 +0100
+@@ -2048,6 +2048,7 @@ void Generic_GCC::GCCInstallationDetecto
+ // lists should shrink over time. Please don't add more elements to *Triples.
+ static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
+ static const char *const AArch64Triples[] = {
++ "aarch64-tld-linux",
+ "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux",
+ "aarch64-suse-linux"};
+ static const char *const AArch64beLibDirs[] = {"/lib"};
+@@ -2072,6 +2077,7 @@ void Generic_GCC::GCCInstallationDetecto
- LinuxDistro Distro = DetectLinuxDistro(Arch);
+ static const char *const X86_64LibDirs[] = {"/lib64", "/lib"};
+ static const char *const X86_64Triples[] = {
++ "x86_64-tld-linux", "amd64-tld-linux",
+ "x86_64-linux-gnu", "x86_64-unknown-linux-gnu",
+ "x86_64-pc-linux-gnu", "x86_64-redhat-linux6E",
+ "x86_64-redhat-linux", "x86_64-suse-linux",
+@@ -2081,6 +2087,7 @@ void Generic_GCC::GCCInstallationDetecto
+ static const char *const X32LibDirs[] = {"/libx32", "/lib"};
+ static const char *const X86LibDirs[] = {"/lib32", "/lib"};
+ static const char *const X86Triples[] = {
++ "i686-tld-linux",
+ "i586-linux-gnu", "i686-linux-gnu", "i686-pc-linux-gnu",
+ "i386-redhat-linux6E", "i686-redhat-linux", "i386-redhat-linux",
+ "i586-suse-linux", "i686-montavista-linux", "i686-gnu",
+diff -urNp -x '*.orig' llvm-11.0.1.src.org/tools/clang/lib/Driver/ToolChains/Linux.cpp llvm-11.0.1.src/tools/clang/lib/Driver/ToolChains/Linux.cpp
+--- llvm-11.0.1.src.org/tools/clang/lib/Driver/ToolChains/Linux.cpp 2020-12-18 20:57:38.000000000 +0100
++++ llvm-11.0.1.src/tools/clang/lib/Driver/ToolChains/Linux.cpp 2021-03-25 22:27:39.173689051 +0100
+@@ -226,7 +226,7 @@ Linux::Linux(const Driver &D, const llvm
+ ExtraOpts.push_back("now");
+ }
-- if (IsOpenSuse(Distro) || IsUbuntu(Distro)) {
-+ if (IsOpenSuse(Distro) || IsUbuntu(Distro) || IsTLD(Distro)) {
+- if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() ||
++ if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() || Distro.IsTLD() ||
+ Triple.isAndroid()) {
ExtraOpts.push_back("-z");
ExtraOpts.push_back("relro");
- }
-@@ -2088,7 +2100,7 @@
- // ABI requires a mapping between the GOT and the symbol table.
- // Android loader does not support .gnu.hash.
- if (!isMipsArch(Arch) && !IsAndroid) {
-- if (IsRedhat(Distro) || IsOpenSuse(Distro) ||
-+ if (IsRedhat(Distro) || IsOpenSuse(Distro) || IsTLD(Distro) ||
- (IsUbuntu(Distro) && Distro >= UbuntuMaverick))
- ExtraOpts.push_back("--hash-style=gnu");
-
-@@ -2097,11 +2109,11 @@
- ExtraOpts.push_back("--hash-style=both");
- }
-
-- if (IsRedhat(Distro))
-+ if (IsRedhat(Distro) || IsTLD(Distro))
- ExtraOpts.push_back("--no-add-needed");
-
- if (Distro == DebianSqueeze || Distro == DebianWheezy ||
-- IsOpenSuse(Distro) ||
-+ IsOpenSuse(Distro) || IsTLD(Distro) ||
- (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
- (IsUbuntu(Distro) && Distro >= UbuntuKarmic))
- ExtraOpts.push_back("--build-id");