|
|
|
@ -1,30 +1,32 @@
|
|
|
|
|
#%%global rc_ver 2
|
|
|
|
|
#%%global rc_ver 3
|
|
|
|
|
%global baserelease 1
|
|
|
|
|
%global lld_srcdir lld-%{version}%{?rc_ver:rc%{rc_ver}}.src
|
|
|
|
|
%global maj_ver 9
|
|
|
|
|
|
|
|
|
|
# armv7lhl tests disabled because of arm issue, see https://koji.fedoraproject.org/koji/taskinfo?taskID=33660162
|
|
|
|
|
%ifnarch i686 %{arm}
|
|
|
|
|
%global enable_test_pkg 1
|
|
|
|
|
%endif
|
|
|
|
|
# Don't include unittests in automatic generation of provides or requires.
|
|
|
|
|
%global __provides_exclude_from ^%{_libdir}/lld/.*$
|
|
|
|
|
%global __requires_exclude ^libgtest.*$
|
|
|
|
|
|
|
|
|
|
%bcond_with ld_alternative
|
|
|
|
|
|
|
|
|
|
Name: lld
|
|
|
|
|
Version: 8.0.1
|
|
|
|
|
Release: 1%{?rc_ver:.rc%{rc_ver}}%{?dist}
|
|
|
|
|
Version: %{maj_ver}.0.1
|
|
|
|
|
Release: %{baserelease}%{?rc_ver:.rc%{rc_ver}}%{?dist}
|
|
|
|
|
Summary: The LLVM Linker
|
|
|
|
|
|
|
|
|
|
License: NCSA
|
|
|
|
|
URL: http://llvm.org
|
|
|
|
|
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-%{rc_ver}}/%{lld_srcdir}.tar.xz
|
|
|
|
|
Source0: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{lld_srcdir}.tar.xz
|
|
|
|
|
Source1: run-lit-tests
|
|
|
|
|
Source2: lit.lld-test.cfg.py
|
|
|
|
|
|
|
|
|
|
Patch0: 0001-CMake-Check-for-gtest-headers-even-if-lit.py-is-not-.patch
|
|
|
|
|
Patch1: 0001-lld-Prefer-using-the-newest-installed-python-version.patch
|
|
|
|
|
|
|
|
|
|
BuildRequires: gcc
|
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
|
BuildRequires: cmake
|
|
|
|
|
BuildRequires: llvm-devel = %{version}
|
|
|
|
|
%if 0%{?enable_test_pkg}
|
|
|
|
|
BuildRequires: llvm-test = %{version}
|
|
|
|
|
%endif
|
|
|
|
|
BuildRequires: ncurses-devel
|
|
|
|
|
BuildRequires: zlib-devel
|
|
|
|
|
BuildRequires: chrpath
|
|
|
|
@ -34,11 +36,19 @@ BuildRequires: python3-rpm-macros
|
|
|
|
|
BuildRequires: python3-lit
|
|
|
|
|
BuildRequires: llvm-googletest = %{version}
|
|
|
|
|
|
|
|
|
|
%if %{with ld_alternative}
|
|
|
|
|
Requires(post): %{_sbindir}/alternatives
|
|
|
|
|
Requires(preun): %{_sbindir}/alternatives
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
Requires: lld-libs = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
The LLVM project linker.
|
|
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
|
Summary: Libraries and header files for LLD
|
|
|
|
|
Requires: lld-libs = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
|
This package contains library and header files needed to develop new native
|
|
|
|
@ -50,6 +60,16 @@ Summary: LLD shared libraries
|
|
|
|
|
%description libs
|
|
|
|
|
Shared libraries for LLD.
|
|
|
|
|
|
|
|
|
|
%package test
|
|
|
|
|
Summary: LLD regression tests
|
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
|
Requires: python3-lit
|
|
|
|
|
Requires: llvm-test(major) = %{maj_ver}
|
|
|
|
|
Requires: lld-libs = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description test
|
|
|
|
|
LLVM regression tests.
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%autosetup -n %{name}-%{version}%{?rc_ver:rc%{rc_ver}}.src -p1
|
|
|
|
|
|
|
|
|
@ -75,23 +95,77 @@ cd %{_target_platform}
|
|
|
|
|
|
|
|
|
|
%make_build
|
|
|
|
|
|
|
|
|
|
# Build the unittests so we can install them.
|
|
|
|
|
%make_build lld-test-depends
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
|
|
|
|
|
%global lit_cfg test/%{_arch}.site.cfg.py
|
|
|
|
|
%global lit_unit_cfg test/Unit/%{_arch}.site.cfg.py
|
|
|
|
|
%global lit_lld_test_cfg_install_path %{_datadir}/lld/lit.lld-test.cfg.py
|
|
|
|
|
|
|
|
|
|
# Generate lit config files. Strip off the last line that initiates the
|
|
|
|
|
# test run, so we can customize the configuration.
|
|
|
|
|
head -n -1 %{_target_platform}/test/lit.site.cfg.py >> %{lit_cfg}
|
|
|
|
|
head -n -1 %{_target_platform}/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}
|
|
|
|
|
|
|
|
|
|
# Patch lit config files to load custom config:
|
|
|
|
|
for f in %{lit_cfg} %{lit_unit_cfg}; do
|
|
|
|
|
echo "lit_config.load_config(config, '%{lit_lld_test_cfg_install_path}')" >> $f
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# Install test files
|
|
|
|
|
install -d %{buildroot}%{_datadir}/lld/src
|
|
|
|
|
cp %{SOURCE2} %{buildroot}%{_datadir}/lld/
|
|
|
|
|
|
|
|
|
|
tar -czf %{buildroot}%{_datadir}/lld/src/test.tar.gz test/
|
|
|
|
|
install -d %{buildroot}%{_libexecdir}/tests/lld
|
|
|
|
|
cp %{SOURCE1} %{buildroot}%{_libexecdir}/tests/lld
|
|
|
|
|
|
|
|
|
|
# Install unit test binaries
|
|
|
|
|
install -d %{buildroot}%{_libdir}/lld/
|
|
|
|
|
cp -R %{_target_platform}/unittests %{buildroot}%{_libdir}/lld/
|
|
|
|
|
rm -rf `find %{buildroot}%{_libdir}/lld/ -iname '*make*'`
|
|
|
|
|
|
|
|
|
|
# Install gtest libraries
|
|
|
|
|
cp %{_target_platform}/%{_lib}/libgtest*so* %{buildroot}%{_libdir}/lld/
|
|
|
|
|
|
|
|
|
|
# Install libraries and binaries
|
|
|
|
|
cd %{_target_platform}
|
|
|
|
|
%make_install
|
|
|
|
|
|
|
|
|
|
# Remove rpath
|
|
|
|
|
chrpath --delete %{buildroot}%{_bindir}/*
|
|
|
|
|
chrpath --delete %{buildroot}%{_libdir}/*.so*
|
|
|
|
|
chrpath --delete `find %{buildroot}%{_libdir}/lld/ -type f`
|
|
|
|
|
|
|
|
|
|
%if %{with ld_alternative}
|
|
|
|
|
# Required when using update-alternatives:
|
|
|
|
|
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/
|
|
|
|
|
touch %{buildroot}%{_bindir}/ld
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
%{_sbindir}/update-alternatives --install %{_bindir}/ld ld %{_bindir}/ld.lld 1
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
if [ $1 -eq 0 ] ; then
|
|
|
|
|
%{_sbindir}/update-alternatives --remove ld %{_bindir}/ld.lld
|
|
|
|
|
fi
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
|
|
|
|
|
%if 0%{?enable_test_pkg}
|
|
|
|
|
# armv7lhl tests disabled because of arm issue, see https://koji.fedoraproject.org/koji/taskinfo?taskID=33660162
|
|
|
|
|
%ifnarch %{arm}
|
|
|
|
|
make -C %{_target_platform} %{?_smp_mflags} check-lld
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%ldconfig_scriptlets libs
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%if %{with ld_alternative}
|
|
|
|
|
%ghost %{_bindir}/ld
|
|
|
|
|
%endif
|
|
|
|
|
%{_bindir}/lld*
|
|
|
|
|
%{_bindir}/ld.lld
|
|
|
|
|
%{_bindir}/ld64.lld
|
|
|
|
@ -104,7 +178,31 @@ make -C %{_target_platform} %{?_smp_mflags} check-lld
|
|
|
|
|
%files libs
|
|
|
|
|
%{_libdir}/liblld*.so.*
|
|
|
|
|
|
|
|
|
|
%files test
|
|
|
|
|
%{_libexecdir}/tests/lld/
|
|
|
|
|
%{_libdir}/lld/
|
|
|
|
|
%{_datadir}/lld/src/test.tar.gz
|
|
|
|
|
%{_datadir}/lld/lit.lld-test.cfg.py
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
* Thu Dec 19 2019 Tom Stellard <tstellar@redhat.com> -9.0.1-1
|
|
|
|
|
- 9.0.1 Release
|
|
|
|
|
|
|
|
|
|
* Fri Dec 13 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-5
|
|
|
|
|
- Fix some rpmdiff errors
|
|
|
|
|
|
|
|
|
|
* Fri Dec 13 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-4
|
|
|
|
|
- Remove build artifacts installed with unittests
|
|
|
|
|
|
|
|
|
|
* Thu Dec 05 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-3
|
|
|
|
|
- Add lld-test package
|
|
|
|
|
|
|
|
|
|
* Thu Nov 14 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-2
|
|
|
|
|
- Add explicit lld-libs requires to fix rpmdiff errors
|
|
|
|
|
|
|
|
|
|
* Thu Sep 26 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-1
|
|
|
|
|
- 9.0.0 Release
|
|
|
|
|
|
|
|
|
|
* Thu Aug 1 2019 sguelton@redhat.com - 8.0.1-1
|
|
|
|
|
- 8.0.1 release
|
|
|
|
|
|
|
|
|
|