X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=llvm-pld.patch;h=cd84f6ac7c5251b6c1728a0618ec87a4d5f46ece;hb=8d52ede4adea642c397c0a2a6d017de124ebb451;hp=01087c9dece9662566536024e39a1a6b581ce1da;hpb=5013c7ea5bfa6d75bac9b0015612f2c2afdddcb6;p=packages%2Fllvm.git diff --git a/llvm-pld.patch b/llvm-pld.patch index 01087c9..cd84f6a 100644 --- a/llvm-pld.patch +++ b/llvm-pld.patch @@ -1,6 +1,67 @@ ---- llvm-4.0.1.src/tools/clang/lib/Driver/ToolChains.cpp.orig 2017-05-31 12:01:14.000000000 +0200 -+++ llvm-4.0.1.src/tools/clang/lib/Driver/ToolChains.cpp 2017-12-10 08:33:21.873800345 +0100 -@@ -1549,6 +1549,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, ++ PLDLinux, + DebianLenny, + DebianSqueeze, + DebianWheezy, +@@ -132,6 +133,10 @@ public: + + bool IsGentoo() const { return DistroVal == Gentoo; } + ++ bool IsPLD() { ++ return DistroVal == PLDLinux; ++ } ++ + /// @} + }; + +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/pld-release")) ++ return Distro::PLDLinux; ++ + return Distro::UnknownDistro; + } + +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 + // lifetime or initialization issues. + static const char *const AArch64LibDirs[] = {"/lib64", "/lib"}; + static const char *const AArch64Triples[] = { ++ "aarch64-pld-linux", + "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux", + "aarch64-suse-linux", "aarch64-linux-android"}; + static const char *const AArch64beLibDirs[] = {"/lib"}; +@@ -2055,9 +2056,14 @@ void Generic_GCC::GCCInstallationDetecto + "aarch64_be-linux-gnu"}; + + static const char *const ARMLibDirs[] = {"/lib"}; +- static const char *const ARMTriples[] = {"arm-linux-gnueabi", ++ static const char *const ARMTriples[] = {"arm-pld-linux-gnueabi", ++ "arm-linux-gnueabi", + "arm-linux-androideabi"}; +- static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", ++ static const char *const ARMHFTriples[] = {"arm-pld-linux-gnueabihf", ++ "armv6hl-pld-linux-gnueabi", ++ "armv7hl-pld-linux-gnueabi", ++ "armv7hnl-pld-linux-gnueabi", ++ "arm-linux-gnueabihf", + "armv7hl-redhat-linux-gnueabi", + "armv6hl-suse-linux-gnueabi", + "armv7hl-suse-linux-gnueabi"}; +@@ -2072,6 +2077,7 @@ void Generic_GCC::GCCInstallationDetecto static const char *const X86_64LibDirs[] = {"/lib64", "/lib"}; static const char *const X86_64Triples[] = { @@ -8,24 +69,24 @@ "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", -@@ -1558,6 +1559,7 @@ - static const char *const X32LibDirs[] = {"/libx32"}; +@@ -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-pld-linux", "i586-pld-linux", "i486-pld-linux", "i386-pld-linux", "athlon-pld-linux", - "i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu", - "i386-linux-gnu", "i386-redhat-linux6E", "i686-redhat-linux", - "i586-redhat-linux", "i386-redhat-linux", "i586-suse-linux", -@@ -1591,6 +1593,7 @@ + "i586-linux-gnu", "i686-linux-gnu", + "i686-pc-linux-gnu", "i386-redhat-linux6E", + "i686-redhat-linux", "i386-redhat-linux", +@@ -2121,6 +2128,7 @@ void Generic_GCC::GCCInstallationDetecto static const char *const PPCLibDirs[] = {"/lib32", "/lib"}; static const char *const PPCTriples[] = { + "powerpc-pld-linux", "powerpc-linux-gnu", "powerpc-unknown-linux-gnu", "powerpc-linux-gnuspe", - "powerpc-suse-linux", "powerpc-montavista-linuxspe"}; - static const char *const PPC64LibDirs[] = {"/lib64", "/lib"}; -@@ -1603,14 +1606,14 @@ - "powerpc64le-suse-linux", "ppc64le-redhat-linux"}; + // On 32-bit PowerPC systems running SUSE Linux, gcc is configured as a + // 64-bit compiler which defaults to "-m32", hence "powerpc64-suse-linux". +@@ -2146,14 +2154,14 @@ void Generic_GCC::GCCInstallationDetecto + "riscv64-suse-linux"}; static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"}; - static const char *const SPARCv8Triples[] = {"sparc-linux-gnu", @@ -42,65 +103,24 @@ "s390x-linux-gnu", "s390x-unknown-linux-gnu", "s390x-ibm-linux-gnu", "s390x-suse-linux", "s390x-redhat-linux"}; -@@ -4112,7 +4115,7 @@ - - Distro Distro(D.getVFS()); +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 (Distro.IsOpenSUSE() || Distro.IsUbuntu()) { -+ if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsPLD()) { +- if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() || ++ if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() || Distro.IsPLD() || + Triple.isAndroid()) { ExtraOpts.push_back("-z"); ExtraOpts.push_back("relro"); - } -@@ -4132,7 +4135,7 @@ - // ABI requires a mapping between the GOT and the symbol table. - // Android loader does not support .gnu.hash. - if (!IsMips && !IsAndroid) { -- if (Distro.IsRedhat() || Distro.IsOpenSUSE() || -+ if (Distro.IsRedhat() || Distro.IsOpenSUSE() || Distro.IsPLD() || - (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick)) +@@ -266,7 +266,7 @@ Linux::Linux(const Driver &D, const llvm + // Android loader does not support .gnu.hash until API 23. + // Hexagon linker/loader does not support .gnu.hash + if (!IsMips && !IsHexagon) { +- if (Distro.IsRedhat() || Distro.IsOpenSUSE() || Distro.IsAlpineLinux() || ++ if (Distro.IsRedhat() || Distro.IsOpenSUSE() || Distro.IsAlpineLinux() || Distro.IsPLD() || + (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick) || + (IsAndroid && !Triple.isAndroidVersionLT(23))) ExtraOpts.push_back("--hash-style=gnu"); - -@@ -4141,7 +4144,7 @@ - ExtraOpts.push_back("--hash-style=both"); - } - -- if (Distro.IsRedhat() && Distro != Distro::RHEL5 && Distro != Distro::RHEL6) -+ if ((Distro.IsRedhat() && Distro != Distro::RHEL5 && Distro != Distro::RHEL6) || Distro.IsPLD()) - ExtraOpts.push_back("--no-add-needed"); - - #ifdef ENABLE_LINKER_BUILD_ID ---- llvm-4.0.1.src/tools/clang/include/clang/Driver/Distro.h.orig 2016-11-28 22:11:14.000000000 +0100 -+++ llvm-4.0.1.src/tools/clang/include/clang/Driver/Distro.h 2017-12-10 08:31:15.017135111 +0100 -@@ -27,6 +27,7 @@ - // in this enum, because some tests are done by integer comparison against - // the first and last known member in the family, e.g. IsRedHat(). - ArchLinux, -+ PLDLinux, - DebianLenny, - DebianSqueeze, - DebianWheezy, -@@ -112,7 +113,11 @@ - bool IsUbuntu() const { - return DistroVal >= UbuntuHardy && DistroVal <= UbuntuZesty; - } -- -+ -+ bool IsPLD() const { -+ return DistroVal == PLDLinux; -+ } -+ - /// @} - }; - ---- llvm-4.0.1.src/tools/clang/lib/Driver/Distro.cpp.orig 2016-11-28 22:11:18.000000000 +0100 -+++ llvm-4.0.1.src/tools/clang/lib/Driver/Distro.cpp 2017-12-10 08:32:15.883801082 +0100 -@@ -128,6 +128,9 @@ - if (VFS.exists("/etc/arch-release")) - return Distro::ArchLinux; - -+ if (VFS.exists("/etc/pld-release")) -+ return Distro::PLDLinux; -+ - return Distro::UnknownDistro; - } -