From e5968ccc74eff3558bdb9f569f7f25720340d9bb Mon Sep 17 00:00:00 2001 From: jchzhou Date: Fri, 5 Dec 2025 18:10:44 +0800 Subject: [PATCH] Rename the 'sys_llvm' bcond to be unique for easier override in build environments (cherry picked from commit 62c3b5933329b3d87f155c4d5a873b1f3935f21d) --- llvm-toolset-20.spec | 85 +++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/llvm-toolset-20.spec b/llvm-toolset-20.spec index 1d5e80e..6a4078d 100644 --- a/llvm-toolset-20.spec +++ b/llvm-toolset-20.spec @@ -19,7 +19,7 @@ %endif # Build sys_llvm packages or compat packages -%bcond_with sys_llvm +%bcond_with sys_llvm_20 %bcond_with check %bcond_without toolchain_clang @@ -48,7 +48,7 @@ #region LLVM globals -%if %{with sys_llvm} +%if %{with sys_llvm_20} %global pkg_name_llvm llvm %global install_prefix /usr %global install_bindir %{_bindir} @@ -168,7 +168,7 @@ #region main package Name: llvm-toolset-%{maj_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 2 +Release: 3 Summary: The Low Level Virtual Machine License: NCSA @@ -427,7 +427,7 @@ Provides: clang-devel(major) = %{maj_ver} # add a Provides so users can just run "dnf install clangd." # This Provides is only present in the primary, unversioned clang package. # Users who want the compat versions can install them using the full name. -%if %{with sys_llvm} +%if %{with sys_llvm_20} Provides: clangd = %{version}-%{release} %endif @@ -480,7 +480,7 @@ Requires: python3 %description -n %{?scl_prefix}git-clang-format clang-format integration for git. -%if %{with sys_llvm} +%if %{with sys_llvm_20} %package -n python3-clang Summary: Python3 bindings for clang Requires: %{pkg_name_clang}-devel%{?_isa} = %{version}-%{release} @@ -559,7 +559,7 @@ The LLVM project linker. %package -n %{pkg_name_lld}-devel Summary: Libraries and header files for LLD Requires: %{pkg_name_lld}-libs%{?_isa} = %{version}-%{release} -# %if %{with sys_llvm} +# %if %{with sys_llvm_20} # lld tools are referenced in the cmake files, so we need to add lld as a # dependency. # Requires: %{pkg_name_lld}%{?_isa} = %{version}-%{release} @@ -588,7 +588,7 @@ License: Apache-2.0 WITH LLVM-exception OR NCSA URL: http://lldb.llvm.org/ Requires: %{pkg_name_clang}-libs%{?_isa} = %{version}-%{release} -%if %{with sys_llvm} +%if %{with sys_llvm_20} Requires: python%{python3_pkgversion}-lldb = %{version}-%{release} %endif @@ -605,7 +605,7 @@ Requires: %{pkg_name_lldb}%{?_isa} = %{version}-%{release} %description -n %{pkg_name_lldb}-devel The package contains header files for the LLDB debugger. -%if %{with sys_llvm} +%if %{with sys_llvm_20} %package -n python%{python3_pkgversion}-lldb %{?python_provide:%python_provide python%{python3_pkgversion}-lldb} Summary: Python module for LLDB @@ -647,7 +647,7 @@ Requires: %{pkg_name_mlir}-static%{?_isa} = %{version}-%{release} %description -n %{pkg_name_mlir}-devel MLIR development files. -%if %{with sys_llvm} +%if %{with sys_llvm_20} %package -n python%{python3_pkgversion}-mlir %{?python_provide:%python_provide python%{python3_pkgversion}-mlir} Summary: MLIR python bindings @@ -1241,7 +1241,7 @@ install %{build_libdir}/libLLVMTestingAnnotations.a %{buildroot}%{install_libdir # Fix multi-lib %multilib_fix_c_header --file %{install_includedir}/llvm/Config/llvm-config.h -%if %{with sys_llvm} +%if %{with sys_llvm_20} # Fix some man pages ln -s llvm-config.1 %{buildroot}%{_mandir}/man1/llvm-config%{exec_suffix}-%{__isa_bits}.1 @@ -1311,7 +1311,7 @@ ln -s %{install_datadir}/clang/clang-format-diff.py %{buildroot}%{install_bindir # File in the macros file for other packages to use. We are not doing this # in the compat package, because the version macros would # conflict with # eachother if both clang and the clang compat package were installed together. -%if %{with sys_llvm} +%if %{with sys_llvm_20} # install clang python bindings mkdir -p %{buildroot}%{python3_sitelib}/clang/ @@ -1366,7 +1366,7 @@ ln -s clang++ %{buildroot}%{install_bindir}/clang++-%{maj_ver} # Create Manpage symlinks ln -s clang%{exec_suffix}.1.gz %{buildroot}%{_mandir}/man1/clang++%{exec_suffix}.1.gz -%if %{with sys_llvm} +%if %{with sys_llvm_20} ln -s clang.1.gz %{buildroot}%{_mandir}/man1/clang-%{maj_ver}.1.gz ln -s clang.1.gz %{buildroot}%{_mandir}/man1/clang++-%{maj_ver}.1.gz %endif @@ -1445,7 +1445,7 @@ rm %{buildroot}%{install_bindir}/llvm-omp-kernel-replay #region LLD installation -%if %{with sys_llvm} +%if %{with sys_llvm_20} # Required when using update-alternatives: # https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/ touch %{buildroot}%{_bindir}/ld @@ -1461,7 +1461,7 @@ install -D -m 644 -t %{buildroot}%{_mandir}/man1/ lld/docs/ld.lld.1 # python: fix binary libraries location liblldb=$(basename $(readlink -e %{buildroot}%{install_libdir}/liblldb.so)) -%if %{with sys_llvm} +%if %{with sys_llvm_20} mkdir -p %{buildroot}%{python3_sitearch} # /usr/lib/../usr/lib64 == /usr/lib64, in which case mv (or cp -r) would complain # mv %{buildroot}%{install_prefix}/..%{python3_sitearch}/lldb %{buildroot}%{python3_sitearch}/lldb @@ -1476,7 +1476,7 @@ rm -rf %{buildroot}%{install_prefix}/..%{python3_sitearch}/lldb #region mlir installation %if %{with mlir} %if %{with mlir_python_binding} -%if %{with sys_llvm} +%if %{with sys_llvm_20} mkdir -p %{buildroot}/%{python3_sitearch} mv %{buildroot}%{install_prefix}/python_packages/mlir_core/mlir %{buildroot}/%{python3_sitearch} %endif @@ -1512,7 +1512,7 @@ popd rm -f %{buildroot}%{_libdir}/libLLVMBOLT*.a #endregion BOLT installation -%if %{without sys_llvm} +%if %{without sys_llvm_20} # Add version suffix to binaries. Do this at the end so it includes any # additional binaries that may be been added by other steps. for f in %{buildroot}/%{install_bindir}/*; do @@ -1529,7 +1529,7 @@ done # infrastructure. Without compat, cmake points to the symlink, with compat it # points to the original file. -%if %{with sys_llvm} +%if %{with sys_llvm_20} mv %{buildroot}/%{install_bindir}/llvm-config %{buildroot}/%{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} # We still maintain a versionned symlink for consistency across llvm versions. @@ -1557,7 +1557,7 @@ install -m 0755 ../llvm-compat-libs/lib/libclang-cpp.so.%{compat_maj_ver}* %{bui install -m 0755 ../llvm-compat-libs/lib/liblldb.so.%{compat_maj_ver}* %{buildroot}%{_libdir} %endif -%if %{without sys_llvm} +%if %{without sys_llvm_20} cat < %{buildroot}%{_scl_scripts}/enable # General environment variables export PATH=%{install_bindir}\${PATH:+:\${PATH}} @@ -1985,13 +1985,13 @@ export LIT_XFAIL="$LIT_XFAIL;RISCV/mapping-syms.s" #region misc %ldconfig_scriptlets -n %{pkg_name-llvm}-libs -%if %{with sys_llvm} +%if %{with sys_llvm_20} %ldconfig_scriptlets -n %{pkg_name_lld}-libs %endif %post -n %{pkg_name_llvm}-devel %{_sbindir}/update-alternatives --install %{_bindir}/llvm-config%{exec_suffix} llvm-config%{exec_suffix} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} -%if %{with sys_llvm} +%if %{with sys_llvm_20} %{_sbindir}/update-alternatives --install %{_bindir}/llvm-config-%{maj_ver} llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} # During the upgrade from LLVM 16 (F38) to LLVM 17 (F39), we found out the @@ -2009,7 +2009,7 @@ done if [ $1 -eq 0 ]; then %{_sbindir}/update-alternatives --remove llvm-config%{exec_suffix} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} fi -%if %{with sys_llvm} +%if %{with sys_llvm_20} # When upgrading between minor versions (i.e. from x.y.1 to x.y.2), we must # not remove the alternative. # However, during a major version upgrade (i.e. from 16.x.y to 17.z.w), the @@ -2021,7 +2021,7 @@ if [[ $1 -eq 0 fi %endif -%if %{with sys_llvm} +%if %{with sys_llvm_20} %post -n %{pkg_name_lld} %{_sbindir}/update-alternatives --install %{_bindir}/ld ld %{_bindir}/ld.lld 1 @@ -2046,7 +2046,7 @@ fi #region LLVM files %files -n llvm-toolset-%{maj_ver} -%if %{without sys_llvm} +%if %{without sys_llvm_20} %{_scl_scripts}/enable %endif @@ -2211,7 +2211,7 @@ fi %{install_bindir}/llvm-tapi-diff %endif -%if %{without sys_llvm} +%if %{without sys_llvm_20} # This is for all the binaries with the version suffix. %{_bindir}/bugpoint%{exec_suffix} %{_bindir}/dsymutil%{exec_suffix} @@ -2329,7 +2329,7 @@ fi %{install_libdir}/libLLVM-%{maj_ver}%{?llvm_snapshot_version_suffix}.so %if %{with gold} %{install_libdir}/LLVMgold.so -%if %{with sys_llvm} +%if %{with sys_llvm_20} %{_libdir}/bfd-plugins/LLVMgold.so %endif %else @@ -2344,14 +2344,14 @@ fi %endif %{install_libdir}/libLTO.so* %{install_libdir}/libRemarks.so* -%if %{without sys_llvm} +%if %{without sys_llvm_20} %config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{pkg_name_llvm}-%{_arch}.conf %endif %files -n %{pkg_name_llvm}-devel %license llvm/LICENSE.TXT -%if %{with sys_llvm} +%if %{with sys_llvm_20} %ghost %{_bindir}/llvm-config %{install_bindir}/llvm-config-%{__isa_bits} %else @@ -2388,7 +2388,7 @@ fi %{install_bindir}/lli-child-target %{install_bindir}/llvm-isel-fuzzer %{install_bindir}/llvm-opt-fuzzer -%if %{without sys_llvm} +%if %{without sys_llvm_20} %{_bindir}/not%{exec_suffix} %{_bindir}/count%{exec_suffix} %{_bindir}/yaml-bench%{exec_suffix} @@ -2425,7 +2425,7 @@ fi %{install_bindir}/clang-cpp %{_mandir}/man1/clang-%{maj_ver}.1.gz %{_mandir}/man1/clang++-%{maj_ver}.1.gz -%if %{with sys_llvm} +%if %{with sys_llvm_20} %{_mandir}/man1/clang.1.gz %{_mandir}/man1/clang++.1.gz %else @@ -2449,7 +2449,7 @@ fi %{install_includedir}/clang-c/ %{install_libdir}/cmake/clang %{install_bindir}/clang-tblgen -%if %{without sys_llvm} +%if %{without sys_llvm_20} %{_bindir}/clang-tblgen-%{maj_ver} %endif %dir %{install_datadir}/clang/ @@ -2470,7 +2470,7 @@ fi %{install_bindir}/analyze-build %{install_bindir}/intercept-build %{install_bindir}/scan-build-py -%if %{without sys_llvm} +%if %{without sys_llvm_20} %{_bindir}/scan-view-%{maj_ver} %{_bindir}/scan-build-%{maj_ver} %{_bindir}/analyze-build-%{maj_ver} @@ -2486,7 +2486,7 @@ fi %{install_datadir}/scan-view/ %{install_datadir}/scan-build/ %{_mandir}/man1/scan-build%{exec_suffix}.1.* -%if %{with sys_llvm} +%if %{with sys_llvm_20} %{python3_sitelib}/libear %{python3_sitelib}/libscanbuild %endif @@ -2533,7 +2533,7 @@ fi %{install_bindir}/clang-pseudo %{install_bindir}/clang-rename %endif -%if %{without sys_llvm} +%if %{without sys_llvm_20} %{_bindir}/amdgpu-arch-%{maj_ver} %{_bindir}/clang-apply-replacements-%{maj_ver} %{_bindir}/clang-change-namespace-%{maj_ver} @@ -2599,11 +2599,11 @@ fi %files -n %{?scl_prefix}git-clang-format %license clang/LICENSE.TXT %{install_bindir}/git-clang-format -%if %{without sys_llvm} +%if %{without sys_llvm_20} %{_bindir}/git-clang-format-%{maj_ver} %endif -%if %{with sys_llvm} +%if %{with sys_llvm_20} %files -n python%{python3_pkgversion}-clang %license clang/LICENSE.TXT %{python3_sitelib}/clang/ @@ -2718,7 +2718,7 @@ fi %{install_bindir}/ld.lld %{install_bindir}/ld64.lld %{install_bindir}/wasm-ld -%if %{with sys_llvm} +%if %{with sys_llvm_20} %{_mandir}/man1/ld.lld.1* %else %{_bindir}/lld%{exec_suffix} @@ -2762,7 +2762,7 @@ fi %files -n %{pkg_name_lldb} %license lldb/LICENSE.TXT %{install_bindir}/lldb* -%if %{without sys_llvm} +%if %{without sys_llvm_20} %{_bindir}/lldb* %endif # Usually, *.so symlinks are kept in devel subpackages. However, the python @@ -2781,7 +2781,7 @@ fi %files -n %{pkg_name_lldb}-devel %{install_includedir}/lldb -%if %{with sys_llvm} +%if %{with sys_llvm_20} %files -n python%{python3_pkgversion}-lldb %{python3_sitearch}/lldb %endif @@ -2825,7 +2825,7 @@ fi %{install_bindir}/mlir-query %{install_bindir}/tblgen-to-irdl %endif -%if %{without sys_llvm} +%if %{without sys_llvm_20} %if %{maj_ver} >= 20 %{_bindir}/mlir-rewrite-%{maj_ver} %{_bindir}/mlir-runner-%{maj_ver} @@ -2863,7 +2863,7 @@ fi %{install_libdir}/libMLIR*.so %if %{with mlir_python_binding} -%if %{with sys_llvm} +%if %{with sys_llvm_20} %files -n python%{python3_pkgversion}-mlir %{python3_sitearch}/mlir/ %endif @@ -2951,7 +2951,7 @@ fi %{install_libdir}/libbolt_rt_hugify.a %{install_libdir}/libbolt_rt_instr.a -%if %{without sys_llvm} +%if %{without sys_llvm_20} %{_bindir}/llvm-bolt-%{maj_ver} %if %{maj_ver} >= 20 %{_bindir}/llvm-bolt-binary-analysis-%{maj_ver} @@ -2968,6 +2968,9 @@ fi #endregion files %changelog +* Fri Dec 05 2025 jchzhou - 20.1.8-3 +- Rename the 'sys_llvm' bcond to be unique for easier override in build environments + * Fri Oct 31 2025 mahailiang - 20.1.8-2 - fix loongarch64 build error -- Gitee