From e4cfa448c05012113feeb3ab206765ed1bfd9985 Mon Sep 17 00:00:00 2001 From: eastb233 Date: Wed, 3 Sep 2025 11:11:32 +0800 Subject: [PATCH] Sync from master (cherry picked from commit e394c31b46f340b58de6777d1e5638764de90c58) --- llvm-bolt.spec | 34 +++++++++++++++++++++++++++------- llvm-bolt.yaml | 4 ++++ 2 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 llvm-bolt.yaml diff --git a/llvm-bolt.spec b/llvm-bolt.spec index 974bd8e..9034080 100644 --- a/llvm-bolt.spec +++ b/llvm-bolt.spec @@ -1,5 +1,10 @@ %bcond_without sys_llvm %bcond_with check +%bcond_without toolchain_clang + +%if %{with toolchain_clang} +%global toolchain clang +%endif %global maj_ver 17 %global min_ver 0 @@ -22,9 +27,9 @@ Name: %{pkg_name} Version: %{bolt_version} -Release: 6 +Release: 7 Summary: BOLT is a post-link optimizer developed to speed up large applications -License: Apache 2.0 +License: Apache-2.0 URL: https://github.com/llvm/llvm-project/tree/main/bolt Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{bolt_version}/%{bolt_srcdir}.tar.xz @@ -52,6 +57,9 @@ BuildRequires: zlib-devel BuildRequires: python3-lit BuildRequires: python3-psutil BuildRequires: doxygen +%if %{with toolchain_clang} +BuildRequires: clang +%endif %description BOLT is a post-link optimizer developed to speed up large applications. @@ -86,6 +94,10 @@ Documentation for the BOLT optimizer -DLLVM_EXTERNAL_LIT=%{_bindir}/lit \ -DLLVM_ENABLE_PROJECTS="bolt" \ -DLLVM_PARALLEL_LINK_JOBS=%{max_link_jobs} \ +%if "%{toolchain}" == "clang" + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ +%endif %ifarch %ix86 x86_64 -DLLVM_TARGETS_TO_BUILD="X86" %endif @@ -123,9 +135,8 @@ rm -f %{buildroot}/%{_builddir}/%{bolt_srcdir}/%{_vpath_builddir}/%{_lib}/lib*.a install -d %{buildroot}%{install_docdir} mv bolt/README.md bolt/docs/*.md %{buildroot}%{install_docdir} -%check - %if %{with check} +%check %ifarch aarch64 # Failing test cases on aarch64 rm bolt/test/cache+-deprecated.test bolt/test/bolt-icf.test bolt/test/R_ABS.pic.lld.cpp @@ -147,19 +158,28 @@ rm -f %{buildroot}/%{_builddir}/%{bolt_srcdir}/%{_vpath_builddir}/%{_lib}/lib*.a %{install_bindir}/perf2bolt %{install_bindir}/llvm-bolt-heatmap -%ifnarch riscv64 loongarch64 +%ifarch aarch64 %{install_libdir}/libbolt_rt_instr.a %endif + %ifarch x86_64 %{install_libdir}/libbolt_rt_hugify.a +%{install_libdir}/libbolt_rt_instr.a %endif -%exclude %{_builddir}/%{bolt_srcdir}/lib/* - %files doc %doc %{install_docdir} %changelog +* Sat Aug 30 2025 eastb233 17.0.6-7 +- Type: cherry-pick +- ID:NA +- SUG:NA +- DESC: cherry-pick +- Add toolchain_clang build support +- Part of adopt to new cmake macro +- build with clang + * Thu May 22 2025 rfwang07 17.0.6-6 - Type:backport - ID:NA diff --git a/llvm-bolt.yaml b/llvm-bolt.yaml new file mode 100644 index 0000000..c7c50f6 --- /dev/null +++ b/llvm-bolt.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: llvm/llvm-project +tag_prefix: ^llvmorg- +separator: . -- Gitee