Blame SPECS/lld.spec

36eb0e
#%%global rc_ver 6
7d1e81
%global baserelease 3
074ff8
%global lld_srcdir lld-%{version}%{?rc_ver:rc%{rc_ver}}.src
7d1e81
%global maj_ver 11
36eb0e
%global min_ver 0
7d1e81
%global patch_ver 0
074ff8
f79958
# Don't include unittests in automatic generation of provides or requires.
f79958
%global __provides_exclude_from ^%{_libdir}/lld/.*$
f79958
%global __requires_exclude ^libgtest.*$
f79958
f79958
%bcond_with ld_alternative
0d6038
074ff8
Name:		lld
36eb0e
Version:	%{maj_ver}.%{min_ver}.%{patch_ver}
f79958
Release:	%{baserelease}%{?rc_ver:.rc%{rc_ver}}%{?dist}
074ff8
Summary:	The LLVM Linker
074ff8
074ff8
License:	NCSA
074ff8
URL:		http://llvm.org
7d1e81
Source0:	https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{lld_srcdir}.tar.xz
7d1e81
Source1:	https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{lld_srcdir}.tar.xz.sig
7d1e81
Source2:	https://prereleases.llvm.org/%{version}/hans-gpg-key.asc
7d1e81
Source3:	run-lit-tests
7d1e81
Source4:	lit.lld-test.cfg.py
074ff8
074ff8
Patch0:		0001-CMake-Check-for-gtest-headers-even-if-lit.py-is-not-.patch
7d1e81
Patch1:		0001-Revert-lld-Initial-commit-for-new-Mach-O-backend.patch
7d1e81
7d1e81
ExcludeArch:	s390x
074ff8
0d6038
BuildRequires:	gcc
0d6038
BuildRequires:	gcc-c++
0d6038
BuildRequires:	cmake
7d1e81
BuildRequires:	ninja-build
0d6038
BuildRequires:	llvm-devel = %{version}
0d6038
BuildRequires:	llvm-test = %{version}
0d6038
BuildRequires:	ncurses-devel
0d6038
BuildRequires:	zlib-devel
7d1e81
BuildRequires:	python3-devel
074ff8
074ff8
# For make check:
0d6038
BuildRequires:	python3-rpm-macros
0d6038
BuildRequires:	python3-lit
0d6038
BuildRequires:	llvm-googletest = %{version}
074ff8
f79958
%if %{with ld_alternative}
f79958
Requires(post): %{_sbindir}/alternatives
f79958
Requires(preun): %{_sbindir}/alternatives
f79958
%endif
f79958
f79958
Requires: lld-libs = %{version}-%{release}
f79958
074ff8
%description
074ff8
The LLVM project linker.
074ff8
074ff8
%package devel
074ff8
Summary:	Libraries and header files for LLD
7d1e81
Requires: lld-libs%{?_isa} = %{version}-%{release}
7d1e81
# lld tools are referenced in the cmake files, so we need to add lld as a
7d1e81
# dependency.
7d1e81
Requires: %{name}%{?_isa} = %{version}-%{release}
074ff8
074ff8
%description devel
074ff8
This package contains library and header files needed to develop new native
074ff8
programs that use the LLD infrastructure.
074ff8
074ff8
%package libs
074ff8
Summary:	LLD shared libraries
074ff8
074ff8
%description libs
074ff8
Shared libraries for LLD.
074ff8
f79958
%package test
f79958
Summary: LLD regression tests
f79958
Requires:	%{name}%{?_isa} = %{version}-%{release}
f79958
Requires:	python3-lit
f79958
Requires:	llvm-test(major) = %{maj_ver}
f79958
Requires:	lld-libs = %{version}-%{release}
f79958
f79958
%description test
f79958
LLVM regression tests.
f79958
074ff8
%prep
7d1e81
7d1e81
%setup -q -n %{lld_srcdir}
7d1e81
7d1e81
%patch0 -p1 -b .gtest-fix
7d1e81
# Remove the MachO backend since it doesn't seem to work on big-endian hosts.
7d1e81
%ifarch s390x
7d1e81
%patch1 -p2 -b .remove-MachO
7d1e81
%endif
7d1e81
074ff8
074ff8
%build
074ff8
074ff8
mkdir %{_target_platform}
074ff8
cd %{_target_platform}
074ff8
074ff8
%cmake .. \
7d1e81
	-GNinja \
074ff8
	-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
074ff8
	-DLLVM_DYLIB_COMPONENTS="all" \
7d1e81
	-DCMAKE_SKIP_RPATH:BOOL=ON \
0d6038
	-DPYTHON_EXECUTABLE=%{__python3} \
074ff8
	-DLLVM_INCLUDE_TESTS=ON \
074ff8
	-DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \
074ff8
	-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
