5209624
%global rc_ver 4
5209624
%global baserelease 0.4
9ab38c3
%global lld_srcdir lld-%{version}%{?rc_ver:rc%{rc_ver}}.src
95ef65b
%global maj_ver 10
95ef65b
%global min_ver 0
95ef65b
%global patch_ver 0
9747614
9747614
# Don't include unittests in automatic generation of provides or requires.
9747614
%global __provides_exclude_from ^%{_libdir}/lld/.*$
9747614
%global __requires_exclude ^libgtest.*$
9ab38c3
098c352
Name:		lld
95ef65b
Version:	%{maj_ver}.%{min_ver}.%{patch_ver}
1e4c7d8
Release:	%{baserelease}%{?rc_ver:.rc%{rc_ver}}%{?dist}
098c352
Summary:	The LLVM Linker
098c352
098c352
License:	NCSA
098c352
URL:		http://llvm.org
0968bb5
Source0:	https://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{lld_srcdir}.tar.xz
9747614
Source1:	run-lit-tests
9747614
Source2:	lit.lld-test.cfg.py
0968bb5
Source3:	https://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{lld_srcdir}.tar.xz.sig
95ef65b
Source4:	https://prereleases.llvm.org/%{version}/hans-gpg-key.asc
098c352
059c998
Patch0:		0001-CMake-Check-for-gtest-headers-even-if-lit.py-is-not-.patch
059c998
3f05fc2
BuildRequires:	gcc
3f05fc2
BuildRequires:	gcc-c++
3f05fc2
BuildRequires:	cmake
3f05fc2
BuildRequires:	llvm-devel = %{version}
d799273
BuildRequires:	llvm-test = %{version}
3f05fc2
BuildRequires:	ncurses-devel
3f05fc2
BuildRequires:	zlib-devel
3f05fc2
BuildRequires:	chrpath
098c352
059c998
# For make check:
4928a61
BuildRequires:	python3-rpm-macros
c6cdb09
BuildRequires:	python3-lit
4928a61
BuildRequires:	llvm-googletest = %{version}
059c998
0968bb5
# For gpg source verification
0968bb5
BuildRequires:	gnupg2
0968bb5
45ecd25
Requires(post): %{_sbindir}/update-alternatives
45ecd25
Requires(preun): %{_sbindir}/update-alternatives
fbb8d64
8f684e0
Requires: lld-libs = %{version}-%{release}
8f684e0
098c352
%description
098c352
The LLVM project linker.
098c352
098c352
%package devel
098c352
Summary:	Libraries and header files for LLD
8f684e0
Requires: lld-libs = %{version}-%{release}
098c352
098c352
%description devel
098c352
This package contains library and header files needed to develop new native
098c352
programs that use the LLD infrastructure.
098c352
098c352
%package libs
098c352
Summary:	LLD shared libraries
098c352
098c352
%description libs
098c352
Shared libraries for LLD.
098c352
9747614
%package test
9747614
Summary: LLD regression tests
9747614
Requires:	%{name}%{?_isa} = %{version}-%{release}
9747614
Requires:	python3-lit
9747614
Requires:	llvm-test(major) = %{maj_ver}
2735326
Requires:	lld-libs = %{version}-%{release}
9747614
9747614
%description test
9747614
LLVM regression tests.
9747614
098c352
%prep
0968bb5
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE0}'
da75323
%autosetup -n %{name}-%{version}%{?rc_ver:rc%{rc_ver}}.src -p1
098c352
098c352
%build
098c352
098c352
mkdir %{_target_platform}
098c352
cd %{_target_platform}
098c352
098c352
%cmake .. \
098c352
	-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
9f38435
	-DLLVM_DYLIB_COMPONENTS="all" \
4928a61
	-DPYTHON_EXECUTABLE=%{__python3} \
059c998
	-DLLVM_INCLUDE_TESTS=ON \
059c998
	-DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \
059c998
	-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
059c998
	-DLLVM_LIT_ARGS="-sv \
3f05fc2
	--path %{_libdir}/llvm" \
098c352
%if 0%{?__isa_bits} == 64
098c352
	-DLLVM_LIBDIR_SUFFIX=64
098c352
%else
098c352
	-DLLVM_LIBDIR_SUFFIX=
098c352
%endif
098c352
098c352
%make_build
098c352
9747614
# Build the unittests so we can install them.
9747614
%make_build lld-test-depends
9747614
098c352
%install
9747614
9747614
%global lit_cfg test/%{_arch}.site.cfg.py
9747614
%global lit_unit_cfg test/Unit/%{_arch}.site.cfg.py
9747614
%global lit_lld_test_cfg_install_path %{_datadir}/lld/lit.lld-test.cfg.py
9747614
9747614
# Generate lit config files.  Strip off the last line that initiates the
9747614
# test run, so we can customize the configuration.
9747614
head -n -1 %{_target_platform}/test/lit.site.cfg.py >> %{lit_cfg}
9747614
head -n -1 %{_target_platform}/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}
9747614
9747614
# Patch lit config files to load custom config:
9747614
for f in %{lit_cfg} %{lit_unit_cfg}; do
9747614
  echo "lit_config.load_config(config, '%{lit_lld_test_cfg_install_path}')" >> $f
