From 8e9c6ef226a5b39398cfb14cc18378f450cde981 Mon Sep 17 00:00:00 2001 From: liyunfei Date: Wed, 15 Oct 2025 11:32:55 +0800 Subject: [PATCH 1/2] Revert "replace os_version with dist" & default os_version to 2403 This reverts commit 76b235ab2fe5efbc04473054c467f218d67ac1c7. (cherry picked from commit f6e34670dd37a35e8cdf487567f49e0dcb122236) --- llvm-toolset-18.spec | 50 +++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/llvm-toolset-18.spec b/llvm-toolset-18.spec index d98a413..197393f 100644 --- a/llvm-toolset-18.spec +++ b/llvm-toolset-18.spec @@ -4,21 +4,19 @@ %global min_ver 1 %global patch_ver 8 -%if "%dist" == "%nil" -%global dist .oe2403 -%endif +%global os_version %{lua: print(tonumber(rpm.expand("%{dist}"):match("oe(%d+)") or 2403))} # Build sys_llvm packages or compat packages %bcond_with sys_llvm %bcond_with check -%if "%dist" < ".oe2403" +%if %{os_version} <= 2203 %bcond_with toolchain_clang %else %bcond_without toolchain_clang %endif # mlir requires pybind11-2.9 but 22.03 only have pybind11-2.8 -%if "%dist" < ".oe2403" +%if %{os_version} <= 2203 %bcond_with mlir %else %bcond_without mlir @@ -81,7 +79,7 @@ %global llvm_triple %{_host} %global build_src_dir %{_builddir}/%{src_tarball_dir} -%if "%dist" < ".oe2503" +%if %{os_version} <= 2403 %global build_dir _build %else %global build_dir llvm/%{_vpath_builddir} @@ -151,7 +149,7 @@ #region main package Name: llvm-toolset-%{maj_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 8 +Release: 9 Summary: The Low Level Virtual Machine License: NCSA @@ -184,7 +182,7 @@ BuildRequires: python3-devel BuildRequires: python3-psutil BuildRequires: python3-sphinx BuildRequires: python3-setuptools -%if %{maj_ver} >= 18 && "%dist" >= ".oe2403" +%if %{maj_ver} >= 18 && %{os_version} > 2203 BuildRequires: python3-myst-parser %endif %if %{with toolchain_clang} @@ -815,7 +813,7 @@ export ASMFLAGS="%{build_cflags}" -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \\\ -DLLVM_BUILD_DOCS:BOOL=ON -%if "%dist" < ".oe2403" && %{maj_ver} >= 18 +%if %{os_version} <= 2203 && %{maj_ver} >= 18 %global cmake_config_args %{cmake_config_args} \\\ -DLLVM_ENABLE_SPHINX:BOOL=OFF %else @@ -975,7 +973,7 @@ export ASMFLAGS="%{build_cflags}" extra_cmake_args='' #endregion cmake options -%if "%dist" < ".oe2503" +%if %{os_version} <= 2403 mkdir _build cd _build %define __cmake_in_source_build 1 @@ -1008,7 +1006,7 @@ cd llvm # /usr/lib64/libomptarget-amdgpu-*.bc # /usr/lib64/libomptarget-nvptx-*.bc -%if "%dist" >= ".oe2403" +%if %{os_version} >= 2403 %build_tool %cmake_target_opts runtimes @@ -1048,7 +1046,7 @@ cd %{build_src_dir}/_build_libcxx -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON \ -DLLVM_BUILD_DOCS=ON \ -%if "%dist" < ".oe2403" && %{maj_ver} >= 18 +%if %{os_version} <= 2203 && %{maj_ver} >= 18 -DLLVM_ENABLE_SPHINX=OFF \ %else -DLLVM_ENABLE_SPHINX=ON \ @@ -1127,7 +1125,7 @@ cd %{build_src_dir}/_build_compiler-rt -DCMAKE_SKIP_RPATH:BOOL=ON \ -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF # could be on? -%if "%dist" < ".oe2409" +%if %{os_version} <= 2403 %make_build %else %build_tool @@ -1141,7 +1139,7 @@ cd %{build_src_dir} %install #region LLVM installation -%if "%dist" < ".oe2409" +%if %{os_version} <= 2403 cd %{build_src_dir}/%{build_dir} %else cd %{build_src_dir}/llvm @@ -1149,7 +1147,7 @@ cd %{build_src_dir}/llvm %install_tool -%if "%dist" < ".oe2403" +%if %{os_version} <= 2203 cd %{build_src_dir}/_build_libcxx %install_tool @@ -1157,8 +1155,12 @@ cd %{build_src_dir}/_build_openmp %install_tool cd %{build_src_dir}/_build_compiler-rt +%if %{os_version} > 2403 +%install_tool +%else %make_install %endif +%endif rm -Rvf %{build_install_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}/clang_rt.crtbegin.o rm -Rvf %{build_install_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}/clang_rt.crtend.o @@ -1365,7 +1367,7 @@ rm -rf %{buildroot}/%{install_datadir}/gdb %ifnarch %{ix86} # Remove files that we don't package, yet. -%if "%dist" >= ".oe2403" +%if %{os_version} >= 2403 %if %{maj_ver} >= 20 rm %{buildroot}%{install_bindir}/llvm-offload-device-info %else @@ -1920,7 +1922,7 @@ fi %files -n %{pkg_name_llvm} %license llvm/LICENSE.TXT -%if "%dist" >= ".oe2403" +%if %{os_version} > 2203 %exclude %{_mandir}/man1/llvm-config* %{_mandir}/man1/bugpoint%{exec_suffix}.1.gz @@ -2224,7 +2226,7 @@ fi %ghost %{_bindir}/llvm-config-%{maj_ver} %{install_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} -%if "%dist" >= ".oe2403" +%if %{os_version} > 2203 %{_mandir}/man1/llvm-config* %endif %{install_includedir}/llvm @@ -2290,11 +2292,11 @@ fi %{install_bindir}/clang-cl %{install_bindir}/clang-cpp %{_mandir}/man1/clang++-%{maj_ver}.1.gz -%if "%dist" >= ".oe2403" +%if %{os_version} > 2203 %{_mandir}/man1/clang-%{maj_ver}.1.gz %endif %if %{with sys_llvm} -%if "%dist" >= ".oe2403" +%if %{os_version} > 2203 %{_mandir}/man1/clang.1.gz %endif %{_mandir}/man1/clang++.1.gz @@ -2444,7 +2446,7 @@ fi %endif %{_emacs_sitestartdir}/clang-include-fixer.el %endif -%if "%dist" >= ".oe2403" +%if %{os_version} > 2203 %{_mandir}/man1/diagtool%{exec_suffix}.1.gz %{_mandir}/man1/extraclangtools%{exec_suffix}.1.gz %endif @@ -2631,7 +2633,7 @@ fi %{install_libdir}/liblldb*.so %{install_libdir}/liblldb.so.* %{install_libdir}/liblldbIntelFeatures.so.* -%if "%dist" >= ".oe2403" +%if %{os_version} > 2203 %{_mandir}/man1/lldb-server%{exec_suffix}.1.gz %{_mandir}/man1/lldb%{exec_suffix}.1.gz %endif @@ -2784,6 +2786,10 @@ fi #endregion files %changelog +* Wed Oct 15 2025 liyunfei - 18.1.8-9 +- Revert replace os_version with dist +- default os_version to 2403 + * Mon Oct 13 2025 Wang Qiang - 18.1.8-8 - Replaced the hardcoded /opt/openEuler path with /opt/\%{_vendor} -- Gitee From 6d5f9f970a0fa13ed8c0ff51034992d267d43e35 Mon Sep 17 00:00:00 2001 From: liyunfei Date: Wed, 15 Oct 2025 17:00:13 +0800 Subject: [PATCH 2/2] update target triples for all openEuler based distribution (cherry picked from commit 320d2bb98baef8f4f77d38b9ac3e9ad474d39105) --- llvm-toolset-18.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/llvm-toolset-18.spec b/llvm-toolset-18.spec index 197393f..f1d6024 100644 --- a/llvm-toolset-18.spec +++ b/llvm-toolset-18.spec @@ -149,7 +149,7 @@ #region main package Name: llvm-toolset-%{maj_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 9 +Release: 10 Summary: The Low Level Virtual Machine License: NCSA @@ -735,6 +735,11 @@ Documentation for LLVM libunwind # shebang_fix part removed +# update Gnu target triples, make it friendly to all openEuler based distribution +%if "%{_vendor}" != "openEuler" +sed -i 's/"\([a-zA-Z0-9_-]\+\)-openEuler-linux"/"\1-openEuler-linux", "\1-%{_vendor}-linux"/g' %{build_src_dir}/clang/lib/Driver/ToolChains/Gnu.cpp +%endif + #endregion prep #region build @@ -2786,6 +2791,9 @@ fi #endregion files %changelog +* Wed Oct 15 2025 liyunfei - 18.1.8-10 +- update target triples for all openEuler based distribution. + * Wed Oct 15 2025 liyunfei - 18.1.8-9 - Revert replace os_version with dist - default os_version to 2403 -- Gitee