Blame SPECS/lld.spec

32f785
#%%global rc_ver 5
32f785
%global lld_srcdir lld-%{version}%{?rc_ver:rc%{rc_ver}}.src
32f785
%global maj_ver 12
32f785
%global min_ver 0
32f785
%global patch_ver 0
32f785
32f785
# Don't include unittests in automatic generation of provides or requires.
32f785
%global __provides_exclude_from ^%{_libdir}/lld/.*$
32f785
%global __requires_exclude ^libgtest.*$
32f785
32f785
Name:		lld
32f785
Version:	%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}
32f785
Release:	1%{?dist}
32f785
Summary:	The LLVM Linker
32f785
32f785
License:	NCSA
32f785
URL:		http://llvm.org
32f785
Source0:	https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{lld_srcdir}.tar.xz
32f785
Source1:	https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{lld_srcdir}.tar.xz.sig
32f785
Source2:	tstellar-gpg-key.asc
32f785
Source3:	run-lit-tests
32f785
Source4:	lit.lld-test.cfg.py
32f785
32f785
ExcludeArch:	s390x
32f785
32f785
Patch0:		0001-PATCH-lld-CMake-Check-for-gtest-headers-even-if-lit..patch
32f785
32f785
# Bundle libunwind header need during build for MachO support
32f785
Patch1:		0002-PATCH-lld-Import-compact_unwind_encoding.h-from-libu.patch
32f785
32f785
BuildRequires:	gcc
32f785
BuildRequires:	gcc-c++
32f785
BuildRequires:	cmake
32f785
BuildRequires:	ninja-build
32f785
BuildRequires:	llvm-devel = %{version}
32f785
BuildRequires:	llvm-test = %{version}
32f785
BuildRequires:	ncurses-devel
32f785
BuildRequires:	zlib-devel
32f785
32f785
# For make check:
32f785
BuildRequires:	python3-rpm-macros
32f785
BuildRequires:	python3-lit
32f785
BuildRequires:	llvm-googletest = %{version}
32f785
32f785
# For gpg source verification
32f785
BuildRequires:	gnupg2
32f785
32f785
Requires(post): %{_sbindir}/update-alternatives
32f785
Requires(preun): %{_sbindir}/update-alternatives
32f785
32f785
Requires: lld-libs = %{version}-%{release}
32f785
32f785
%description
32f785
The LLVM project linker.
32f785
32f785
%package devel
32f785
Summary:	Libraries and header files for LLD
32f785
Requires: lld-libs%{?_isa} = %{version}-%{release}
32f785
# lld tools are referenced in the cmake files, so we need to add lld as a
32f785
# dependency.
32f785
Requires: %{name}%{?_isa} = %{version}-%{release}
32f785
32f785
%description devel
32f785
This package contains library and header files needed to develop new native
32f785
programs that use the LLD infrastructure.
32f785
32f785
%package libs
32f785
Summary:	LLD shared libraries
32f785
32f785
%description libs
32f785
Shared libraries for LLD.
32f785
32f785
%package test
32f785
Summary: LLD regression tests
32f785
Requires:	%{name}%{?_isa} = %{version}-%{release}
32f785
Requires:	python3-lit
32f785
Requires:	llvm-test(major) = %{maj_ver}
32f785
Requires:	lld-libs = %{version}-%{release}
32f785
32f785
%description test
32f785
LLVM regression tests.
32f785
32f785
%prep
32f785
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
32f785
%autosetup -n %{lld_srcdir} -p2
32f785
32f785
32f785
%build
32f785
32f785
# Disable lto since it causes the COFF/libpath.test lit test to crash.
32f785
%global _lto_cflags %{nil}
32f785
32f785
%cmake \
32f785
	-GNinja \
32f785
	-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
32f785
	-DLLVM_DYLIB_COMPONENTS="all" \
32f785
	-DCMAKE_SKIP_RPATH:BOOL=ON \
32f785
	-DPYTHON_EXECUTABLE=%{__python3} \
32f785
	-DLLVM_INCLUDE_TESTS=ON \
32f785
	-DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \
32f785
	-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
32f785
	-DLLVM_LIT_ARGS="-sv \
32f785
	--path %{_libdir}/llvm" \
32f785
%if 0%{?__isa_bits} == 64
32f785
	-DLLVM_LIBDIR_SUFFIX=64
32f785
%else
32f785
	-DLLVM_LIBDIR_SUFFIX=
32f785
%endif
32f785
32f785
%cmake_build
32f785
32f785
# Build the unittests so we can install them.
32f785
%cmake_build --target lld-test-depends
32f785
32f785
%install
32f785
32f785
%global lit_cfg test/%{_arch}.site.cfg.py
32f785
%global lit_unit_cfg test/Unit/%{_arch}.site.cfg.py
32f785
%global lit_lld_test_cfg_install_path %{_datadir}/lld/lit.lld-test.cfg.py
32f785
32f785
# Generate lit config files.  Strip off the last line that initiates the
32f785
# test run, so we can customize the configuration.
32f785
head -n -1 %{_target_platform}/test/lit.site.cfg.py >> %{lit_cfg}
32f785
head -n -1 %{_target_platform}/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}
32f785
32f785
# Patch lit config files to load custom config:
32f785
for f in %{lit_cfg} %{lit_unit_cfg}; do
32f785
  echo "lit_config.load_config(config, '%{lit_lld_test_cfg_install_path}')" >> $f
32f785
done
32f785
32f785
# Install test files
32f785
install -d %{buildroot}%{_datadir}/lld/src
32f785
cp %{SOURCE4} %{buildroot}%{_datadir}/lld/
32f785
32f785
# The various tar options are there to make sur the archive is the same on 32 and 64 bit arch, i.e.
32f785
# the archive creation is reproducible. Move arch-specific content out of the tarball
32f785
mv %{lit_cfg} %{buildroot}%{_datadir}/lld/src/%{_arch}.site.cfg.py
32f785
mv %{lit_unit_cfg} %{buildroot}%{_datadir}/lld/src/%{_arch}.Unit.site.cfg.py
32f785
tar --sort=name --mtime='UTC 2020-01-01' -c test/ | gzip -n > %{buildroot}%{_datadir}/lld/src/test.tar.gz
32f785
32f785
install -d %{buildroot}%{_libexecdir}/tests/lld
32f785
install -m 0755 %{SOURCE3} %{buildroot}%{_libexecdir}/tests/lld
32f785
32f785
# Install unit test binaries
32f785
install -d %{buildroot}%{_libdir}/lld/
32f785
cp -R %{_target_platform}/unittests %{buildroot}%{_libdir}/lld/
32f785
rm -rf `find %{buildroot}%{_libdir}/lld/ -iname '*make*'`
32f785
32f785
# Install gtest libraries
32f785
cp %{_target_platform}/%{_lib}/libgtest*so* %{buildroot}%{_libdir}/lld/
32f785
32f785
# Install libraries and binaries
32f785
%cmake_install
32f785
32f785
# This is generated by Patch1 during build and (probably) must be removed afterward
32f785
rm %{buildroot}%{_includedir}/mach-o/compact_unwind_encoding.h
32f785
32f785
# Required when using update-alternatives:
32f785
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/
32f785
touch %{buildroot}%{_bindir}/ld
32f785
32f785
%post
32f785
%{_sbindir}/update-alternatives --install %{_bindir}/ld ld %{_bindir}/ld.lld 1
32f785
32f785
%postun
32f785
if [ $1 -eq 0 ] ; then
32f785
  %{_sbindir}/update-alternatives --remove ld %{_bindir}/ld.lld