9747614
done
9747614
9747614
# Install test files
9747614
install -d %{buildroot}%{_datadir}/lld/src
9747614
cp %{SOURCE2} %{buildroot}%{_datadir}/lld/
9747614
9747614
tar -czf %{buildroot}%{_datadir}/lld/src/test.tar.gz test/
9747614
install -d %{buildroot}%{_libexecdir}/tests/lld
9747614
cp %{SOURCE1} %{buildroot}%{_libexecdir}/tests/lld
9747614
9747614
# Install unit test binaries
9747614
install -d %{buildroot}%{_libdir}/lld/
9747614
cp -R %{_target_platform}/unittests %{buildroot}%{_libdir}/lld/
f0b5c99
rm -rf `find %{buildroot}%{_libdir}/lld/ -iname '*make*'`
9747614
9747614
# Install gtest libraries
9747614
cp %{_target_platform}/%{_lib}/libgtest*so* %{buildroot}%{_libdir}/lld/
9747614
9747614
# Install libraries and binaries
098c352
cd %{_target_platform}
098c352
%make_install
098c352
098c352
# Remove rpath
098c352
chrpath --delete %{buildroot}%{_bindir}/*
098c352
chrpath --delete %{buildroot}%{_libdir}/*.so*
2735326
chrpath --delete `find %{buildroot}%{_libdir}/lld/ -type f`
098c352
9214e08
# Required when using update-alternatives:
9214e08
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/
9214e08
touch %{buildroot}%{_bindir}/ld
9214e08
fbb8d64
%post
fbb8d64
%{_sbindir}/update-alternatives --install %{_bindir}/ld ld %{_bindir}/ld.lld 1
fbb8d64
fbb8d64
%postun
fbb8d64
if [ $1 -eq 0 ] ; then
fbb8d64
  %{_sbindir}/update-alternatives --remove ld %{_bindir}/ld.lld
fbb8d64
fi
9ade981
098c352
%check
d71ad35
d71ad35
# armv7lhl tests disabled because of arm issue, see https://koji.fedoraproject.org/koji/taskinfo?taskID=33660162
107b041
%ifnarch %{arm}
059c998
make -C %{_target_platform} %{?_smp_mflags} check-lld
d71ad35
%endif
098c352
cde0133
%ldconfig_scriptlets libs
098c352
098c352
%files
fbb8d64
%ghost %{_bindir}/ld
098c352
%{_bindir}/lld*
098c352
%{_bindir}/ld.lld
da75323
%{_bindir}/ld64.lld
da75323
%{_bindir}/wasm-ld
098c352
098c352
%files devel
098c352
%{_includedir}/lld
098c352
%{_libdir}/liblld*.so
098c352
098c352
%files libs
098c352
%{_libdir}/liblld*.so.*
098c352
9747614
%files test
9747614
%{_libexecdir}/tests/lld/
9747614
%{_libdir}/lld/
9747614
%{_datadir}/lld/src/test.tar.gz
9747614
%{_datadir}/lld/lit.lld-test.cfg.py
9747614
098c352
%changelog
5209624
* Sun Mar 15 2020 sguelton@redhat.com - 10.0.0-0.4.rc4
5209624
- 10.0.0 rc4
5209624
f7d5578
* Thu Mar 05 2020 sguelton@redhat.com - 10.0.0-0.3.rc3
f7d5578
- 10.0.0 rc3
f7d5578
45ecd25
* Fri Feb 14 2020 sguelton@redhat.com - 10.0.0-0.2.rc2
45ecd25
- 10.0.0 rc2
45ecd25
95ef65b
* Fri Jan 31 2020 sguelton@redhat.com - 10.0.0-0.1.rc1
95ef65b
- 10.0.0 rc1
95ef65b
9141c8a
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 9.0.1-2
9141c8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
9141c8a
5e03274
* Thu Dec 19 2019 Tom Stellard <tstellar@redhat.com> -9.0.1-1
5e03274
- 9.0.1 Release
5e03274
2735326
* Sat Dec 14 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-6
2735326
- Fix some rpmdiff errors
2735326
f0b5c99
* Fri Dec 13 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-5
f0b5c99
- Remove build artifacts installed with unittests
f0b5c99
0968bb5
* Thu Dec 05 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-4
0968bb5
- Enable GPG-based source file verification
0968bb5
9747614
* Thu Dec 05 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-3
9747614
- Add lld-test package
9747614
8f684e0
* Thu Nov 14 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-2
8f684e0
- Add explicit lld-libs requires to fix rpmdiff errors
8f684e0
b748570
* Thu Sep 19 2019 Tom Stellard <tstellar@redhat.com> -9.0.0-1
b748570
- 9.0.0 Release
b748570
1e4c7d8
* Thu Aug 22 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-0.1.rc3
1e4c7d8
- 9.0.0-rc3 Release
1e4c7d8
9214e08
* Tue Aug 20 2019 Tom Stellard <tstellar@redhat.com> - 8.0.0-3
9214e08
- touch /usr/bin/ld as required by the packaging guidelines for
9214e08
  update-alternatives
9214e08
fbb8d64
* Tue Aug 13 2019 Tom Stellard <tstellar@redhat.com> - 8.0.0-2
fbb8d64
- Add update-alternative for ld
fbb8d64
9d77628
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 8.0.0-1.1
9d77628
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
9d77628
ac59f00
* Wed Mar 20 2019 sguelton@redhat.com - 8.0.0-1
ac59f00
- 8.0.0 final
ac59f00
c50a47f
* Tue Mar 12 2019 sguelton@redhat.com - 8.0.0-0.4.rc4
c50a47f
- 8.0.0 Release candidate 4
c50a47f
d799273
* Tue Mar 5 2019 sguelton@redhat.com - 8.0.0-0.4.rc3
d799273
- Cleanup specfile after llvm specfile update
d799273
43e8ad9
* Mon Mar 4 2019 sguelton@redhat.com - 8.0.0-0.3.rc3
43e8ad9
- 8.0.0 Release candidate 3
43e8ad9
4d7cc5c
* Fri Feb 22 2019 sguelton@redhat.com - 8.0.0-0.2.rc2
4d7cc5c
- 8.0.0 Release candidate 2
4d7cc5c
4d7cc5c
* Mon Feb 11 2019 sguelton@redhat.com - 8.0.0-0.1.rc1
9ade981
- 8.0.0 Release candidate 1
9ade981
a6ae391
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7.0.1-3.1
a6ae391
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
a6ae391
29c928e
* Mon Jan 14 2019 sguelton@redhat.com - 7.0.1-3
29c928e
- Fix lld + annobin integration & Setup basic CI tests
29c928e
c6cdb09
* Mon Dec 17 2018 sguelton@redhat.com - 7.0.1-2
c6cdb09
- Update lit dependency
c6cdb09
4928a61
* Mon Dec 17 2018 sguelton@redhat.com - 7.0.1-1
4928a61
- 7.0.1 Release
4928a61
3f05fc2
* Tue Dec 04 2018 sguelton@redhat.com - 7.0.0-2
3f05fc2
- Ensure rpmlint passes on specfile
3f05fc2
a0e4033
* Mon Sep 24 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-1
a0e4033
- 7.0.1 Release
a0e4033
a46aea7
* Tue Sep 11 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-0.4.rc3
a46aea7
- 7.0.0-rc3 Release
a46aea7
4a0d79c
* Fri Aug 31 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-0.3.rc2
4a0d79c
- 7.0.0-rc2 Release
4a0d79c
059c998
* Thu Aug 30 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-0.2.rc1
059c998
- Enable make check
059c998
9ab38c3
* Mon Aug 13 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-0.1.rc1
9ab38c3
- 7.0.0-rc1 Release
9ab38c3
6e3a5ee
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.1-2
6e3a5ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
6e3a5ee
2a864b9
* Wed Jun 27 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-1
2a864b9
- 6.0.1 Release
2a864b9
ea99a80
* Fri May 11 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-0.1.rc1
ea99a80
- 6.0.1-rc1 Release
ea99a80
082405c
* Thu Mar 08 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-1
082405c
- 6.0.0 Release
082405c
de435f3
* Tue Feb 13 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-0.3.rc2
de435f3
- 6.0.0-rc2 Release
de435f3
948e525
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.0-0.2.rc1
948e525
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
948e525
da75323
* Thu Jan 25 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-0.1.rc1
da75323
- 6.0.0-rc1 Release
da75323
cbfdd41
* Thu Dec 21 2017 Tom Stellard <tstellar@redhat.com> - 5.0.1-1
cbfdd41
- 5.0.1 Release
cbfdd41
25acfbc
* Mon Sep 11 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-1
25acfbc
- 5.0.0 Release
25acfbc
dcb3503
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-4
dcb3503
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
dcb3503
e64615e
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-3
e64615e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
e64615e
4f2676b
* Thu Jul 06 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-2
4f2676b
- Backport r307092
4f2676b
a407b06
* Tue Jul 04 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-1
a407b06
- 4.0.1 Release
a407b06
9f38435
* Tue Jul 04 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-4
9f38435
- Fix build without llvm-static
9f38435
d5aeb58
* Wed May 31 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-3
d5aeb58
- Remove llvm-static dependency
d5aeb58
59978ab
* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-2
59978ab
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild
59978ab
098c352
* Tue Mar 14 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-1
098c352
- lld 4.0.0 Final Release