Compare commits
No commits in common. "e4a863997fc52e4edcb878c713ade2665216e373" and "113bb21561a59fe4329f09504f84afbd7a53bd3e" have entirely different histories.
e4a863997f
...
113bb21561
19
README.en.md
19
README.en.md
@ -1,9 +1,22 @@
|
|||||||
# llvm-bolt
|
# llvm-bolt
|
||||||
|
|
||||||
#### 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
|
||||||
|
|
||||||
|
|||||||
20
README.md
20
README.md
@ -1,9 +1,23 @@
|
|||||||
# llvm-bolt
|
# llvm-bolt
|
||||||
|
|
||||||
#### 介绍
|
#### 介绍
|
||||||
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
|
||||||
|
|
||||||
#### 参与贡献
|
#### 参与贡献
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
187
llvm-bolt.spec
187
llvm-bolt.spec
@ -1,170 +1,59 @@
|
|||||||
%bcond_without sys_llvm
|
Name: llvm-bolt
|
||||||
%bcond_with check
|
Version: 0
|
||||||
%bcond_with toolchain_clang
|
Release: 1.20211016.gitb72f753
|
||||||
|
|
||||||
%if %{with toolchain_clang}
|
|
||||||
%global toolchain clang
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%global maj_ver 17
|
|
||||||
%global min_ver 0
|
|
||||||
%global patch_ver 6
|
|
||||||
%global bolt_version %{maj_ver}.%{min_ver}.%{patch_ver}
|
|
||||||
%global bolt_srcdir llvm-project-%{bolt_version}.src
|
|
||||||
|
|
||||||
%if %{with sys_llvm}
|
|
||||||
%global pkg_name llvm-bolt
|
|
||||||
%global install_prefix %{_prefix}
|
|
||||||
%else
|
|
||||||
%global pkg_name llvm-bolt%{maj_ver}
|
|
||||||
%global install_prefix %{_libdir}/llvm%{maj_ver}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%global install_bindir %{install_prefix}/bin
|
|
||||||
%global install_libdir %{install_prefix}/lib
|
|
||||||
%global install_docdir %{install_prefix}/share/doc
|
|
||||||
%global max_link_jobs 2
|
|
||||||
|
|
||||||
Name: %{pkg_name}
|
|
||||||
Version: %{bolt_version}
|
|
||||||
Release: 3
|
|
||||||
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/facebookincubator/BOLT
|
||||||
|
Source0: %{name}-%{version}.tar.xz
|
||||||
|
|
||||||
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{bolt_version}/%{bolt_srcdir}.tar.xz
|
BuildRequires: gcc gcc-c++ cmake ninja-build libstdc++-static chrpath ncurses-devel zlib-devel
|
||||||
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{bolt_version}/%{bolt_srcdir}.tar.xz.sig
|
Requires: glibc zlib ncurses-libs libstdc++ libgcc
|
||||||
|
|
||||||
# BOLT is not respecting the component split of LLVM and requires some private
|
|
||||||
# headers in order to compile itself. Try to disable as much libraries as
|
|
||||||
# possible in order to reduce build time.
|
|
||||||
#Patch0: rm-llvm-libs.diff
|
|
||||||
|
|
||||||
BuildRequires: gcc
|
|
||||||
BuildRequires: gcc-c++
|
|
||||||
BuildRequires: cmake
|
|
||||||
BuildRequires: ninja-build
|
|
||||||
BuildRequires: zlib-devel
|
|
||||||
BuildRequires: python3-lit
|
|
||||||
BuildRequires: python3-psutil
|
|
||||||
BuildRequires: doxygen
|
|
||||||
%if %{with toolchain_clang}
|
|
||||||
BuildRequires: clang
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%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
|
||||||
on execution profile gathered by sampling profiler, such as Linux perf tool.
|
on execution profile gathered by sampling profiler, such as Linux perf tool.
|
||||||
|
|
||||||
%package doc
|
|
||||||
Summary: Documentation for BOLT
|
|
||||||
BuildArch: noarch
|
|
||||||
Requires: %{name} = %{version}-%{release}
|
|
||||||
|
|
||||||
%description doc
|
|
||||||
Documentation for the BOLT optimizer
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{bolt_srcdir} -p1
|
%setup -q
|
||||||
|
mkdir -p _build
|
||||||
|
cd _build
|
||||||
|
%{__cmake} -G Ninja ../llvm -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_ENABLE_ASSERTIONS=ON \
|
||||||
|
-DLLVM_ENABLE_PROJECTS="clang;lld;bolt" -DCMAKE_INSTALL_PREFIX=%{_usr} \
|
||||||
|
-DLLVM_PARALLEL_LINK_JOBS=1 \
|
||||||
|
%ifarch %ix86 x86_64
|
||||||
|
-DLLVM_TARGETS_TO_BUILD="X86"
|
||||||
|
%endif
|
||||||
|
%ifarch aarch64
|
||||||
|
-DLLVM_TARGETS_TO_BUILD="AArch64"
|
||||||
|
%endif
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%{cmake} -G Ninja -S llvm \
|
cd _build
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
%{ninja_build}
|
||||||
-DCMAKE_INSTALL_PREFIX=%{install_prefix} \
|
|
||||||
-DCMAKE_SKIP_RPATH=ON \
|
|
||||||
-DLLVM_DIR=%{install_libdir}/cmake/llvm \
|
|
||||||
-DLLVM_TABLEGEN_EXE=%{install_bindir}/llvm-tblgen \
|
|
||||||
-DLLVM_BUILD_UTILS:BOOL=ON \
|
|
||||||
-DBOLT_INCLUDE_DOCS:BOOL=ON \
|
|
||||||
-DLLVM_INCLUDE_TESTS:BOOL=ON \
|
|
||||||
-DBUILD_SHARED_LIBS:BOOL=OFF \
|
|
||||||
-DLLVM_LINK_LLVM_DYLIB:BOOL=OFF \
|
|
||||||
-DLLVM_ENABLE_ASSERTIONS=ON \
|
|
||||||
-DBOLT_INCLUDE_TESTS:BOOL=ON \
|
|
||||||
-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
|
|
||||||
%ifarch aarch64
|
|
||||||
-DLLVM_TARGETS_TO_BUILD="AArch64"
|
|
||||||
%endif
|
|
||||||
|
|
||||||
|
|
||||||
# Set LD_LIBRARY_PATH now because we skip rpath generation and the build uses
|
|
||||||
# some just built libraries.
|
|
||||||
export LD_LIBRARY_PATH=%{_builddir}/%{bolt_srcdir}/%{__cmake_builddir}/%{_lib}
|
|
||||||
%cmake_build --target bolt
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%cmake_install --component bolt
|
%{ninja_install} -C _build
|
||||||
|
%global _bolt_install_dir %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}/usr
|
||||||
# Remove files installed during the build phase.
|
# remove extera llvm files.
|
||||||
rm -f %{buildroot}/%{_builddir}/%{bolt_srcdir}/%{__cmake_builddir}/%{_lib}/lib*.a
|
find %{_bolt_install_dir} ! -name "llvm-bolt" ! -name "merge-fdata" ! -name "perf2bolt" -type f,l -exec rm -f '{}' \;
|
||||||
|
# remove static libs.
|
||||||
# There currently is not support upstream for building html doc from BOLT
|
rm -rf %{_buildrootdir}/root
|
||||||
install -d %{buildroot}%{install_docdir}
|
# remove rpath
|
||||||
mv bolt/README.md bolt/docs/*.md %{buildroot}%{install_docdir}
|
chrpath -d %{_bolt_install_dir}/bin/llvm-bolt
|
||||||
|
chrpath -d %{_bolt_install_dir}/bin/merge-fdata
|
||||||
%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
|
|
||||||
%endif
|
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=%{_builddir}/%{bolt_srcdir}//%{__cmake_builddir}/%{_lib}
|
|
||||||
export DESTDIR=%{buildroot}
|
|
||||||
%cmake_build --target check-bolt
|
|
||||||
|
|
||||||
# Remove files installed during the check phase.
|
|
||||||
rm -f %{buildroot}/%{_builddir}/%{bolt_srcdir}/%{__cmake_builddir}/%{_lib}/lib*.a
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license bolt/LICENSE.TXT
|
%license bolt/LICENSE.TXT
|
||||||
%{install_bindir}/llvm-bolt
|
%doc bolt/docs/*
|
||||||
%{install_bindir}/llvm-boltdiff
|
%exclude %{_includedir}/*
|
||||||
%{install_bindir}/merge-fdata
|
%exclude %{_datadir}/*
|
||||||
%{install_bindir}/perf2bolt
|
%exclude %{_builddir}/%{name}-%{version}/_build/*
|
||||||
%{install_bindir}/llvm-bolt-heatmap
|
%attr(0755,root,root) %{_bindir}/llvm-bolt
|
||||||
|
%attr(0755,root,root) %{_bindir}/merge-fdata
|
||||||
%ifarch x86_64
|
%attr(-,root,root) %{_bindir}/perf2bolt
|
||||||
%{install_libdir}/libbolt_rt_hugify.a
|
|
||||||
%{install_libdir}/libbolt_rt_instr.a
|
|
||||||
%if %{with toolchain_clang}
|
|
||||||
%{install_libdir}/libbolt_rt_instr_osx.a
|
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files doc
|
|
||||||
%doc %{install_docdir}
|
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Nov 12 2024 Funda Wang <fundawang@yeah.net> - 17.0.6-3
|
|
||||||
- adopt to new cmake macro
|
|
||||||
- build with gcc now, as llvm/clang will produce linking error
|
|
||||||
against libLLVMTableGen.a now
|
|
||||||
|
|
||||||
* Fri Jul 5 2024 liyunfei <liyunfei33@huawei.com> - 17.0.6-2
|
|
||||||
- Add toolchain_clang build support
|
|
||||||
|
|
||||||
* Mon Dec 4 2023 zhoujing <zhoujing106@huawei.com> 17.0.6-1
|
|
||||||
- Update to 17.0.6
|
|
||||||
|
|
||||||
* Thu Jun 15 2023 Xiong Zhou <xiongzhou4@huawei.com> 0-2.20211016.gitb72f753
|
|
||||||
- Type:backport
|
|
||||||
- ID:NA
|
|
||||||
- SUG:NA
|
|
||||||
- DESC: Handle data at the beginning of a function when disassembling and building CFG.
|
|
||||||
|
|
||||||
* Mon Dec 19 2022 liyancheng <412998149@qq.com> 0-1.20211016.gitb72f753
|
* Mon Dec 19 2022 liyancheng <412998149@qq.com> 0-1.20211016.gitb72f753
|
||||||
- Type:fix
|
- Type:fix
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
@ -1,4 +0,0 @@
|
|||||||
version_control: github
|
|
||||||
src_repo: llvm/llvm-project
|
|
||||||
tag_prefix: ^llvmorg-
|
|
||||||
separator: .
|
|
||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user