!7 Make spec file support both system-version and multi-version
From: @cf-zhao Reviewed-by: @eastb233 Signed-off-by: @eastb233
This commit is contained in:
commit
c95df9cfbd
21
README.md
21
README.md
@ -1,23 +1,8 @@
|
|||||||
# lld-15
|
# lld
|
||||||
|
|
||||||
#### 介绍
|
#### 介绍
|
||||||
LLVM Linker
|
This package contains library and header files needed to develop new native
|
||||||
|
programs that use the LLD infrastructure.
|
||||||
#### 软件架构
|
|
||||||
软件架构说明
|
|
||||||
|
|
||||||
|
|
||||||
#### 安装教程
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### 使用说明
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### 参与贡献
|
#### 参与贡献
|
||||||
|
|
||||||
|
|||||||
BIN
lld-12.0.1.src.tar.xz
Normal file
BIN
lld-12.0.1.src.tar.xz
Normal file
Binary file not shown.
BIN
lld-12.0.1.src.tar.xz.sig
Normal file
BIN
lld-12.0.1.src.tar.xz.sig
Normal file
Binary file not shown.
Binary file not shown.
58
lld.spec
58
lld.spec
@ -1,21 +1,35 @@
|
|||||||
%bcond_without check
|
%bcond_with sys_llvm
|
||||||
|
%bcond_with check
|
||||||
|
|
||||||
%global maj_ver 15
|
%global maj_ver 12
|
||||||
%global min_ver 0
|
%global min_ver 0
|
||||||
%global patch_ver 7
|
%global patch_ver 1
|
||||||
|
|
||||||
|
%if %{with sys_llvm}
|
||||||
|
%global pkg_name lld
|
||||||
|
%global bin_suffix %{nil}
|
||||||
|
%global install_prefix %{_prefix}
|
||||||
|
%else
|
||||||
%global pkg_name lld%{maj_ver}
|
%global pkg_name lld%{maj_ver}
|
||||||
%global bin_suffix -%{maj_ver}
|
%global bin_suffix -%{maj_ver}
|
||||||
%global install_prefix %{_libdir}/llvm%{maj_ver}
|
%global install_prefix %{_libdir}/llvm%{maj_ver}
|
||||||
%global install_includedir %{install_prefix}/include
|
%endif
|
||||||
%global install_libdir %{install_prefix}/lib
|
|
||||||
%global install_bindir %{install_prefix}/bin
|
%global install_bindir %{install_prefix}/bin
|
||||||
%global pkg_bindir %{install_bindir}
|
%if 0%{?__isa_bits} == 64
|
||||||
|
%global install_libdir %{install_prefix}/lib64
|
||||||
|
%else
|
||||||
|
%global install_libdir %{install_prefix}/lib
|
||||||
|
%endif
|
||||||
|
%global install_includedir %{install_prefix}/include
|
||||||
|
|
||||||
# Don't include unittests in automatic generation of provides or requires.
|
# Don't include unittests in automatic generation of provides or requires.
|
||||||
%global __provides_exclude_from ^%{_libdir}/lld/.*$
|
%global __provides_exclude_from ^%{_libdir}/lld/.*$
|
||||||
%global __requires_exclude ^libgtest.*$
|
%global __requires_exclude ^libgtest.*$
|
||||||
|
|
||||||
|
# Disable LTO as this causes crash if gcc lto enabled.
|
||||||
|
%define _lto_cflags %{nil}
|
||||||
|
|
||||||
Name: %{pkg_name}
|
Name: %{pkg_name}
|
||||||
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
|
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
|
||||||
Release: 1
|
Release: 1
|
||||||
@ -29,9 +43,15 @@ Patch1: fedora-PATCH-lld-Import-compact_unwind_encoding.h-from-libu.patch
|
|||||||
|
|
||||||
BuildRequires: clang
|
BuildRequires: clang
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
|
%if %{with sys_llvm}
|
||||||
|
BuildRequires: llvm-devel = %{version}
|
||||||
|
BuildRequires: llvm-googletest = %{version}
|
||||||
|
BuildRequires: llvm-test = %{version}
|
||||||
|
%else
|
||||||
BuildRequires: llvm%{maj_ver}-devel = %{version}
|
BuildRequires: llvm%{maj_ver}-devel = %{version}
|
||||||
BuildRequires: llvm%{maj_ver}-googletest = %{version}
|
BuildRequires: llvm%{maj_ver}-googletest = %{version}
|
||||||
BuildRequires: llvm%{maj_ver}-test = %{version}
|
BuildRequires: llvm%{maj_ver}-test = %{version}
|
||||||
|
%endif
|
||||||
BuildRequires: ncurses-devel
|
BuildRequires: ncurses-devel
|
||||||
BuildRequires: ninja-build
|
BuildRequires: ninja-build
|
||||||
BuildRequires: python3-rpm-macros
|
BuildRequires: python3-rpm-macros
|
||||||
@ -76,8 +96,8 @@ cd _build
|
|||||||
-DLLVM_INCLUDE_TESTS=ON \
|
-DLLVM_INCLUDE_TESTS=ON \
|
||||||
-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
|
-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
|
||||||
-DLLVM_LIT_ARGS="-sv \
|
-DLLVM_LIT_ARGS="-sv \
|
||||||
--path %{_libdir}/llvm%{maj_ver}" \
|
--path %{install_prefix}" \
|
||||||
-DLLVM_MAIN_SRC_DIR=%{_libdir}/llvm%{maj_ver}/src
|
-DLLVM_MAIN_SRC_DIR=%{install_prefix}/src
|
||||||
|
|
||||||
%ninja_build
|
%ninja_build
|
||||||
|
|
||||||
@ -86,13 +106,6 @@ cd _build
|
|||||||
|
|
||||||
rm %{buildroot}%{install_includedir}/mach-o/compact_unwind_encoding.h
|
rm %{buildroot}%{install_includedir}/mach-o/compact_unwind_encoding.h
|
||||||
|
|
||||||
# Add version suffix to binaries
|
|
||||||
mkdir -p %{buildroot}/%{_bindir}
|
|
||||||
for f in %{buildroot}/%{install_bindir}/*; do
|
|
||||||
filename=`basename $f`
|
|
||||||
ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{bin_suffix}
|
|
||||||
done
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%if %{with check}
|
%if %{with check}
|
||||||
cd _build
|
cd _build
|
||||||
@ -101,12 +114,7 @@ cd _build
|
|||||||
|
|
||||||
%files
|
%files
|
||||||
%license LICENSE.TXT
|
%license LICENSE.TXT
|
||||||
%{_bindir}/lld%{bin_suffix}
|
%{install_bindir}/*
|
||||||
%{_bindir}/lld-link%{bin_suffix}
|
|
||||||
%{_bindir}/ld.lld%{bin_suffix}
|
|
||||||
%{_bindir}/ld64.lld%{bin_suffix}
|
|
||||||
%{_bindir}/wasm-ld%{bin_suffix}
|
|
||||||
%{pkg_bindir}
|
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{install_includedir}/lld
|
%{install_includedir}/lld
|
||||||
@ -117,11 +125,5 @@ cd _build
|
|||||||
%{install_libdir}/liblld*.so.*
|
%{install_libdir}/liblld*.so.*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Feb 20 2023 Chenxi Mao <chenxi.mao@suse.com> - 15.0.7-1
|
* Thu May 25 2023 cf-zhao <zhaochuanfeng@huawei.com> - 12.0.1-1
|
||||||
- Upgrade to 15.0.7.
|
|
||||||
|
|
||||||
* Thu Feb 9 2023 Chenxi Mao <chenxi.mao@suse.com> - 15.0.6-2
|
|
||||||
- Enable lld unit test.
|
|
||||||
|
|
||||||
* Mon Jan 2 2023 Chenxi Mao <chenxi.mao@suse.com> - 15.0.6-1
|
|
||||||
- Package init
|
- Package init
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user