From 4eb9a9b2bca2d435882dd22053ea8007e1bc2b27 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Thu, 13 Jun 2024 22:03:40 +0300 Subject: [PATCH 1/5] Revert "Fix compiling clang on i486" This reverts commit 53a5f370650c6237e5d2c52d89304a3c906924cc. --- rpm/clang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpm/clang.spec b/rpm/clang.spec index 2e7b7e2..dcaa61d 100644 --- a/rpm/clang.spec +++ b/rpm/clang.spec @@ -153,7 +153,7 @@ pushd build %endif -DCLANG_INCLUDE_TESTS:BOOL=OFF \ -DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \ -%ifarch aarch64 +%if 0%{?__isa_bits} == 64 -DLLVM_LIBDIR_SUFFIX=64 \ %else -DLLVM_LIBDIR_SUFFIX= \ From afb389a8f6258ffd9572cdb6d1458d5f1dca0ad9 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Thu, 13 Jun 2024 22:05:19 +0300 Subject: [PATCH 2/5] [llvm] Changed binaries in clang 16 --- rpm/clang.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rpm/clang.spec b/rpm/clang.spec index dcaa61d..a9bdfe5 100644 --- a/rpm/clang.spec +++ b/rpm/clang.spec @@ -3,19 +3,19 @@ %global patch_ver 6 %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 38fd43e652203330f661e23e9e663175c7d8623f Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Thu, 13 Jun 2024 22:05:34 +0300 Subject: [PATCH 3/5] [llvm] Fix hardcoded lib dir --- rpm/clang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpm/clang.spec b/rpm/clang.spec index a9bdfe5..b6de3e9 100644 --- a/rpm/clang.spec +++ b/rpm/clang.spec @@ -189,7 +189,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 6b95e9fee009ce3525e039379d8eb5d3ff5f6e16 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Thu, 13 Jun 2024 22:08:40 +0300 Subject: [PATCH 4/5] [llvm] Remove unneeded atomic patches due to updated GCC Co-authored-by: Ruben De Smet --- ...Disable-out-of-line-atomics-on-MeeGo.patch | 23 ------------------- rpm/clang.spec | 1 - rpm/llvm.spec | 1 - 3 files changed, 25 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 32e02db..0000000 --- a/rpm/0005-Disable-out-of-line-atomics-on-MeeGo.patch +++ /dev/null @@ -1,23 +0,0 @@ -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 - -Co-authored-by: Matti Viljanen ---- - 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 72ef4fff4400f08cf429c1072f7edb69d8e440f5..8ede9b7ce1fd234718390c3b4356521c0763950d 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -725,6 +725,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 b6de3e9..a2dd43f 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 147394a..2e4e1f7 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 From ff097648234bd7e9554fdfe883e007445d048a31 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Thu, 13 Jun 2024 22:13:18 +0300 Subject: [PATCH 5/5] [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 2e4e1f7..be54c84 100644 --- a/rpm/llvm.spec +++ b/rpm/llvm.spec @@ -55,6 +55,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