074ff8
	-DLLVM_LIT_ARGS="-sv \
0d6038
	--path %{_libdir}/llvm" \
074ff8
%if 0%{?__isa_bits} == 64
074ff8
	-DLLVM_LIBDIR_SUFFIX=64
074ff8
%else
074ff8
	-DLLVM_LIBDIR_SUFFIX=
074ff8
%endif
074ff8
7d1e81
%ninja_build
074ff8
f79958
# Build the unittests so we can install them.
7d1e81
%ninja_build lld-test-depends
f79958
074ff8
%install
f79958
f79958
%global lit_cfg test/%{_arch}.site.cfg.py
f79958
%global lit_unit_cfg test/Unit/%{_arch}.site.cfg.py
f79958
%global lit_lld_test_cfg_install_path %{_datadir}/lld/lit.lld-test.cfg.py
f79958
f79958
# Generate lit config files.  Strip off the last line that initiates the
f79958
# test run, so we can customize the configuration.
f79958
head -n -1 %{_target_platform}/test/lit.site.cfg.py >> %{lit_cfg}
f79958
head -n -1 %{_target_platform}/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}
f79958
f79958
# Patch lit config files to load custom config:
f79958
for f in %{lit_cfg} %{lit_unit_cfg}; do
f79958
  echo "lit_config.load_config(config, '%{lit_lld_test_cfg_install_path}')" >> $f
f79958
done
f79958
f79958
# Install test files
f79958
install -d %{buildroot}%{_datadir}/lld/src
7d1e81
cp %{SOURCE4} %{buildroot}%{_datadir}/lld/
f79958
36eb0e
# The various tar options are there to make sur the archive is the same on 32 and 64 bit arch, i.e.
36eb0e
# the archive creation is reproducible. Move arch-specific content out of the tarball
36eb0e
mv %{lit_cfg} %{buildroot}%{_datadir}/lld/src/%{_arch}.site.cfg.py
36eb0e
mv %{lit_unit_cfg} %{buildroot}%{_datadir}/lld/src/%{_arch}.Unit.site.cfg.py
36eb0e
tar --sort=name --mtime='UTC 2020-01-01' -c test/ | gzip -n > %{buildroot}%{_datadir}/lld/src/test.tar.gz
36eb0e
f79958
install -d %{buildroot}%{_libexecdir}/tests/lld
7d1e81
cp %{SOURCE3} %{buildroot}%{_libexecdir}/tests/lld
f79958
f79958
# Install unit test binaries
f79958
install -d %{buildroot}%{_libdir}/lld/
f79958
cp -R %{_target_platform}/unittests %{buildroot}%{_libdir}/lld/
f79958
rm -rf `find %{buildroot}%{_libdir}/lld/ -iname '*make*'`
f79958
f79958
# Install gtest libraries
f79958
cp %{_target_platform}/%{_lib}/libgtest*so* %{buildroot}%{_libdir}/lld/
f79958
f79958
# Install libraries and binaries
074ff8
cd %{_target_platform}
7d1e81
%ninja_install
f79958
f79958
%if %{with ld_alternative}
f79958
# Required when using update-alternatives:
f79958
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/
f79958
touch %{buildroot}%{_bindir}/ld
f79958
f79958
%post
f79958
%{_sbindir}/update-alternatives --install %{_bindir}/ld ld %{_bindir}/ld.lld 1
f79958
f79958
%postun
f79958
if [ $1 -eq 0 ] ; then
f79958
  %{_sbindir}/update-alternatives --remove ld %{_bindir}/ld.lld
f79958
fi
f79958
%endif
074ff8
074ff8
%check
0d6038
f79958
# armv7lhl tests disabled because of arm issue, see https://koji.fedoraproject.org/koji/taskinfo?taskID=33660162
f79958
%ifnarch %{arm}
7d1e81
%ninja_build -C %{_target_platform} %{?_smp_mflags} check-lld
0d6038
%endif
074ff8
0d6038
%ldconfig_scriptlets libs
074ff8
074ff8
%files
7d1e81
%license LICENSE.TXT
f79958
%if %{with ld_alternative}
f79958
%ghost %{_bindir}/ld
f79958
%endif
074ff8
%{_bindir}/lld*
074ff8
%{_bindir}/ld.lld
074ff8
%{_bindir}/ld64.lld
074ff8
%{_bindir}/wasm-ld
074ff8
074ff8
%files devel
074ff8
%{_includedir}/lld
074ff8
%{_libdir}/liblld*.so
7d1e81
%{_libdir}/cmake/lld/
074ff8
074ff8
%files libs
074ff8
%{_libdir}/liblld*.so.*
074ff8
f79958
%files test
f79958
%{_libexecdir}/tests/lld/
f79958
%{_libdir}/lld/
f79958
%{_datadir}/lld/src/test.tar.gz
36eb0e
%{_datadir}/lld/src/%{_arch}.site.cfg.py
36eb0e
%{_datadir}/lld/src/%{_arch}.Unit.site.cfg.py
f79958
%{_datadir}/lld/lit.lld-test.cfg.py
f79958
074ff8
%changelog
7d1e81
* Mon Nov 09 2020 sguelton@redhat.com - 11.0.0-3
7d1e81
- Exclude s390x, see rhbz#1894927
7d1e81
7d1e81
* Thu Oct 29 2020 sguelton@redhat.com - 11.0.0-1
7d1e81
- 11.0.0 final
7d1e81
7d1e81
* Fri Sep 18 2020 sguelton@redhat.com - 11.0.0-0.1.rc2
7d1e81
- 11.0.0-rc2 Release
7d1e81
36eb0e
* Fri Jul 24 2020 sguelton@redhat.com - 10.0.1-1
36eb0e
- 10.0.1 release
36eb0e
36eb0e
* Mon Jul 20 2020 sguelton@redhat.com - 10.0.0-2
36eb0e
- Fix arch-dependent tarball
36eb0e
36eb0e
* Thu Apr 9 2020 sguelton@redhat.com - 10.0.0-1
36eb0e
- 10.0.0 final
36eb0e
f79958
* Thu Dec 19 2019 Tom Stellard <tstellar@redhat.com> -9.0.1-1
f79958
- 9.0.1 Release
f79958
f79958
* Fri Dec 13 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-5
f79958
- Fix some rpmdiff errors
f79958
f79958
* Fri Dec 13 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-4
f79958
- Remove build artifacts installed with unittests
f79958
f79958
* Thu Dec 05 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-3
f79958
- Add lld-test package
f79958
f79958
* Thu Nov 14 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-2
f79958
- Add explicit lld-libs requires to fix rpmdiff errors
f79958
f79958
* Thu Sep 26 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-1
f79958
- 9.0.0 Release
f79958
0d6038
* Thu Aug 1 2019 sguelton@redhat.com - 8.0.1-1
0d6038
- 8.0.1 release
0d6038
0d6038
* Mon Jun 17 2019 sguelton@redhat.com - 8.0.1-0.2.rc2
0d6038
- Remove unnecessary threading patch
0d6038
0d6038
* Thu Jun 13 2019 sguelton@redhat.com - 8.0.1-0.1.rc2
0d6038
- 8.0.1rc2 Release
0d6038
0d6038
* Tue Apr 16 2019 sguelton@redhat.com - 8.0.0-1
0d6038
- 8.0.0 Release
0d6038
074ff8
* Mon Jan 14 2019 sguelton@redhat.com - 7.0.1-3
074ff8
- Fix lld + annobin integration & Setup basic CI tests
074ff8
074ff8
* Sat Dec 15 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-2
074ff8
- Bump required python3-lit version
074ff8
074ff8
* Fri Dec 14 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-1
074ff8
- 7.0.1-1 Release
074ff8
074ff8
* Mon Dec 10 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-0.2.rc3
074ff8
- 7.0.1-rc3 Release
074ff8
074ff8
* Tue Nov 27 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-1
074ff8
- 7.0.0 Release
074ff8
074ff8
* Mon Oct 01 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-2
074ff8
- Drop scl macros
074ff8
074ff8
* Wed Jun 27 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-1
074ff8
- 6.0.1 Release
074ff8
074ff8
* Fri May 11 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-0.1.rc1
074ff8
- 6.0.1-rc1 Release
074ff8
074ff8
* Thu Mar 08 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-1
074ff8
- 6.0.0 Release
074ff8
074ff8
* Tue Feb 13 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-0.3.rc2
074ff8
- 6.0.0-rc2 Release
074ff8
074ff8
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.0-0.2.rc1
074ff8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
074ff8
074ff8
* Thu Jan 25 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-0.1.rc1
074ff8
- 6.0.0-rc1 Release
074ff8
074ff8
* Thu Dec 21 2017 Tom Stellard <tstellar@redhat.com> - 5.0.1-1
074ff8
- 5.0.1 Release
074ff8
074ff8
* Mon Sep 11 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-1
074ff8
- 5.0.0 Release
074ff8
074ff8
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-4
074ff8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
074ff8
074ff8
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-3
074ff8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
074ff8
074ff8
* Thu Jul 06 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-2
074ff8
- Backport r307092
074ff8
074ff8
* Tue Jul 04 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-1
074ff8
- 4.0.1 Release
074ff8
074ff8
* Tue Jul 04 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-4
074ff8
- Fix build without llvm-static
074ff8
074ff8
* Wed May 31 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-3
074ff8
- Remove llvm-static dependency
074ff8
074ff8
* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-2
074ff8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild
074ff8
074ff8
* Tue Mar 14 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-1
074ff8
- lld 4.0.0 Final Release