32f785
fi
32f785
32f785
%check
32f785
32f785
# armv7lhl tests disabled because of arm issue, see https://koji.fedoraproject.org/koji/taskinfo?taskID=33660162
32f785
%ifnarch %{arm}
32f785
%cmake_build --target check-lld
32f785
%endif
32f785
32f785
%ldconfig_scriptlets libs
32f785
32f785
%files
32f785
%license LICENSE.TXT
32f785
%ghost %{_bindir}/ld
32f785
%{_bindir}/lld*
32f785
%{_bindir}/ld.lld
32f785
%{_bindir}/ld64.lld
32f785
%{_bindir}/ld64.lld.darwinnew
32f785
%{_bindir}/wasm-ld
32f785
32f785
%files devel
32f785
%{_includedir}/lld
32f785
%{_libdir}/liblld*.so
32f785
%{_libdir}/cmake/lld/
32f785
32f785
%files libs
32f785
%{_libdir}/liblld*.so.*
32f785
32f785
%files test
32f785
%{_libexecdir}/tests/lld/
32f785
%{_libdir}/lld/
32f785
%{_datadir}/lld/src/test.tar.gz
32f785
%{_datadir}/lld/src/%{_arch}.site.cfg.py
32f785
%{_datadir}/lld/src/%{_arch}.Unit.site.cfg.py
32f785
%{_datadir}/lld/lit.lld-test.cfg.py
32f785
32f785
%changelog
32f785
* Fri Apr 16 2021 Tom Stellard <tstellar@redhat.com> - 12.0.0-1
32f785
- 12.0.0 Release
32f785
32f785
* Thu Apr 08 2021 sguelton@redhat.com - 12.0.0-0.8.rc5
32f785
- New upstream release candidate
32f785
32f785
* Wed Apr 07 2021 Tom Stellard <tstellar@redhat.com> - 12.0.0-0.7.rc4
32f785
- Set executable permissions on run-lit-tests
32f785
32f785
* Fri Apr 02 2021 sguelton@redhat.com - 12.0.0-0.6.rc4
32f785
- New upstream release candidate
32f785
32f785
* Wed Mar 31 2021 Jonathan Wakely <jwakely@redhat.com> - 12.0.0-0.5.rc3
32f785
- Rebuilt for removed libstdc++ symbols (#1937698)
32f785
32f785
* Thu Mar 11 2021 sguelton@redhat.com - 12.0.0-0.4.rc3
32f785
- LLVM 12.0.0 rc3
32f785
32f785
* Wed Mar 10 2021 sguelton@redhat.com - 12.0.0-0.3.rc2
32f785
- rebuilt
32f785
32f785
* Wed Feb 24 2021 sguelton@redhat.com - 12.0.0-0.2.rc2
32f785
- llvm 12.0.0-rc2 release
32f785
32f785
* Tue Feb 16 2021 sguelton@redhat.com - 12.0.0-0.1.rc1
32f785
- llvm 12.0.0-rc1 release
32f785
32f785
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 11.1.0-0.3.rc2
32f785
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
32f785
32f785
* Fri Jan 22 2021 Serge Guelton - 11.1.0-0.2.rc2
32f785
- llvm 11.1.0-rc2 release
32f785
32f785
* Thu Jan 14 2021 Serge Guelton - 11.1.0-0.1.rc1
32f785
- 11.1.0-rc1 release
32f785
32f785
* Wed Jan 06 2021 Serge Guelton - 11.0.1-3
32f785
- LLVM 11.0.1 final
32f785
32f785
* Tue Dec 22 2020 sguelton@redhat.com - 11.0.1-2.rc2
32f785
- llvm 11.0.1-rc2
32f785
32f785
* Tue Dec 01 2020 sguelton@redhat.com - 11.0.1-1.rc1
32f785
- llvm 11.0.1-rc1
32f785
32f785
* Thu Nov 12 2020 sguelton@redhat.com - 11.0.0-3
32f785
- Exclude s390x, unsupported upstream
32f785
32f785
* Mon Oct 19 2020 sguelton@redhat.com - 11.0.0-2
32f785
- Rebuilt with all gating tests on
32f785
32f785
* Thu Oct 15 2020 sguelton@redhat.com - 11.0.0-1
32f785
- Fix NVR
32f785
32f785
* Mon Oct 12 2020 sguelton@redhat.com - 11.0.0-0.6
32f785
- llvm 11.0.0 - final release
32f785
32f785
* Thu Oct 08 2020 sguelton@redhat.com - 11.0.0-0.5.rc6
32f785
- 11.0.0-rc6
32f785
32f785
* Wed Oct 07 2020 sguelton@redhat.com - 11.0.0-0.4.rc5
32f785
- Update CI tests
32f785
32f785
* Fri Oct 02 2020 sguelton@redhat.com - 11.0.0-0.3.rc5
32f785
- 11.0.0-rc5 Release
32f785
32f785
* Sun Sep 27 2020 sguelton@redhat.com - 11.0.0-0.2.rc3
32f785
- Fix NVR
32f785
32f785
* Thu Sep 24 2020 sguelton@redhat.com - 11.0.0-0.1.rc3
32f785
- 11.0.0-rc3 Release
32f785
32f785
* Tue Sep 01 2020 sguelton@redhat.com - 11.0.0-0.1.rc2
32f785
- 11.0.0-rc2 Release
32f785
32f785
* Mon Aug 10 2020 Tom Stellard <tstellar@redhat.com> - 11.0.0-0.1.rc1
32f785
- 11.0.0-rc1 Release
32f785
32f785
* Mon Aug 10 2020 sguelton@redhat.com - 10.0.0-7
32f785
- use %%license macro
32f785
32f785
* Mon Aug 10 2020 Tom Stellard <tstellar@redhat.com> - 10.0.0-6
32f785
- Disable LTO
32f785
32f785
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 10.0.0-5
32f785
- Second attempt - Rebuilt for
32f785
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
32f785
32f785
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 10.0.0-4
32f785
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
32f785
32f785
* Mon Jul 20 2020 sguelton@redhat.com - 10.0.0-3
32f785
- Use generic cmake macros
32f785
- Use Ninja as build system
32f785
- Remove chrpath dependency
32f785
32f785
* Fri Jul 17 2020 sguelton@redhat.com - 10.0.0-2
32f785
- Make test archive arch-independent
32f785
32f785
* Mon Mar 30 2020 sguelton@redhat.com - 10.0.0-1
32f785
- 10.0.0 final
32f785
32f785
* Wed Mar 25 2020 sguelton@redhat.com - 10.0.0-0.6.rc6
32f785
- 10.0.0 rc6
32f785
32f785
* Fri Mar 20 2020 sguelton@redhat.com - 10.0.0-0.5.rc5
32f785
- 10.0.0 rc5
32f785
32f785
* Sun Mar 15 2020 sguelton@redhat.com - 10.0.0-0.4.rc4
32f785
- 10.0.0 rc4
32f785
32f785
* Thu Mar 05 2020 sguelton@redhat.com - 10.0.0-0.3.rc3
32f785
- 10.0.0 rc3
32f785
32f785
* Fri Feb 14 2020 sguelton@redhat.com - 10.0.0-0.2.rc2
32f785
- 10.0.0 rc2
32f785
32f785
* Fri Jan 31 2020 sguelton@redhat.com - 10.0.0-0.1.rc1
32f785
- 10.0.0 rc1
32f785
32f785
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 9.0.1-2
32f785
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
32f785
32f785
* Thu Dec 19 2019 Tom Stellard <tstellar@redhat.com> -9.0.1-1
32f785
- 9.0.1 Release
32f785
32f785
* Sat Dec 14 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-6
32f785
- Fix some rpmdiff errors
32f785
32f785
* Fri Dec 13 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-5
32f785
- Remove build artifacts installed with unittests
32f785
32f785
* Thu Dec 05 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-4
32f785
- Enable GPG-based source file verification
32f785
32f785
* Thu Dec 05 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-3
32f785
- Add lld-test package
32f785
32f785
* Thu Nov 14 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-2
32f785
- Add explicit lld-libs requires to fix rpmdiff errors
32f785
32f785
* Thu Sep 19 2019 Tom Stellard <tstellar@redhat.com> -9.0.0-1
32f785
- 9.0.0 Release
32f785
32f785
* Thu Aug 22 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-0.1.rc3
32f785
- 9.0.0-rc3 Release
32f785
32f785
* Tue Aug 20 2019 Tom Stellard <tstellar@redhat.com> - 8.0.0-3
32f785
- touch /usr/bin/ld as required by the packaging guidelines for
32f785
  update-alternatives
32f785
32f785
* Tue Aug 13 2019 Tom Stellard <tstellar@redhat.com> - 8.0.0-2
32f785
- Add update-alternative for ld
32f785
32f785
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 8.0.0-1.1
32f785
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
32f785
32f785
* Wed Mar 20 2019 sguelton@redhat.com - 8.0.0-1
32f785
- 8.0.0 final
32f785
32f785
* Tue Mar 12 2019 sguelton@redhat.com - 8.0.0-0.4.rc4
32f785
- 8.0.0 Release candidate 4
32f785
32f785
* Tue Mar 5 2019 sguelton@redhat.com - 8.0.0-0.4.rc3
32f785
- Cleanup specfile after llvm specfile update
32f785
32f785
* Mon Mar 4 2019 sguelton@redhat.com - 8.0.0-0.3.rc3
32f785
- 8.0.0 Release candidate 3
32f785
32f785
* Fri Feb 22 2019 sguelton@redhat.com - 8.0.0-0.2.rc2
32f785
- 8.0.0 Release candidate 2
32f785
32f785
* Mon Feb 11 2019 sguelton@redhat.com - 8.0.0-0.1.rc1
32f785
- 8.0.0 Release candidate 1
32f785
32f785
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7.0.1-3.1
32f785
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
32f785
32f785
* Mon Jan 14 2019 sguelton@redhat.com - 7.0.1-3
32f785
- Fix lld + annobin integration & Setup basic CI tests
32f785
32f785
* Mon Dec 17 2018 sguelton@redhat.com - 7.0.1-2
32f785
- Update lit dependency
32f785
32f785
* Mon Dec 17 2018 sguelton@redhat.com - 7.0.1-1
32f785
- 7.0.1 Release
32f785
32f785
* Tue Dec 04 2018 sguelton@redhat.com - 7.0.0-2
32f785
- Ensure rpmlint passes on specfile
32f785
32f785
* Mon Sep 24 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-1
32f785
- 7.0.1 Release
32f785
32f785
* Tue Sep 11 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-0.4.rc3
32f785
- 7.0.0-rc3 Release
32f785
32f785
* Fri Aug 31 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-0.3.rc2
32f785
- 7.0.0-rc2 Release
32f785
32f785
* Thu Aug 30 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-0.2.rc1
32f785
- Enable make check
32f785
32f785
* Mon Aug 13 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-0.1.rc1
32f785
- 7.0.0-rc1 Release
32f785
32f785
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.1-2
32f785
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
32f785
32f785
* Wed Jun 27 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-1
32f785
- 6.0.1 Release
32f785
32f785
* Fri May 11 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-0.1.rc1
32f785
- 6.0.1-rc1 Release
32f785
32f785
* Thu Mar 08 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-1
32f785
- 6.0.0 Release
32f785
32f785
* Tue Feb 13 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-0.3.rc2
32f785
- 6.0.0-rc2 Release
32f785
32f785
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.0-0.2.rc1
32f785
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
32f785
32f785
* Thu Jan 25 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-0.1.rc1
32f785
- 6.0.0-rc1 Release
32f785
32f785
* Thu Dec 21 2017 Tom Stellard <tstellar@redhat.com> - 5.0.1-1
32f785
- 5.0.1 Release
32f785
32f785
* Mon Sep 11 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-1
32f785
- 5.0.0 Release
32f785
32f785
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-4
32f785
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
32f785
32f785
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-3
32f785
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
32f785
32f785
* Thu Jul 06 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-2
32f785
- Backport r307092
32f785
32f785
* Tue Jul 04 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-1
32f785
- 4.0.1 Release
32f785
32f785
* Tue Jul 04 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-4
32f785
- Fix build without llvm-static
32f785
32f785
* Wed May 31 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-3
32f785
- Remove llvm-static dependency
32f785
32f785
* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-2
32f785
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild
32f785
32f785
* Tue Mar 14 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-1
32f785
- lld 4.0.0 Final Release