diff --git a/.gitignore b/.gitignore index bb526e4..0cb243e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /mold-1.0.2.tar.gz /mold-1.1.tar.gz +/mold-1.1.1.tar.gz diff --git a/0001-Skip-failing-tests-on-aarch64.patch b/0001-Skip-failing-tests-on-aarch64.patch new file mode 100644 index 0000000..5186f72 --- /dev/null +++ b/0001-Skip-failing-tests-on-aarch64.patch @@ -0,0 +1,89 @@ +From 91c4af8e43ad2bf030d8f0d62594e7d2352a04c4 Mon Sep 17 00:00:00 2001 +Message-Id: <91c4af8e43ad2bf030d8f0d62594e7d2352a04c4.1646773590.git.github@sicherha.de> +From: Christoph Erhardt +Date: Tue, 8 Mar 2022 19:05:50 +0100 +Subject: [PATCH] Skip failing tests on aarch64 + +Upstream issues: +* https://github.com/rui314/mold/issues/382 +* https://github.com/rui314/mold/issues/383 +* https://github.com/rui314/mold/issues/384 +--- + test/elf/hello-static-pie.sh | 3 +++ + test/elf/ifunc-static-pie.sh | 3 +++ + test/elf/noinhibit-exec.sh | 3 +++ + test/elf/tls-gd-mcmodel-large.sh | 2 -- + test/elf/tls-ld-mcmodel-large.sh | 2 -- + 5 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/test/elf/hello-static-pie.sh b/test/elf/hello-static-pie.sh +index 18700913..f0b7ae3d 100755 +--- a/test/elf/hello-static-pie.sh ++++ b/test/elf/hello-static-pie.sh +@@ -10,6 +10,9 @@ mold="$(pwd)/mold" + t=out/test/elf/$testname + mkdir -p $t + ++# Output binary segfaults on aarch64 ++[ "$(uname -m)" = aarch64 ] && { echo skipped; exit; } ++ + # IFUNC is not supported on RISC-V yet + [ "$(uname -m)" = riscv64 ] && { echo skipped; exit; } + +diff --git a/test/elf/ifunc-static-pie.sh b/test/elf/ifunc-static-pie.sh +index 53a1c919..98cb3e6e 100755 +--- a/test/elf/ifunc-static-pie.sh ++++ b/test/elf/ifunc-static-pie.sh +@@ -10,6 +10,9 @@ mold="$(pwd)/mold" + t=out/test/elf/$testname + mkdir -p $t + ++# Output binary segfaults on aarch64 ++[ "$(uname -m)" = aarch64 ] && { echo skipped; exit; } ++ + # IFUNC is not supported on RISC-V yet + [ "$(uname -m)" = riscv64 ] && { echo skipped; exit; } + +diff --git a/test/elf/noinhibit-exec.sh b/test/elf/noinhibit-exec.sh +index 44a26e54..6c90d82f 100755 +--- a/test/elf/noinhibit-exec.sh ++++ b/test/elf/noinhibit-exec.sh +@@ -10,6 +10,9 @@ mold="$(pwd)/mold" + t=out/test/elf/$testname + mkdir -p $t + ++# `mold -noinhibit-exec` segfaults on aarch64 ++[ "$(uname -m)" = aarch64 ] && { echo skipped; exit; } ++ + cat < -From: Christoph Erhardt -Date: Mon, 21 Feb 2022 21:44:34 +0100 -Subject: [PATCH] Skip reloc-rodata test on aarch64 - -The test expects an error when an object compiled with `-fno-PIC` is -linked with `-pie`, but that doesn't happen on aarch64. - -Signed-off-by: Christoph Erhardt ---- - test/elf/reloc-rodata.sh | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/test/elf/reloc-rodata.sh b/test/elf/reloc-rodata.sh -index 2eeb237c..b9cf8161 100755 ---- a/test/elf/reloc-rodata.sh -+++ b/test/elf/reloc-rodata.sh -@@ -10,6 +10,8 @@ mold="$(pwd)/mold" - t=out/test/elf/$testname - mkdir -p $t - -+[ "$(uname -m)" = aarch64 ] && { echo skipped; exit; } -+ - cat < - --- -2.35.1 - diff --git a/0003-Increase-required-glibc-version-for-static-pie-tests.patch b/0003-Increase-required-glibc-version-for-static-pie-tests.patch new file mode 100644 index 0000000..0a702ae --- /dev/null +++ b/0003-Increase-required-glibc-version-for-static-pie-tests.patch @@ -0,0 +1,44 @@ +From a20e3b8004c30e9edaeafaccb194ff077c3da98f Mon Sep 17 00:00:00 2001 +Message-Id: +From: Christoph Erhardt +Date: Tue, 8 Mar 2022 10:13:49 +0100 +Subject: [PATCH] Increase required glibc version for `-static-pie` tests + +mold 1.1.1 generates `-static-pie` code that works with glibc 2.35 but +segfaults with glibc 2.34 or older. + +Signed-off-by: Christoph Erhardt +--- + test/elf/hello-static-pie.sh | 2 +- + test/elf/ifunc-static-pie.sh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/elf/hello-static-pie.sh b/test/elf/hello-static-pie.sh +index 4b72d1c3..18700913 100755 +--- a/test/elf/hello-static-pie.sh ++++ b/test/elf/hello-static-pie.sh +@@ -18,7 +18,7 @@ echo 'int main() {}' | $CC -o $t/exe -xc - + ldd $t/exe | grep -q ld-musl && { echo OK; exit; } + + # -static-pie works only with a newer version of glibc +-ldd --version | grep -Pq 'Copyright \(C\) 202[1-9]' || { echo skipped; exit; } ++ldd --version | grep -Pq 'Copyright \(C\) 202[2-9]' || { echo skipped; exit; } + + cat < +diff --git a/test/elf/ifunc-static-pie.sh b/test/elf/ifunc-static-pie.sh +index a8d8785b..53a1c919 100755 +--- a/test/elf/ifunc-static-pie.sh ++++ b/test/elf/ifunc-static-pie.sh +@@ -18,7 +18,7 @@ echo 'int main() {}' | $CC -o $t/exe -xc - + ldd $t/exe | grep -q ld-musl && { echo OK; exit; } + + # -static-pie works only with a newer version of glibc +-ldd --version | grep -Pq 'Copyright \(C\) 202[1-9]' || { echo skipped; exit; } ++ldd --version | grep -Pq 'Copyright \(C\) 202[2-9]' || { echo skipped; exit; } + + cat < +-- +2.35.1 + diff --git a/mold.spec b/mold.spec index 43a1f86..2d306a2 100644 --- a/mold.spec +++ b/mold.spec @@ -1,5 +1,5 @@ Name: mold -Version: 1.1 +Version: 1.1.1 Release: 1%{?dist} Summary: A Modern Linker @@ -14,13 +14,16 @@ Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # in the Fedora tbb package) Patch0: tbb-strip-werror.patch -# Skip failing test on aarch64 -Patch1: 0001-Skip-reloc-rodata-test-on-aarch64.patch +# Skip failing tests on aarch64 +Patch1: 0001-Skip-failing-tests-on-aarch64.patch # Fix mimalloc compatibility with libstdc++ < 9: # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68210 Patch2: 0002-Fix-compatibility-with-libstdc-9.patch +# Disable `-static-pie` tests for systems with glibc < 2.35 +Patch3: 0003-Increase-required-glibc-version-for-static-pie-tests.patch + # mold can currently produce native binaries for x86, aarch64 and riscv64 only ExclusiveArch: x86_64 aarch64 riscv64 @@ -50,6 +53,8 @@ BuildRequires: /usr/lib/libc.a BuildRequires: libdwarf-tools %endif BuildRequires: libstdc++-static +BuildRequires: llvm +BuildRequires: perl Requires(post): %{_sbindir}/alternatives Requires(preun): %{_sbindir}/alternatives @@ -117,6 +122,9 @@ fi %{_mandir}/man1/mold.1* %changelog +* Tue Mar 08 2022 Christoph Erhardt - 1.1.1-1 +- Bump version to 1.1.1 + * Mon Feb 21 2022 Christoph Erhardt - 1.1-1 - Bump version to 1.1 - Drop upstreamed patches diff --git a/sources b/sources index 1be872a..4a0b221 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mold-1.1.tar.gz) = b8b125c77563abe2741c2f32d73ab2b12dff275b92b633fcd015336c6ea735e38e95c3d2afb50e5baace2023d4f9de3eb50d53053eabc2cd2f045110eef4cc1e +SHA512 (mold-1.1.1.tar.gz) = 981d9737ed7a23134b9bafc04db0cd0233ab4fd588a3b250688dba64936fe84f6736168379fc3e4485273bcef11bca70e5c426b043b5d8b9775ae1cd3aea5b52