From 678d432a4eebf81f977580bdba763c418a1c63db Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Thu, 20 Jun 2024 14:11:22 +0300 Subject: [PATCH 1/7] [llvm] LLVM 18 initial commit --- llvm | 2 +- rpm/clang.spec | 6 +++--- rpm/llvm.spec | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/llvm b/llvm index 8dfdcc7..3b5b5c1 160000 --- a/llvm +++ b/llvm @@ -1 +1 @@ -Subproject commit 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a +Subproject commit 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff diff --git a/rpm/clang.spec b/rpm/clang.spec index 154881d..c01de27 100644 --- a/rpm/clang.spec +++ b/rpm/clang.spec @@ -1,6 +1,6 @@ -%global maj_ver 15 -%global min_ver 0 -%global patch_ver 7 +%global maj_ver 18 +%global min_ver 1 +%global patch_ver 8 %global clang_tools_binaries \ %{_bindir}/clang-apply-replacements \ diff --git a/rpm/llvm.spec b/rpm/llvm.spec index dcbc179..1b012bc 100644 --- a/rpm/llvm.spec +++ b/rpm/llvm.spec @@ -10,7 +10,7 @@ %endif Name: llvm -Version: 15.0.7 +Version: 18.1.8 Release: 0 Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure) License: University of Illinois/NCSA Open Source License From 090b6cb4ea9104f67ab839ffd00b81463581ed81 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Thu, 20 Jun 2024 22:36:36 +0300 Subject: [PATCH 2/7] [llvm] Update patches to LLVM 18 --- rpm/0001-LLVM-Add-MeeGo-vendor-type.patch | 59 ++++++--------- rpm/0002-Add-Triple-isMeeGo.patch | 19 ++--- rpm/0003-Clang-SailfishOS-toolchain.patch | 73 ++++++------------- ...ind-tables-the-default-for-all-archs.patch | 36 ++++----- ...Disable-out-of-line-atomics-on-MeeGo.patch | 13 +--- 5 files changed, 67 insertions(+), 133 deletions(-) diff --git a/rpm/0001-LLVM-Add-MeeGo-vendor-type.patch b/rpm/0001-LLVM-Add-MeeGo-vendor-type.patch index d0d0e05..ca517ed 100644 --- a/rpm/0001-LLVM-Add-MeeGo-vendor-type.patch +++ b/rpm/0001-LLVM-Add-MeeGo-vendor-type.patch @@ -1,19 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Ruben De Smet -Date: Sun, 26 Jun 2022 10:48:13 +0200 -Subject: [PATCH] LLVM: Add MeeGo vendor type - ---- - llvm/include/llvm/ADT/Triple.h | 3 ++- - llvm/lib/Support/Triple.cpp | 12 ++++++++++++ - llvm/unittests/ADT/TripleTest.cpp | 6 ++++++ - 3 files changed, 20 insertions(+), 1 deletion(-) - -diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h -index 42277c013035..9e36dfd4d2d5 100644 ---- a/llvm/include/llvm/ADT/Triple.h -+++ b/llvm/include/llvm/ADT/Triple.h -@@ -165,7 +165,8 @@ public: +diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h +index 49ec8de9c528..dc195e8dfcfd 100644 +--- a/llvm/include/llvm/TargetParser/Triple.h ++++ b/llvm/include/llvm/TargetParser/Triple.h +@@ -182,7 +182,8 @@ public: Mesa, SUSE, OpenEmbedded, @@ -23,19 +12,19 @@ index 42277c013035..9e36dfd4d2d5 100644 }; enum OSType { UnknownOS, -diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp -index a9afcc9db96a..c4307bf457c7 100644 ---- a/llvm/lib/Support/Triple.cpp -+++ b/llvm/lib/Support/Triple.cpp -@@ -177,6 +177,7 @@ StringRef Triple::getVendorTypeName(VendorType Kind) { +diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp +index 0bbe8a3cedfd..eefd6b90ce2d 100644 +--- a/llvm/lib/TargetParser/Triple.cpp ++++ b/llvm/lib/TargetParser/Triple.cpp +@@ -221,6 +221,7 @@ StringRef Triple::getVendorTypeName(VendorType Kind) { case Freescale: return "fsl"; case IBM: return "ibm"; case ImaginationTechnologies: return "img"; + case MeeGo: return "meego"; case Mesa: return "mesa"; case MipsTechnologies: return "mti"; - case Myriad: return "myriad"; -@@ -507,6 +508,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { + case NVIDIA: return "nvidia"; +@@ -602,6 +603,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { .Case("mesa", Triple::Mesa) .Case("suse", Triple::SUSE) .Case("oe", Triple::OpenEmbedded) @@ -43,7 +32,7 @@ index a9afcc9db96a..c4307bf457c7 100644 .Default(Triple::UnknownVendor); } -@@ -802,6 +804,9 @@ Triple::Triple(const Twine &Str) +@@ -938,6 +940,9 @@ Triple::Triple(const Twine &Str) OS = parseOS(Components[2]); if (Components.size() > 3) { Environment = parseEnvironment(Components[3]); @@ -53,7 +42,7 @@ index a9afcc9db96a..c4307bf457c7 100644 ObjectFormat = parseFormat(Components[3]); } } -@@ -853,6 +858,10 @@ Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr, +@@ -989,6 +994,10 @@ Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr, ObjectFormat(parseFormat(EnvironmentStr.str())) { if (ObjectFormat == Triple::UnknownObjectFormat) ObjectFormat = getDefaultFormat(*this); @@ -64,21 +53,21 @@ index a9afcc9db96a..c4307bf457c7 100644 } std::string Triple::normalize(StringRef Str) { -@@ -1103,6 +1112,9 @@ static VersionTuple parseVersionFromName(StringRef Name) { - VersionTuple Triple::getEnvironmentVersion() const { +@@ -1220,6 +1229,9 @@ VersionTuple Triple::getEnvironmentVersion() const { + StringRef Triple::getEnvironmentVersionString() const { StringRef EnvironmentName = getEnvironmentName(); StringRef EnvironmentTypeName = getEnvironmentTypeName(getEnvironment()); + // MeeGo uses "gnueabi" to mean "gnueabihf" + if (Vendor == Triple::MeeGo && getEnvironment() == Triple::GNUEABIHF) + EnvironmentTypeName = "gnueabi"; - if (EnvironmentName.startswith(EnvironmentTypeName)) - EnvironmentName = EnvironmentName.substr(EnvironmentTypeName.size()); - -diff --git a/llvm/unittests/ADT/TripleTest.cpp b/llvm/unittests/ADT/TripleTest.cpp -index 3006ab6d40e8..7a28ed624232 100644 ---- a/llvm/unittests/ADT/TripleTest.cpp -+++ b/llvm/unittests/ADT/TripleTest.cpp -@@ -384,6 +384,12 @@ TEST(TripleTest, ParsedIDs) { + EnvironmentName.consume_front(EnvironmentTypeName); + return EnvironmentName; + } +diff --git a/llvm/unittests/TargetParser/TripleTest.cpp b/llvm/unittests/TargetParser/TripleTest.cpp +index 4db54a08c0f6..5199caabf224 100644 +--- a/llvm/unittests/TargetParser/TripleTest.cpp ++++ b/llvm/unittests/TargetParser/TripleTest.cpp +@@ -642,6 +642,12 @@ TEST(TripleTest, ParsedIDs) { EXPECT_EQ(Triple::Linux, T.getOS()); EXPECT_EQ(Triple::GNUEABI, T.getEnvironment()); diff --git a/rpm/0002-Add-Triple-isMeeGo.patch b/rpm/0002-Add-Triple-isMeeGo.patch index dee2066..7b7a32a 100644 --- a/rpm/0002-Add-Triple-isMeeGo.patch +++ b/rpm/0002-Add-Triple-isMeeGo.patch @@ -1,17 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Ruben De Smet -Date: Sun, 26 Jun 2022 10:41:44 +0200 -Subject: [PATCH] Add Triple::isMeeGo() - ---- - llvm/include/llvm/ADT/Triple.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h -index 9e36dfd4d2d5..8e66888615ff 100644 ---- a/llvm/include/llvm/ADT/Triple.h -+++ b/llvm/include/llvm/ADT/Triple.h -@@ -657,6 +657,9 @@ public: +diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h +index dc195e8dfcfd..59f58657cae0 100644 +--- a/llvm/include/llvm/TargetParser/Triple.h ++++ b/llvm/include/llvm/TargetParser/Triple.h +@@ -744,6 +744,9 @@ public: /// Tests whether the target is Android bool isAndroid() const { return getEnvironment() == Triple::Android; } diff --git a/rpm/0003-Clang-SailfishOS-toolchain.patch b/rpm/0003-Clang-SailfishOS-toolchain.patch index b83c8fd..d156ad2 100644 --- a/rpm/0003-Clang-SailfishOS-toolchain.patch +++ b/rpm/0003-Clang-SailfishOS-toolchain.patch @@ -1,21 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Ruben De Smet -Date: Sun, 26 Jun 2022 10:57:51 +0200 -Subject: [PATCH] Clang: SailfishOS toolchain - -Signed-off-by: Ruben De Smet ---- - clang/include/clang/Driver/Distro.h | 5 +++++ - clang/lib/Driver/Distro.cpp | 3 +++ - clang/lib/Driver/ToolChains/Gnu.cpp | 4 +++- - clang/lib/Driver/ToolChains/Linux.cpp | 8 ++++---- - 4 files changed, 15 insertions(+), 5 deletions(-) - diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h -index 2723f75e8945..58616ad541e1 100644 +index a8de94163e8b..240587994938 100644 --- a/clang/include/clang/Driver/Distro.h +++ b/clang/include/clang/Driver/Distro.h -@@ -45,6 +45,7 @@ public: +@@ -46,6 +46,7 @@ public: Fedora, Gentoo, OpenSUSE, @@ -23,8 +10,8 @@ index 2723f75e8945..58616ad541e1 100644 UbuntuHardy, UbuntuIntrepid, UbuntuJaunty, -@@ -124,6 +125,10 @@ public: - return DistroVal >= DebianLenny && DistroVal <= DebianBookworm; +@@ -129,6 +130,10 @@ public: + return DistroVal >= DebianLenny && DistroVal <= DebianTrixie; } + bool IsSailfish() const { @@ -32,13 +19,13 @@ index 2723f75e8945..58616ad541e1 100644 + } + bool IsUbuntu() const { - return DistroVal >= UbuntuHardy && DistroVal <= UbuntuJammy; + return DistroVal >= UbuntuHardy && DistroVal <= UbuntuNoble; } diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp -index 5ac38c34d112..cccb2026e527 100644 +index a7e7f169dc14..cd8684020dfe 100644 --- a/clang/lib/Driver/Distro.cpp +++ b/clang/lib/Driver/Distro.cpp -@@ -197,6 +197,9 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) { +@@ -204,6 +204,9 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) { if (VFS.exists("/etc/gentoo-release")) return Distro::Gentoo; @@ -49,10 +36,10 @@ index 5ac38c34d112..cccb2026e527 100644 } diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 7a9570a686f4..e7f57c824961 100644 +index e5e1b1d77269..3d0d38972977 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2073,7 +2073,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( +@@ -2452,7 +2452,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( static const char *const AArch64LibDirs[] = {"/lib64", "/lib"}; static const char *const AArch64Triples[] = { "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux", @@ -61,7 +48,7 @@ index 7a9570a686f4..e7f57c824961 100644 static const char *const AArch64beLibDirs[] = {"/lib"}; static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu", "aarch64_be-linux-gnu"}; -@@ -2082,6 +2082,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( +@@ -2461,6 +2461,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( static const char *const ARMTriples[] = {"arm-linux-gnueabi"}; static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", "armv7hl-redhat-linux-gnueabi", @@ -69,19 +56,11 @@ index 7a9570a686f4..e7f57c824961 100644 "armv6hl-suse-linux-gnueabi", "armv7hl-suse-linux-gnueabi"}; static const char *const ARMebLibDirs[] = {"/lib"}; -@@ -2108,6 +2109,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - "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", -+ "i486-meego-linux" - }; - - static const char *const M68kLibDirs[] = {"/lib"}; diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 83cb41159de7..e7c2dcaef02a 100644 +index 4300a2bdff17..8ac052972ebb 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -194,7 +194,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) +@@ -232,7 +232,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) } if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() || @@ -90,28 +69,22 @@ index 83cb41159de7..e7c2dcaef02a 100644 ExtraOpts.push_back("-z"); ExtraOpts.push_back("relro"); } -@@ -233,13 +233,13 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) +@@ -275,7 +275,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) // Hexagon linker/loader does not support .gnu.hash if (!IsMips && !IsHexagon) { - if (Distro.IsRedhat() || Distro.IsOpenSUSE() || Distro.IsAlpineLinux() || -- (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick) || -+ (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick) || Distro.IsSailfish() || - (IsAndroid && !Triple.isAndroidVersionLT(23))) - ExtraOpts.push_back("--hash-style=gnu"); - - if (Distro.IsDebian() || Distro.IsOpenSUSE() || - Distro == Distro::UbuntuLucid || Distro == Distro::UbuntuJaunty || -- Distro == Distro::UbuntuKarmic || -+ Distro == Distro::UbuntuKarmic || Distro.IsSailfish() || + if (Distro.IsOpenSUSE() || Distro == Distro::UbuntuLucid || +- Distro == Distro::UbuntuJaunty || Distro == Distro::UbuntuKarmic || ++ Distro == Distro::UbuntuJaunty || Distro == Distro::UbuntuKarmic || Distro.IsSailfish() || (IsAndroid && Triple.isAndroidVersionLT(23))) ExtraOpts.push_back("--hash-style=both"); - } -@@ -248,7 +248,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + else +@@ -286,6 +286,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) ExtraOpts.push_back("--build-id"); #endif -- if (IsAndroid || Distro.IsOpenSUSE()) -+ if (IsAndroid || Distro.IsOpenSUSE() || Distro.IsSailfish()) - ExtraOpts.push_back("--enable-new-dtags"); - ++ if (Distro.IsSailfish()) ++ ExtraOpts.push_back("--enable-new-dtags"); ++ // The selection of paths to try here is designed to match the patterns which + // the GCC driver itself uses, as this is part of the GCC-compatible driver. + // This was determined by running GCC in a fake filesystem, creating all diff --git a/rpm/0004-Make-funwind-tables-the-default-for-all-archs.patch b/rpm/0004-Make-funwind-tables-the-default-for-all-archs.patch index d864221..aaebc6e 100644 --- a/rpm/0004-Make-funwind-tables-the-default-for-all-archs.patch +++ b/rpm/0004-Make-funwind-tables-the-default-for-all-archs.patch @@ -1,37 +1,27 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: serge-sans-paille -Date: Tue, 10 Dec 2019 09:18:03 +0000 -Subject: [PATCH] Make -funwind-tables the default for all archs - ---- - clang/lib/Driver/ToolChain.cpp | 2 +- - clang/lib/Driver/ToolChains/Gnu.cpp | 3 +++ - 2 files changed, 4 insertions(+), 1 deletion(-) - diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp -index d657d21bfcdb..eac667382fa9 100644 +index 388030592b48..264a849da435 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp -@@ -258,7 +258,7 @@ std::string ToolChain::getInputFilename(const InputInfo &Input) const { - } +@@ -424,7 +424,7 @@ std::string ToolChain::getInputFilename(const InputInfo &Input) const { - bool ToolChain::IsUnwindTablesDefault(const ArgList &Args) const { -- return false; -+ return true; + ToolChain::UnwindTableLevel + ToolChain::getDefaultUnwindTableLevel(const ArgList &Args) const { +- return UnwindTableLevel::None; ++ return UnwindTableLevel::Asynchronous; } - Tool *ToolChain::getClang() const { + unsigned ToolChain::GetDefaultDwarfVersion() const { diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index e7f57c824961..9c44b2e741ce 100644 +index 3d0d38972977..b4b35b753a1c 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2692,6 +2692,9 @@ void Generic_GCC::printVerboseInfo(raw_ostream &OS) const { - } +@@ -3088,6 +3088,9 @@ void Generic_GCC::printVerboseInfo(raw_ostream &OS) const { - bool Generic_GCC::IsUnwindTablesDefault(const ArgList &Args) const { + ToolChain::UnwindTableLevel + Generic_GCC::getDefaultUnwindTableLevel(const ArgList &Args) const { + if (getTriple().isMeeGo()) { -+ return true; ++ return UnwindTableLevel::Asynchronous; + } switch (getArch()) { case llvm::Triple::aarch64: - case llvm::Triple::ppc: + case llvm::Triple::aarch64_be: diff --git a/rpm/0005-Disable-out-of-line-atomics-on-MeeGo.patch b/rpm/0005-Disable-out-of-line-atomics-on-MeeGo.patch index 0515926..695db93 100644 --- a/rpm/0005-Disable-out-of-line-atomics-on-MeeGo.patch +++ b/rpm/0005-Disable-out-of-line-atomics-on-MeeGo.patch @@ -1,17 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Ruben De Smet -Date: Sun, 26 Jun 2022 10:42:13 +0200 -Subject: [PATCH] Disable out-of-line atomics on MeeGo - ---- - clang/lib/Driver/ToolChains/Linux.cpp | 2 ++ - 1 file changed, 2 insertions(+) - diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index e7c2dcaef02a..9b377eca9dc8 100644 +index 8ac052972ebb..59a6b6555249 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -672,6 +672,8 @@ bool Linux::IsAArch64OutlineAtomicsDefault(const ArgList &Args) const { +@@ -761,6 +761,8 @@ bool Linux::IsAArch64OutlineAtomicsDefault(const ArgList &Args) const { // and libgcc since 9.3.1 assert(getTriple().isAArch64() && "expected AArch64 target!"); ToolChain::RuntimeLibType RtLib = GetRuntimeLibType(Args); From 7ea610c3ab965111afa35e21969ffa39becc149b Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Fri, 21 Jun 2024 15:14:32 +0300 Subject: [PATCH 3/7] [llvm] Disable tests due to missing llvm-gtest --- rpm/clang.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpm/clang.spec b/rpm/clang.spec index c01de27..b25593e 100644 --- a/rpm/clang.spec +++ b/rpm/clang.spec @@ -173,7 +173,8 @@ pushd build -DSPHINX_WARNINGS_AS_ERRORS=OFF \ -DBUILD_SHARED_LIBS=OFF \ -DCLANG_BUILD_EXAMPLES:BOOL=OFF \ - -DCLANG_DEFAULT_UNWINDLIB=libgcc + -DCLANG_DEFAULT_UNWINDLIB=libgcc \ + -DLLVM_INCLUDE_TESTS=OFF %ninja_build popd From 7fff940669e9f8b6868188c6b60714f1b351fa23 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Thu, 13 Jun 2024 22:13:18 +0300 Subject: [PATCH 4/7] [llvm] Use identical %prep blocks --- rpm/llvm.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rpm/llvm.spec b/rpm/llvm.spec index 1b012bc..be1e5e2 100644 --- a/rpm/llvm.spec +++ b/rpm/llvm.spec @@ -56,6 +56,9 @@ LLVM Header files %prep %autosetup -p1 -n %{name}-%{version}/%{name} +# symlink clang extra tools to enable build +ln -s ../../clang-tools-extra clang/tools/extra || : + %build pushd llvm From 9b95c7058d09f2e18395002742498c765755c219 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Sat, 22 Jun 2024 01:44:30 +0300 Subject: [PATCH 5/7] [llvm] Changed binaries --- rpm/clang.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rpm/clang.spec b/rpm/clang.spec index b25593e..5b40c8e 100644 --- a/rpm/clang.spec +++ b/rpm/clang.spec @@ -3,19 +3,19 @@ %global patch_ver 8 %global clang_tools_binaries \ + %{_bindir}/amdgpu-arch \ %{_bindir}/clang-apply-replacements \ %{_bindir}/clang-change-namespace \ %{_bindir}/clang-check \ %{_bindir}/clang-doc \ %{_bindir}/clang-extdef-mapping \ %{_bindir}/clang-format \ + %{_bindir}/clang-include-cleaner \ %{_bindir}/clang-include-fixer \ %{_bindir}/clang-linker-wrapper \ %{_bindir}/clang-move \ - %{_bindir}/clang-nvlink-wrapper \ %{_bindir}/clang-offload-bundler \ %{_bindir}/clang-offload-packager \ - %{_bindir}/clang-offload-wrapper \ %{_bindir}/clang-pseudo \ %{_bindir}/clang-query \ %{_bindir}/clang-refactor \ @@ -27,6 +27,7 @@ %{_bindir}/clangd \ %{_bindir}/diagtool \ %{_bindir}/hmaptool \ + %{_bindir}/nvptx-arch \ %{_bindir}/pp-trace \ %{_bindir}/run-clang-tidy From 5143bdfebf6dff2271a23b7b15667557a142c48b Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Sat, 22 Jun 2024 15:43:08 +0300 Subject: [PATCH 6/7] [llvm] Don't hardcode lib dir --- rpm/clang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpm/clang.spec b/rpm/clang.spec index 5b40c8e..01d70ca 100644 --- a/rpm/clang.spec +++ b/rpm/clang.spec @@ -190,7 +190,7 @@ pushd clang mkdir -p %{buildroot}%{python3_sitelib}/clang/ # install scanbuild-py to python sitelib. -mv %{buildroot}%{_prefix}/lib/{libear,libscanbuild} %{buildroot}%{python3_sitelib} +mv %{buildroot}/%{_libdir}/{libear,libscanbuild} %{buildroot}%{python3_sitelib} # remove editor integrations (bbedit, sublime, emacs, vim) rm -vf %{buildroot}%{_datadir}/clang/clang-format-bbedit.applescript From 497c0829c0f052e450f24c03d071761397715cf9 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Sun, 23 Jun 2024 11:01:30 +0300 Subject: [PATCH 7/7] [llvm] Remove unneeded atomic patches due to updated GCC --- rpm/0005-Disable-out-of-line-atomics-on-MeeGo.patch | 13 ------------- rpm/clang.spec | 1 - rpm/llvm.spec | 1 - 3 files changed, 15 deletions(-) delete mode 100644 rpm/0005-Disable-out-of-line-atomics-on-MeeGo.patch diff --git a/rpm/0005-Disable-out-of-line-atomics-on-MeeGo.patch b/rpm/0005-Disable-out-of-line-atomics-on-MeeGo.patch deleted file mode 100644 index 695db93..0000000 --- a/rpm/0005-Disable-out-of-line-atomics-on-MeeGo.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 8ac052972ebb..59a6b6555249 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -761,6 +761,8 @@ bool Linux::IsAArch64OutlineAtomicsDefault(const ArgList &Args) const { - // and libgcc since 9.3.1 - assert(getTriple().isAArch64() && "expected AArch64 target!"); - ToolChain::RuntimeLibType RtLib = GetRuntimeLibType(Args); -+ if (getTriple().isMeeGo()) -+ return false; - if (RtLib == ToolChain::RLT_CompilerRT) - return true; - assert(RtLib == ToolChain::RLT_Libgcc && "unexpected runtime library type!"); diff --git a/rpm/clang.spec b/rpm/clang.spec index 01d70ca..6b4a417 100644 --- a/rpm/clang.spec +++ b/rpm/clang.spec @@ -51,7 +51,6 @@ Patch1: 0001-LLVM-Add-MeeGo-vendor-type.patch Patch2: 0002-Add-Triple-isMeeGo.patch Patch3: 0003-Clang-SailfishOS-toolchain.patch Patch4: 0004-Make-funwind-tables-the-default-for-all-archs.patch -Patch5: 0005-Disable-out-of-line-atomics-on-MeeGo.patch BuildRequires: gcc BuildRequires: gcc-c++ diff --git a/rpm/llvm.spec b/rpm/llvm.spec index be1e5e2..b8b50a9 100644 --- a/rpm/llvm.spec +++ b/rpm/llvm.spec @@ -21,7 +21,6 @@ Patch1: 0001-LLVM-Add-MeeGo-vendor-type.patch Patch2: 0002-Add-Triple-isMeeGo.patch Patch3: 0003-Clang-SailfishOS-toolchain.patch Patch4: 0004-Make-funwind-tables-the-default-for-all-archs.patch -Patch5: 0005-Disable-out-of-line-atomics-on-MeeGo.patch Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig