2023-05-15 20:21:56 +08:00
|
|
|
%bcond_without check
|
|
|
|
|
|
|
|
|
|
%global maj_ver 15
|
2023-01-30 22:08:04 +08:00
|
|
|
%global min_ver 0
|
2023-05-15 20:21:56 +08:00
|
|
|
%global patch_ver 7
|
|
|
|
|
|
|
|
|
|
%global pkg_name lld%{maj_ver}
|
|
|
|
|
%global bin_suffix -%{maj_ver}
|
|
|
|
|
%global install_prefix %{_libdir}/llvm%{maj_ver}
|
|
|
|
|
%global install_includedir %{install_prefix}/include
|
|
|
|
|
%global install_libdir %{install_prefix}/lib
|
|
|
|
|
%global install_bindir %{install_prefix}/bin
|
|
|
|
|
%global pkg_bindir %{install_bindir}
|
2023-01-30 22:08:04 +08:00
|
|
|
|
|
|
|
|
# Don't include unittests in automatic generation of provides or requires.
|
|
|
|
|
%global __provides_exclude_from ^%{_libdir}/lld/.*$
|
|
|
|
|
%global __requires_exclude ^libgtest.*$
|
|
|
|
|
|
2023-05-15 20:21:56 +08:00
|
|
|
Name: %{pkg_name}
|
2023-01-30 22:08:04 +08:00
|
|
|
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
|
|
|
|
|
Release: 1
|
|
|
|
|
Summary: The LLVM Linker
|
|
|
|
|
|
|
|
|
|
License: NCSA
|
|
|
|
|
URL: http://llvm.org
|
|
|
|
|
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lld-%{version}.src.tar.xz
|
|
|
|
|
|
2023-05-15 20:21:56 +08:00
|
|
|
Patch1: fedora-PATCH-lld-Import-compact_unwind_encoding.h-from-libu.patch
|
2023-01-30 22:08:04 +08:00
|
|
|
|
|
|
|
|
BuildRequires: clang
|
|
|
|
|
BuildRequires: cmake
|
2023-05-15 20:21:56 +08:00
|
|
|
BuildRequires: llvm%{maj_ver}-devel = %{version}
|
|
|
|
|
BuildRequires: llvm%{maj_ver}-googletest = %{version}
|
|
|
|
|
BuildRequires: llvm%{maj_ver}-test = %{version}
|
2023-01-30 22:08:04 +08:00
|
|
|
BuildRequires: ncurses-devel
|
2023-05-15 20:21:56 +08:00
|
|
|
BuildRequires: ninja-build
|
2023-01-30 22:08:04 +08:00
|
|
|
BuildRequires: python3-rpm-macros
|
2023-05-15 20:21:56 +08:00
|
|
|
BuildRequires: python3-lit >= %{version}
|
|
|
|
|
BuildRequires: zlib-devel
|
2023-01-30 22:08:04 +08:00
|
|
|
|
|
|
|
|
Requires(post): %{_sbindir}/update-alternatives
|
|
|
|
|
Requires(preun): %{_sbindir}/update-alternatives
|
|
|
|
|
|
|
|
|
|
Requires: %{name}-libs = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
The LLVM project linker.
|
|
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
|
Summary: Libraries and header files for LLD
|
|
|
|
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
|
This package contains library and header files needed to develop new native
|
|
|
|
|
programs that use the LLD infrastructure.
|
|
|
|
|
|
|
|
|
|
%package libs
|
|
|
|
|
Summary: LLD shared libraries
|
|
|
|
|
|
|
|
|
|
%description libs
|
|
|
|
|
Shared libraries for LLD.
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%autosetup -n lld-%{version}.src -p2
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
mkdir -p _build
|
|
|
|
|
cd _build
|
|
|
|
|
%cmake .. -G Ninja \
|
2023-05-15 20:21:56 +08:00
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
|
-DCMAKE_INSTALL_PREFIX=%{install_prefix} \
|
2023-01-30 22:08:04 +08:00
|
|
|
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
|
|
|
|
|
-DLLVM_DYLIB_COMPONENTS="all" \
|
|
|
|
|
-DCMAKE_SKIP_RPATH:BOOL=ON \
|
|
|
|
|
-DPYTHON_EXECUTABLE=%{__python3} \
|
2023-05-15 20:21:56 +08:00
|
|
|
-DLLVM_INCLUDE_TESTS=ON \
|
|
|
|
|
-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
|
|
|
|
|
-DLLVM_LIT_ARGS="-sv \
|
|
|
|
|
--path %{_libdir}/llvm%{maj_ver}" \
|
|
|
|
|
-DLLVM_MAIN_SRC_DIR=%{_libdir}/llvm%{maj_ver}/src
|
2023-01-30 22:08:04 +08:00
|
|
|
|
|
|
|
|
%ninja_build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%ninja_install -C _build
|
|
|
|
|
|
2023-05-15 20:21:56 +08:00
|
|
|
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
|
2023-01-30 22:08:04 +08:00
|
|
|
|
|
|
|
|
%check
|
2023-05-15 20:21:56 +08:00
|
|
|
%if %{with check}
|
|
|
|
|
cd _build
|
|
|
|
|
%ninja_build check-lld
|
|
|
|
|
%endif
|
2023-01-30 22:08:04 +08:00
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%license LICENSE.TXT
|
2023-05-15 20:21:56 +08:00
|
|
|
%{_bindir}/lld%{bin_suffix}
|
|
|
|
|
%{_bindir}/lld-link%{bin_suffix}
|
|
|
|
|
%{_bindir}/ld.lld%{bin_suffix}
|
|
|
|
|
%{_bindir}/ld64.lld%{bin_suffix}
|
|
|
|
|
%{_bindir}/wasm-ld%{bin_suffix}
|
|
|
|
|
%{pkg_bindir}
|
2023-01-30 22:08:04 +08:00
|
|
|
|
|
|
|
|
%files devel
|
2023-05-15 20:21:56 +08:00
|
|
|
%{install_includedir}/lld
|
|
|
|
|
%{install_libdir}/liblld*.so
|
|
|
|
|
%{install_libdir}/cmake/lld/
|
2023-01-30 22:08:04 +08:00
|
|
|
|
|
|
|
|
%files libs
|
2023-05-15 20:21:56 +08:00
|
|
|
%{install_libdir}/liblld*.so.*
|
2023-01-30 22:08:04 +08:00
|
|
|
|
|
|
|
|
%changelog
|
2023-05-15 20:21:56 +08:00
|
|
|
* Mon Feb 20 2023 Chenxi Mao <chenxi.mao@suse.com> - 15.0.7-1
|
|
|
|
|
- Upgrade to 15.0.7.
|
|
|
|
|
|
|
|
|
|
* Thu Feb 9 2023 Chenxi Mao <chenxi.mao@suse.com> - 15.0.6-2
|
|
|
|
|
- Enable lld unit test.
|
2023-01-30 22:08:04 +08:00
|
|
|
|
2023-05-15 20:21:56 +08:00
|
|
|
* Mon Jan 2 2023 Chenxi Mao <chenxi.mao@suse.com> - 15.0.6-1
|
|
|
|
|
- Package init
|