]> TLD Linux GIT Repositories - packages/llvm.git/blob - llvm-tld.patch
- merged 17.0.4 from PLD
[packages/llvm.git] / llvm-tld.patch
1 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
2 --- llvm-11.0.1.src.org/tools/clang/include/clang/Driver/Distro.h       2020-12-18 20:57:38.000000000 +0100
3 +++ llvm-11.0.1.src/tools/clang/include/clang/Driver/Distro.h   2021-03-25 22:27:39.173689051 +0100
4 @@ -28,6 +28,7 @@ public:
5      // the first and last known member in the family, e.g. IsRedHat().
6      AlpineLinux,
7      ArchLinux,
8 +    TLDLinux,
9      DebianLenny,
10      DebianSqueeze,
11      DebianWheezy,
12 @@ -132,6 +133,10 @@ public:
13  
14    bool IsGentoo() const { return DistroVal == Gentoo; }
15  
16 +  bool IsTLD() {
17 +    return DistroVal == TLDLinux;
18 +  }
19 +
20    /// @}
21  };
22  
23 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
24 --- llvm-11.0.1.src.org/tools/clang/lib/Driver/Distro.cpp       2020-12-18 20:57:38.000000000 +0100
25 +++ llvm-11.0.1.src/tools/clang/lib/Driver/Distro.cpp   2021-03-25 22:27:39.173689051 +0100
26 @@ -165,6 +165,9 @@ static Distro::DistroType DetectDistro(l
27    if (VFS.exists("/etc/gentoo-release"))
28      return Distro::Gentoo;
29  
30 +  if (VFS.exists("/etc/tld-release"))
31 +    return Distro::TLDLinux;
32 +
33    return Distro::UnknownDistro;
34  }
35  
36 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
37 --- llvm-11.0.1.src.org/tools/clang/lib/Driver/ToolChains/Gnu.cpp       2020-12-18 20:57:38.000000000 +0100
38 +++ llvm-11.0.1.src/tools/clang/lib/Driver/ToolChains/Gnu.cpp   2021-03-25 22:27:39.173689051 +0100
39 @@ -2048,6 +2048,7 @@ void Generic_GCC::GCCInstallationDetecto
40    // lists should shrink over time. Please don't add more elements to *Triples.
41    static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
42    static const char *const AArch64Triples[] = {
43 +      "aarch64-tld-linux",
44        "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux",
45        "aarch64-suse-linux"};
46    static const char *const AArch64beLibDirs[] = {"/lib"};
47 @@ -2072,6 +2077,7 @@ void Generic_GCC::GCCInstallationDetecto
48  
49    static const char *const X86_64LibDirs[] = {"/lib64", "/lib"};
50    static const char *const X86_64Triples[] = {
51 +      "x86_64-tld-linux", "amd64-tld-linux",
52        "x86_64-linux-gnu",       "x86_64-unknown-linux-gnu",
53        "x86_64-pc-linux-gnu",    "x86_64-redhat-linux6E",
54        "x86_64-redhat-linux",    "x86_64-suse-linux",
55 @@ -2081,6 +2087,7 @@ void Generic_GCC::GCCInstallationDetecto
56    static const char *const X32LibDirs[] = {"/libx32", "/lib"};
57    static const char *const X86LibDirs[] = {"/lib32", "/lib"};
58    static const char *const X86Triples[] = {
59 +      "i686-tld-linux",
60        "i586-linux-gnu",      "i686-linux-gnu",        "i686-pc-linux-gnu",
61        "i386-redhat-linux6E", "i686-redhat-linux",     "i386-redhat-linux",
62        "i586-suse-linux",     "i686-montavista-linux", "i686-gnu",
63 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
64 --- llvm-11.0.1.src.org/tools/clang/lib/Driver/ToolChains/Linux.cpp     2020-12-18 20:57:38.000000000 +0100
65 +++ llvm-11.0.1.src/tools/clang/lib/Driver/ToolChains/Linux.cpp 2021-03-25 22:27:39.173689051 +0100
66 @@ -226,7 +226,7 @@ Linux::Linux(const Driver &D, const llvm
67      ExtraOpts.push_back("now");
68    }
69  
70 -  if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() ||
71 +  if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() || Distro.IsTLD() ||
72        Triple.isAndroid()) {
73      ExtraOpts.push_back("-z");
74      ExtraOpts.push_back("relro");