Blame SPECS/lld.spec

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