init for Multi-Version LLVM-18.1.8

Signed-off-by: liyunfei <liyunfei33@huawei.com>
This commit is contained in:
liyunfei 2024-12-09 10:57:20 +08:00
parent e4a863997f
commit 5fe821c116
6 changed files with 76 additions and 38 deletions

View File

@ -1,9 +1,22 @@
# llvm-bolt # llvm-bolt-latest
#### Description #### Description
BOLT is a post-link optimizer developed to speed up large applications. llvm-bolt is a post-link optimizer developed to speed up large applications
It achieves the improvements by optimizing application's code layout based
on execution profile gathered by sampling profiler, such as Linux perf tool. #### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution #### Contribution

View File

@ -1,9 +1,23 @@
# llvm-bolt # llvm-bolt-latest
#### 介绍 #### 介绍
BOLT is a post-link optimizer developed to speed up large applications. llvm-bolt is a post-link optimizer developed to speed up large applications
It achieves the improvements by optimizing application's code layout based
on execution profile gathered by sampling profiler, such as Linux perf tool. #### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献 #### 参与贡献

View File

@ -1,35 +1,33 @@
%bcond_without sys_llvm
%bcond_with check %bcond_with check
%bcond_with toolchain_clang %bcond_without toolchain_clang
%if %{with toolchain_clang} %if %{with toolchain_clang}
%global toolchain clang %global toolchain clang
%endif %endif
%global maj_ver 17 %global maj_ver 18
%global min_ver 0 %global min_ver 1
%global patch_ver 6 %global patch_ver 8
%global bolt_version %{maj_ver}.%{min_ver}.%{patch_ver} %global bolt_version %{maj_ver}.%{min_ver}.%{patch_ver}
%global bolt_srcdir llvm-project-%{bolt_version}.src %global bolt_srcdir llvm-project-%{bolt_version}.src
%if %{with sys_llvm} %global _scl_prefix /opt/openEuler
%global pkg_name llvm-bolt %{?scl:%scl_package %scl}
%global install_prefix %{_prefix} %{!?scl:%global scl_prefix llvm-toolset-%{maj_ver}-}
%else %{!?scl:%global pkg_name %{name}}
%global pkg_name llvm-bolt%{maj_ver} %global install_prefix %{!?scl:%{_scl_prefix}/llvm-toolset-%{maj_ver}/root}%{_prefix}
%global install_prefix %{_libdir}/llvm%{maj_ver} %global install_datadir %{!?scl:%{_scl_prefix}/llvm-toolset-%{maj_ver}/root}%{_datadir}
%endif
%global install_bindir %{install_prefix}/bin %global install_bindir %{install_prefix}/bin
%global install_libdir %{install_prefix}/lib %global install_libdir %{install_prefix}/lib
%global install_docdir %{install_prefix}/share/doc %global install_docdir %{install_prefix}/share/doc
%global max_link_jobs 2 %global max_link_jobs 2
Name: %{pkg_name} Name: %{?scl_prefix}llvm-bolt
Version: %{bolt_version} Version: %{bolt_version}
Release: 3 Release: 1
Summary: BOLT is a post-link optimizer developed to speed up large applications 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 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 Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{bolt_version}/%{bolt_srcdir}.tar.xz
@ -52,6 +50,8 @@ BuildRequires: doxygen
BuildRequires: clang BuildRequires: clang
%endif %endif
%{?scl:Requires: %scl_runtime}
%description %description
BOLT is a post-link optimizer developed to speed up large applications. BOLT is a post-link optimizer developed to speed up large applications.
It achieves the improvements by optimizing application's code layout based It achieves the improvements by optimizing application's code layout based
@ -60,7 +60,7 @@ on execution profile gathered by sampling profiler, such as Linux perf tool.
%package doc %package doc
Summary: Documentation for BOLT Summary: Documentation for BOLT
BuildArch: noarch BuildArch: noarch
Requires: %{name} = %{version}-%{release} Requires: %{pkg_name} = %{version}-%{release}
%description doc %description doc
Documentation for the BOLT optimizer Documentation for the BOLT optimizer
@ -99,32 +99,45 @@ Documentation for the BOLT optimizer
# Set LD_LIBRARY_PATH now because we skip rpath generation and the build uses # Set LD_LIBRARY_PATH now because we skip rpath generation and the build uses
# some just built libraries. # some just built libraries.
export LD_LIBRARY_PATH=%{_builddir}/%{bolt_srcdir}/%{__cmake_builddir}/%{_lib} export LD_LIBRARY_PATH=%{_builddir}/%{bolt_srcdir}/%{_vpath_builddir}/%{_lib}
%cmake_build --target bolt %ninja_build bolt
%install %install
%cmake_install --component bolt %ninja_install bolt
# Remove extera llvm files.
find %{buildroot}%{install_prefix} \
! -name "llvm-bolt" \
! -name "merge-fdata" \
! -name "perf2bolt" \
! -name "llvm-boltdiff" \
! -name "llvm-bolt-heatmap" \
! -name "libbolt_rt_hugify.a" \
! -name "libbolt_rt_instr.a" \
-type f,l -exec rm -f '{}' \;
# Remove files installed during the build phase. # Remove files installed during the build phase.
rm -f %{buildroot}/%{_builddir}/%{bolt_srcdir}/%{__cmake_builddir}/%{_lib}/lib*.a rm -f %{buildroot}/%{_builddir}/%{bolt_srcdir}/%{_vpath_builddir}/%{_lib}/lib*.a
# There currently is not support upstream for building html doc from BOLT # There currently is not support upstream for building html doc from BOLT
install -d %{buildroot}%{install_docdir} install -d %{buildroot}%{install_docdir}
mv bolt/README.md bolt/docs/*.md %{buildroot}%{install_docdir} mv bolt/README.md bolt/docs/*.md %{buildroot}%{install_docdir}
%if %{with check}
%check %check
%if %{with check}
%ifarch aarch64 %ifarch aarch64
# Failing test cases on aarch64 # Failing test cases on aarch64
rm bolt/test/cache+-deprecated.test bolt/test/bolt-icf.test bolt/test/R_ABS.pic.lld.cpp rm bolt/test/cache+-deprecated.test bolt/test/bolt-icf.test bolt/test/R_ABS.pic.lld.cpp
%endif %endif
export LD_LIBRARY_PATH=%{_builddir}/%{bolt_srcdir}//%{__cmake_builddir}/%{_lib} export LD_LIBRARY_PATH=%{_builddir}/%{bolt_srcdir}//%{_vpath_builddir}/%{_lib}
export DESTDIR=%{buildroot} export DESTDIR=%{buildroot}
%cmake_build --target check-bolt %ninja_build check-bolt
# Remove files installed during the check phase. # Remove files installed during the check phase.
rm -f %{buildroot}/%{_builddir}/%{bolt_srcdir}/%{__cmake_builddir}/%{_lib}/lib*.a rm -f %{buildroot}/%{_builddir}/%{bolt_srcdir}/%{_vpath_builddir}/%{_lib}/lib*.a
%endif %endif
%files %files
@ -135,19 +148,17 @@ rm -f %{buildroot}/%{_builddir}/%{bolt_srcdir}/%{__cmake_builddir}/%{_lib}/lib*.
%{install_bindir}/perf2bolt %{install_bindir}/perf2bolt
%{install_bindir}/llvm-bolt-heatmap %{install_bindir}/llvm-bolt-heatmap
%ifarch x86_64
%{install_libdir}/libbolt_rt_hugify.a %{install_libdir}/libbolt_rt_hugify.a
%{install_libdir}/libbolt_rt_instr.a %{install_libdir}/libbolt_rt_instr.a
%if %{with toolchain_clang}
%{install_libdir}/libbolt_rt_instr_osx.a
%endif
%endif
%files doc %files doc
%doc %{install_docdir} %doc %{install_docdir}
%changelog %changelog
* Fri Dec 6 2024 liyunfei <liyunfei33@huawei.com> - 18.1.8-1
- init for Multi-Version LLVM-18.1.8
* Tue Nov 12 2024 Funda Wang <fundawang@yeah.net> - 17.0.6-3 * Tue Nov 12 2024 Funda Wang <fundawang@yeah.net> - 17.0.6-3
- adopt to new cmake macro - adopt to new cmake macro
- build with gcc now, as llvm/clang will produce linking error - build with gcc now, as llvm/clang will produce linking error

Binary file not shown.

Binary file not shown.