From 5704cf16ae006d3f21f431353cd48f8119b4b679 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 10 May 2022 04:24:31 +0000 Subject: [PATCH] import lld-14.0.0-2.module+el8.7.0+15166+e7146083 --- .gitignore | 2 +- .lld.metadata | 2 +- SOURCES/ignore-no-add-needed.patch | 22 ++++++ SOURCES/lld-13.0.1.src.tar.xz.sig | Bin 566 -> 0 bytes SOURCES/lld-14.0.0.src.tar.xz.sig | Bin 0 -> 566 bytes SPECS/lld.spec | 103 +++++++++++++++++++++++++---- 6 files changed, 114 insertions(+), 15 deletions(-) create mode 100644 SOURCES/ignore-no-add-needed.patch delete mode 100644 SOURCES/lld-13.0.1.src.tar.xz.sig create mode 100644 SOURCES/lld-14.0.0.src.tar.xz.sig diff --git a/.gitignore b/.gitignore index 69229d3..db1112f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/lld-13.0.1.src.tar.xz +SOURCES/lld-14.0.0.src.tar.xz SOURCES/tstellar-gpg-key.asc diff --git a/.lld.metadata b/.lld.metadata index 8eb0ab8..4e8e7be 100644 --- a/.lld.metadata +++ b/.lld.metadata @@ -1,2 +1,2 @@ -78d69e9bd03422f12cf36cc720bf4ee7293e17c5 SOURCES/lld-13.0.1.src.tar.xz +7de1e7afeda89c395e128f1c8f6fc10aea7a4364 SOURCES/lld-14.0.0.src.tar.xz b8d2648a01d36ed0186fd2c5af325fd28797f9a0 SOURCES/tstellar-gpg-key.asc diff --git a/SOURCES/ignore-no-add-needed.patch b/SOURCES/ignore-no-add-needed.patch new file mode 100644 index 0000000..b322eeb --- /dev/null +++ b/SOURCES/ignore-no-add-needed.patch @@ -0,0 +1,22 @@ +diff -ruN lld-14.0.0.src.orig/ELF/Options.td lld-14.0.0.src/ELF/Options.td +--- a/lld-14.0.0.src.orig/ELF/Options.td 2022-03-14 10:44:55.000000000 +0100 ++++ b/lld-14.0.0.src/ELF/Options.td 2022-05-05 13:27:06.029896421 +0200 +@@ -695,6 +695,7 @@ + def: F<"detect-odr-violations">; + def: Flag<["-"], "g">; + def: F<"long-plt">; ++def: FF<"no-add-needed">; + def: F<"no-copy-dt-needed-entries">; + def: F<"no-ctors-in-init-array">; + def: F<"no-keep-memory">; +diff -ruN lld-14.0.0.src.orig/test/ELF/silent-ignore.test lld-14.0.0.src/test/ELF/silent-ignore.test +--- a/lld-14.0.0.src.orig/test/ELF/silent-ignore.test 2022-03-14 10:44:55.000000000 +0100 ++++ b/lld-14.0.0.src/test/ELF/silent-ignore.test 2022-05-05 13:27:29.734085587 +0200 +@@ -2,6 +2,7 @@ + RUN: -detect-odr-violations \ + RUN: -g \ + RUN: -long-plt \ ++RUN: --no-add-needed \ + RUN: -no-copy-dt-needed-entries \ + RUN: -no-ctors-in-init-array \ + RUN: -no-keep-memory \ diff --git a/SOURCES/lld-13.0.1.src.tar.xz.sig b/SOURCES/lld-13.0.1.src.tar.xz.sig deleted file mode 100644 index b07cb7dad7c6c4625b38d4e00cea207b2d309228..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 566 zcmV-60?GY}0y6{v0SEvc79j*jP9iaCzek0rjBbvi$CRmtL7j>P0%7``3jhiU5TeJF zsfIzFin;s`{TgHxy0vqYf*d#;5zk28rSpUNMLRvEiagz6%mmwAE96ddS#-FpGXKrfMYKhOSm|4>QFDNs zO#eYFY{K1dK*^69s`X_`F1$B}zoQQtYUc-w;Uxim@xjlq4e4$O2Pev0v_H)cZ*P+Uu>YY+(~F8&fiQK;pfr`B!d9Y zeMxNXMl)RdXr<3m!9tKs>omaq3wPMSqk}rL_30mRI=^WdRt3$J$|;ugpU*sRgOomL z9Wk?-nlhu8b=JS0D#WO1D<>drT#p*mwNxYgv$LpP0%AJ2RR9VJ5TeJF zsfIzFirlCV`U4S8RGJ%}bw#yW-F}4PGOllnd5{ZM%pVi2au+hq{%kd?+~nsDq#Ou$`7)V#}?sf2;$SQ%Hr+v zBVsOW^?n{Ew#t0gc97gdazT>ZWgTHhCTEIc$?JEV&`Dw8`FYX}4KjVE)Mz=n+)42o z7rXga6xK#wIxeZ@;05T|+Pq3ur_?f@1c@pZqTos()DW!@(JkJ{gxkah-*+~6dhV1} z^G;_id*+6i!2jAW_lU7HxYhR2u_+=gp6S=J?gCc@Q=fNOHSf=gcB>H#SO`#~&?T6S EF2&Odg#Z8m literal 0 HcmV?d00001 diff --git a/SPECS/lld.spec b/SPECS/lld.spec index 982bc09..91988cc 100644 --- a/SPECS/lld.spec +++ b/SPECS/lld.spec @@ -1,27 +1,27 @@ %bcond_without check -#global rc_ver 4 +#global rc_ver 1 %global lld_srcdir lld-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src -%global baserelease 2 -%global maj_ver 13 +%global maj_ver 14 %global min_ver 0 -%global patch_ver 1 +%global patch_ver 0 # 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 +%bcond_with testpkg Name: lld Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}} -Release: %{baserelease}%{?rc_ver:.rc%{rc_ver}}%{?dist} +Release: 2%{?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%{rc_ver}}/%{lld_srcdir}.tar.xz -Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{lld_srcdir}.tar.xz.sig +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 +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 Source2: tstellar-gpg-key.asc Source3: run-lit-tests Source4: lit.lld-test.cfg.py @@ -33,6 +33,8 @@ Patch0: 0001-PATCH-lld-CMake-Check-for-gtest-headers-even-if-lit..patch # Bundle libunwind header need during build for MachO support Patch1: 0002-PATCH-lld-Import-compact_unwind_encoding.h-from-libu.patch +# https://github.com/llvm/llvm-project/commit/c29c19cb5327624dd31fcb776f8fbe66ca1011bb +Patch2: ignore-no-add-needed.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -49,6 +51,9 @@ BuildRequires: python3-rpm-macros BuildRequires: python3-lit BuildRequires: llvm-googletest = %{version} +# For gpg source verification +BuildRequires: gnupg2 + %if %{with ld_alternative} Requires(post): %{_sbindir}/alternatives Requires(preun): %{_sbindir}/alternatives @@ -76,7 +81,20 @@ Summary: LLD shared libraries %description libs Shared libraries for LLD. +%if %{with testpkg} +%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. +%endif + %prep +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %autosetup -n %{lld_srcdir} -p2 @@ -107,11 +125,55 @@ cd %{_vpath_builddir} %cmake_build -%install -# Install libraries and binaries -cd %{_target_platform} +%if %{with testpkg} +# Build the unittests so we can install them. +%cmake_build --target lld-test-depends +%endif +%install +%if %{with testpkg} +%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 %{__cmake_builddir}/test/lit.site.cfg.py >> %{lit_cfg} +head -n -1 %{__cmake_builddir}/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 %{SOURCE4} %{buildroot}%{_datadir}/lld/ + +# The various tar options are there to make sur the archive is the same on 32 and 64 bit arch, i.e. +# the archive creation is reproducible. Move arch-specific content out of the tarball +mv %{lit_cfg} %{buildroot}%{_datadir}/lld/src/%{_arch}.site.cfg.py +mv %{lit_unit_cfg} %{buildroot}%{_datadir}/lld/src/%{_arch}.Unit.site.cfg.py +tar --sort=name --mtime='UTC 2020-01-01' -c test/ | gzip -n > %{buildroot}%{_datadir}/lld/src/test.tar.gz + +install -d %{buildroot}%{_libexecdir}/tests/lld +install -m 0755 %{SOURCE3} %{buildroot}%{_libexecdir}/tests/lld + +# Install unit test binaries +install -d %{buildroot}%{_libdir}/lld/ + +rm -rf `find %{buildroot}%{_libdir}/lld/ -iname '*make*'` + +# Install gtest libraries +cp %{__cmake_builddir}/%{_lib}/libgtest*so* %{buildroot}%{_libdir}/lld/ +%endif + +# Install libraries and binaries +pushd %{_vpath_builddir} %cmake_install +popd + + # This is generated by Patch1 during build and (probably) must be removed afterward rm %{buildroot}%{_includedir}/mach-o/compact_unwind_encoding.h @@ -130,13 +192,14 @@ fi %endif %check - cd %{_vpath_builddir} # armv7lhl tests disabled because of arm issue, see https://koji.fedoraproject.org/koji/taskinfo?taskID=33660162 %ifnarch %{arm} +%if %{with check} %cmake_build --target check-lld %endif +%endif %ldconfig_scriptlets libs @@ -148,8 +211,6 @@ cd %{_vpath_builddir} %{_bindir}/lld* %{_bindir}/ld.lld %{_bindir}/ld64.lld -%{_bindir}/ld64.lld.darwinnew -%{_bindir}/ld64.lld.darwinold %{_bindir}/wasm-ld %files devel @@ -160,7 +221,23 @@ cd %{_vpath_builddir} %files libs %{_libdir}/liblld*.so.* +%if %{with testpkg} +%files test +%{_libexecdir}/tests/lld/ +%{_libdir}/lld/ +%{_datadir}/lld/src/test.tar.gz +%{_datadir}/lld/src/%{_arch}.site.cfg.py +%{_datadir}/lld/src/%{_arch}.Unit.site.cfg.py +%{_datadir}/lld/lit.lld-test.cfg.py +%endif + %changelog +* Fri May 06 2022 Timm Bäder - 14.0.0-2 +- Backport ignoring --no-add-needed + +* Thu Apr 07 2022 Timm Bäder - 14.0.0-1 +- Update to 14.0.0 + * Thu Feb 03 2022 Tom Stellard - 13.0.1-1 - 13.0.1 Release