The package rpms/mold.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/mold.git/commit/?id=71d41563647c2a5a... https://src.fedoraproject.org/cgit/rpms/mold.git/commit/?id=97b9b977387d2987... https://src.fedoraproject.org/cgit/rpms/mold.git/commit/?id=d86874335d990bd6....
Change: +ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 riscv64 +%ifarch x86_64 -%ifarch x86_64
Thanks.
Full change: ============
commit 71d41563647c2a5a342101b374e1df010d540a90 Author: Christoph Erhardt fedora@sicherha.de Date: Sat Apr 30 21:32:09 2022 +0200
Add support for 32-bit x86 and Arm
diff --git a/0001-ELF-LTO-Fix-LTO-on-32-bit-hosts.patch b/0001-ELF-LTO-Fix-LTO-on-32-bit-hosts.patch new file mode 100644 index 0000000..2a1915f --- /dev/null +++ b/0001-ELF-LTO-Fix-LTO-on-32-bit-hosts.patch @@ -0,0 +1,41 @@ +From 339ce3afe5ebbcc924df431153a0b8fc549b9dd8 Mon Sep 17 00:00:00 2001 +Message-Id: 339ce3afe5ebbcc924df431153a0b8fc549b9dd8.1651330992.git.github@sicherha.de +From: Rui Ueyama ruiu@cs.stanford.edu +Date: Sat, 30 Apr 2022 12:06:39 +0800 +Subject: [PATCH 1/3] [ELF][LTO] Fix LTO on 32-bit hosts + +`off_t` is either an alias for `off32_t` or for `off64_t` on a 32-bit +machine. `off32_t` is the default. But it looks like LLVM gold plugin +is always compiled with `off64_t`. + +Because of this difference, the offset of the `handle` member in +`PluginInputFile` differed between mold and LLVMgold.so. mold thought +that the member was at offset 16 of the struct, while LLVMgold.so +thought that it's at offset 24. + +That caused a mysterious crash when LLVMgold tries to access the +`handle` member. + +Fixes https://github.com/rui314/mold/issues/483 +--- + lto.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lto.h b/lto.h +index c7a73698..03ab340f 100644 +--- a/lto.h ++++ b/lto.h +@@ -73,8 +73,8 @@ enum PluginOutputFileType { + struct PluginInputFile { + const char *name; + int fd; +- off_t offset; +- off_t filesize; ++ uint64_t offset; ++ uint64_t filesize; + void *handle; + }; + +-- +2.35.1 + diff --git a/0002-Skip-static-pie-tests-on-i686-not-just-on-i386.patch b/0002-Skip-static-pie-tests-on-i686-not-just-on-i386.patch new file mode 100644 index 0000000..3c4a129 --- /dev/null +++ b/0002-Skip-static-pie-tests-on-i686-not-just-on-i386.patch @@ -0,0 +1,41 @@ +From 9a48159c5aa7c79fc7d4ac41fa94c1ccd3708ea6 Mon Sep 17 00:00:00 2001 +Message-Id: 9a48159c5aa7c79fc7d4ac41fa94c1ccd3708ea6.1651330992.git.github@sicherha.de +In-Reply-To: 339ce3afe5ebbcc924df431153a0b8fc549b9dd8.1651330992.git.github@sicherha.de +References: 339ce3afe5ebbcc924df431153a0b8fc549b9dd8.1651330992.git.github@sicherha.de +From: Christoph Erhardt github@sicherha.de +Date: Thu, 28 Apr 2022 23:48:29 +0200 +Subject: [PATCH 2/3] Skip `-static-pie` tests on i686, not just on i386 + +Signed-off-by: Christoph Erhardt github@sicherha.de +--- + test/elf/hello-static-pie.sh | 1 + + test/elf/ifunc-static-pie.sh | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/test/elf/hello-static-pie.sh b/test/elf/hello-static-pie.sh +index 0921a876..6970ef9d 100755 +--- a/test/elf/hello-static-pie.sh ++++ b/test/elf/hello-static-pie.sh +@@ -16,6 +16,7 @@ mkdir -p $t + + # We need to implement R_386_GOT32X relaxation to support PIE on i386 + [ $MACHINE = i386 ] && { echo skipped; exit; } ++[ $MACHINE = i686 ] && { echo skipped; exit; } + + [ $MACHINE = aarch64 ] && { echo skipped; exit; } + +diff --git a/test/elf/ifunc-static-pie.sh b/test/elf/ifunc-static-pie.sh +index 4edcfabe..5977ee53 100755 +--- a/test/elf/ifunc-static-pie.sh ++++ b/test/elf/ifunc-static-pie.sh +@@ -16,6 +16,7 @@ mkdir -p $t + + # We need to implement R_386_GOT32X relaxation to support PIE on i386 + [ $MACHINE = i386 ] && { echo skipped; exit; } ++[ $MACHINE = i686 ] && { echo skipped; exit; } + + # RISCV64 does not support IFUNC yet + [ $MACHINE = riscv64 ] && { echo skipped; exit; } +-- +2.35.1 + diff --git a/0003-Skip-tests-that-fail-on-i686-and-armv7l.patch b/0003-Skip-tests-that-fail-on-i686-and-armv7l.patch new file mode 100644 index 0000000..64ec5a8 --- /dev/null +++ b/0003-Skip-tests-that-fail-on-i686-and-armv7l.patch @@ -0,0 +1,129 @@ +From 7cfbb9c4895e51ab8673b6a3f14c82be49b023c8 Mon Sep 17 00:00:00 2001 +Message-Id: 7cfbb9c4895e51ab8673b6a3f14c82be49b023c8.1651339128.git.github@sicherha.de +From: Christoph Erhardt github@sicherha.de +Date: Fri, 29 Apr 2022 21:44:33 +0200 +Subject: [PATCH] Skip tests that fail on i686 and armv7l + +--- + test/elf/exception.sh | 2 ++ + test/elf/gdb-index-compress-output.sh | 3 +++ + test/elf/gdb-index-dwarf2.sh | 3 +++ + test/elf/gdb-index-dwarf3.sh | 3 +++ + test/elf/gdb-index-dwarf4.sh | 3 +++ + test/elf/gdb-index-dwarf5.sh | 3 +++ + test/elf/hello-static.sh | 2 ++ + test/elf/ifunc-static.sh | 2 ++ + 8 files changed, 21 insertions(+) + +diff --git a/test/elf/exception.sh b/test/elf/exception.sh +index 5df54b14..a4138103 100755 +--- a/test/elf/exception.sh ++++ b/test/elf/exception.sh +@@ -14,6 +14,8 @@ mold="$(pwd)/mold" + t=out/test/elf/$testname + mkdir -p $t + ++[ $MACHINE = armv7l ] && { echo skipped; exit; } ++ + cat <<EOF | $CXX -c -o $t/a.o -xc++ -fPIC - + int main() { + try { +diff --git a/test/elf/gdb-index-compress-output.sh b/test/elf/gdb-index-compress-output.sh +index 05bfabd2..c22792ae 100755 +--- a/test/elf/gdb-index-compress-output.sh ++++ b/test/elf/gdb-index-compress-output.sh +@@ -16,6 +16,9 @@ mkdir -p $t + + [ $MACHINE = $(uname -m) ] || { echo skipped; exit; } + ++[ $MACHINE = armv7l ] && { echo skipped; exit; } ++[ $MACHINE = i686 ] && { echo skipped; exit; } ++ + which gdb >& /dev/null || { echo skipped; exit; } + + cat <<EOF | $CC -c -o $t/a.o -fPIC -g -ggnu-pubnames -gdwarf-4 -xc - -ffunction-sections +diff --git a/test/elf/gdb-index-dwarf2.sh b/test/elf/gdb-index-dwarf2.sh +index 8e15c8e8..b6e6297e 100755 +--- a/test/elf/gdb-index-dwarf2.sh ++++ b/test/elf/gdb-index-dwarf2.sh +@@ -16,6 +16,9 @@ mkdir -p $t + + [ $MACHINE = $(uname -m) ] || { echo skipped; exit; } + ++[ $MACHINE = armv7l ] && { echo skipped; exit; } ++[ $MACHINE = i686 ] && { echo skipped; exit; } ++ + which gdb >& /dev/null || { echo skipped; exit; } + + echo 'int main() {}' | $CC -o /dev/null -xc -gdwarf-2 -g - >& /dev/null || +diff --git a/test/elf/gdb-index-dwarf3.sh b/test/elf/gdb-index-dwarf3.sh +index 727dfcbe..466f9597 100755 +--- a/test/elf/gdb-index-dwarf3.sh ++++ b/test/elf/gdb-index-dwarf3.sh +@@ -16,6 +16,9 @@ mkdir -p $t + + [ $MACHINE = $(uname -m) ] || { echo skipped; exit; } + ++[ $MACHINE = armv7l ] && { echo skipped; exit; } ++[ $MACHINE = i686 ] && { echo skipped; exit; } ++ + which gdb >& /dev/null || { echo skipped; exit; } + + echo 'int main() {}' | $CC -o /dev/null -xc -gdwarf-3 -g - >& /dev/null || +diff --git a/test/elf/gdb-index-dwarf4.sh b/test/elf/gdb-index-dwarf4.sh +index 79ae5d1a..5512cd27 100755 +--- a/test/elf/gdb-index-dwarf4.sh ++++ b/test/elf/gdb-index-dwarf4.sh +@@ -16,6 +16,9 @@ mkdir -p $t + + [ $MACHINE = $(uname -m) ] || { echo skipped; exit; } + ++[ $MACHINE = armv7l ] && { echo skipped; exit; } ++[ $MACHINE = i686 ] && { echo skipped; exit; } ++ + which gdb >& /dev/null || { echo skipped; exit; } + + echo 'int main() {}' | $CC -o /dev/null -xc -gdwarf-4 -g - >& /dev/null || +diff --git a/test/elf/gdb-index-dwarf5.sh b/test/elf/gdb-index-dwarf5.sh +index 02c0249d..09d20907 100755 +--- a/test/elf/gdb-index-dwarf5.sh ++++ b/test/elf/gdb-index-dwarf5.sh +@@ -16,6 +16,9 @@ mkdir -p $t + + [ $MACHINE = $(uname -m) ] || { echo skipped; exit; } + ++[ $MACHINE = armv7l ] && { echo skipped; exit; } ++[ $MACHINE = i686 ] && { echo skipped; exit; } ++ + which gdb >& /dev/null || { echo skipped; exit; } + + echo 'int main() {}' | $CC -o /dev/null -xc -gdwarf-5 -g - >& /dev/null || +diff --git a/test/elf/hello-static.sh b/test/elf/hello-static.sh +index 5780b88b..05c60f91 100755 +--- a/test/elf/hello-static.sh ++++ b/test/elf/hello-static.sh +@@ -14,6 +14,8 @@ mold="$(pwd)/mold" + t=out/test/elf/$testname + mkdir -p $t + ++[ $MACHINE = armv7l ] && { echo skipped; exit; } ++ + cat <<EOF | $CC -o $t/a.o -c -xc - + #include <stdio.h> + +diff --git a/test/elf/ifunc-static.sh b/test/elf/ifunc-static.sh +index e7b0b8c8..150dc921 100755 +--- a/test/elf/ifunc-static.sh ++++ b/test/elf/ifunc-static.sh +@@ -17,6 +17,8 @@ mkdir -p $t + # IFUNC is not supported on RISC-V yet + [ $MACHINE = riscv64 ] && { echo skipped; exit; } + ++[ $MACHINE = armv7l ] && { echo skipped; exit; } ++ + # Skip if libc is musl because musl does not support GNU FUNC + echo 'int main() {}' | $CC -o $t/exe -xc - + readelf --dynamic $t/exe | grep -q ld-musl && { echo OK; exit; } +-- +2.35.1 + diff --git a/mold.spec b/mold.spec index 1995af3..d11fb6c 100644 --- a/mold.spec +++ b/mold.spec @@ -14,9 +14,15 @@ Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # in the Fedora tbb package) Patch0: tbb-strip-werror.patch
-# mold can produce native binaries for i686, x86_64, ARMv7, aarch64 and riscv64, -# but it only runs on a 64-bit host -ExclusiveArch: x86_64 aarch64 riscv64 +# Fix LTO on 32-bit hosts +Patch1: 0001-ELF-LTO-Fix-LTO-on-32-bit-hosts.patch + +# Skip failing tests on i686 and armv7l +Patch2: 0002-Skip-static-pie-tests-on-i686-not-just-on-i386.patch +Patch3: 0003-Skip-tests-that-fail-on-i686-and-armv7l.patch + +# mold can currently produce native binaries for these architectures only +ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 riscv64
BuildRequires: cmake %if 0%{?el8} @@ -106,6 +112,7 @@ fi * Sat Apr 30 2022 Christoph Erhardt fedora@sicherha.de - 1.2.1-1 - Bump version to 1.2.1 - Drop upstreamed patch +- Add support for 32-bit x86 and Arm
* Sat Apr 16 2022 Christoph Erhardt fedora@sicherha.de - 1.2-1 - Bump version to 1.2
commit 97b9b977387d298745af27970b753088a5c3d213 Author: Christoph Erhardt fedora@sicherha.de Date: Sat Apr 30 21:24:01 2022 +0200
Bump version to 1.2.1
diff --git a/.gitignore b/.gitignore index 8cedfa2..bf360e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/mold-1.2.tar.gz +/mold-1.2.1.tar.gz diff --git a/0001-Skip-test-if-dwarfdump-is-unavailable.patch b/0001-Skip-test-if-dwarfdump-is-unavailable.patch deleted file mode 100644 index 1d608c8..0000000 --- a/0001-Skip-test-if-dwarfdump-is-unavailable.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 133946af0c4013d17715cad486a1984848732a4d Mon Sep 17 00:00:00 2001 -Message-Id: 133946af0c4013d17715cad486a1984848732a4d.1650116695.git.github@sicherha.de -From: Christoph Erhardt github@sicherha.de -Date: Fri, 15 Apr 2022 20:34:04 +0200 -Subject: [PATCH] Skip test if `dwarfdump` is unavailable - -Fixes #430. - -Signed-off-by: Christoph Erhardt github@sicherha.de ---- - test/elf/dead-debug-sections.sh | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/test/elf/dead-debug-sections.sh b/test/elf/dead-debug-sections.sh -index 5573b3a2..b31fcb34 100755 ---- a/test/elf/dead-debug-sections.sh -+++ b/test/elf/dead-debug-sections.sh -@@ -14,6 +14,8 @@ mold="$(pwd)/mold" - t=out/test/elf/$testname - mkdir -p $t - -+which dwarfdump >& /dev/null || { echo skipped; exit; } -+ - cat <<EOF | $CXX -c -o $t/a.o -g -xc++ - - #include <iostream> - struct Foo { --- -2.35.1 - diff --git a/mold.spec b/mold.spec index ccf7284..1995af3 100644 --- a/mold.spec +++ b/mold.spec @@ -1,5 +1,5 @@ Name: mold -Version: 1.2 +Version: 1.2.1 Release: 1%{?dist} Summary: A Modern Linker
@@ -14,9 +14,6 @@ Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # in the Fedora tbb package) Patch0: tbb-strip-werror.patch
-# Skip test if dwarfdump is unavailable -Patch1: 0001-Skip-test-if-dwarfdump-is-unavailable.patch - # mold can produce native binaries for i686, x86_64, ARMv7, aarch64 and riscv64, # but it only runs on a 64-bit host ExclusiveArch: x86_64 aarch64 riscv64 @@ -30,13 +27,18 @@ BuildRequires: gcc-c++ >= 10 %endif BuildRequires: mimalloc-devel BuildRequires: openssl-devel +BuildRequires: python3 BuildRequires: xxhash-devel BuildRequires: zlib-devel
# The following packages are only required for executing the tests BuildRequires: clang +BuildRequires: gdb BuildRequires: glibc-static %if ! 0%{?el8} +%ifarch x86_64 +BuildRequires: /usr/lib/libc.so +%endif BuildRequires: libdwarf-tools %endif BuildRequires: libstdc++-static @@ -61,8 +63,6 @@ build time, especially in rapid debug-edit-rebuild cycles. %prep %autosetup -p1 rm -r third-party/{mimalloc,xxhash} -# Remove failing unit test for now (https://github.com/rui314/mold/issues/436) -rm test/elf/gdb-index.sh
%build %if 0%{?el8} @@ -72,8 +72,6 @@ rm test/elf/gdb-index.sh
%install %make_install %{build_args} -# Overwrite absolute symlink with relative symlink -ln -srf %{buildroot}%{_bindir}/mold %{buildroot}%{_libexecdir}/mold/ld chmod +x %{buildroot}%{_libdir}/mold/mold-wrapper.so
%post @@ -105,6 +103,10 @@ fi %{_mandir}/man1/mold.1*
%changelog +* Sat Apr 30 2022 Christoph Erhardt fedora@sicherha.de - 1.2.1-1 +- Bump version to 1.2.1 +- Drop upstreamed patch + * Sat Apr 16 2022 Christoph Erhardt fedora@sicherha.de - 1.2-1 - Bump version to 1.2 - Drop upstreamed patches diff --git a/sources b/sources index 9451d87..d655ecd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mold-1.2.tar.gz) = 1308f5f274867a5d2d2c000a043ce645eff2a0c876fc1bec33c077cd7f5fc0f1f2b983211ca479cebc80f1ed3f3b0ea0d4c8f7e3e7f2124b713354b18ebc8676 +SHA512 (mold-1.2.1.tar.gz) = fc39674b00119d09b3275ed7232356f0b25dad1a0f3a498f9db1a4835b6d4f9ea637ca9a643a05591ea895e8751d9bee43cdcb42303beb082462e76ddb42a0f1
commit fd35a6b7272031da507ae33144ae16cc61014786 Author: Christoph Erhardt fedora@sicherha.de Date: Sat Apr 30 21:20:16 2022 +0200
Drop compatibility patch for mimalloc < 2.0.6 on epel8
Now that mimalloc 2.0.6 is available there, it is no longer needed.
diff --git a/0002-Fix-compatibility-with-libstdc-9.patch b/0002-Fix-compatibility-with-libstdc-9.patch deleted file mode 100644 index 710ceb7..0000000 --- a/0002-Fix-compatibility-with-libstdc-9.patch +++ /dev/null @@ -1,40 +0,0 @@ -From d068fb0caae8c8db97ee59ba400929f5f97f8be1 Mon Sep 17 00:00:00 2001 -Message-Id: d068fb0caae8c8db97ee59ba400929f5f97f8be1.1650123861.git.github@sicherha.de -From: Christoph Erhardt github@sicherha.de -Date: Tue, 22 Feb 2022 21:21:18 +0100 -Subject: [PATCH] Fix compatibility with libstdc++ < 9 - -mimalloc does not override the `nothrow` variants of the `delete` -operator because it assumes that their implementation in libstdc++ -redirects to the default `delete` operators. This is not the case for -libstdc++ < 9, where `std::free()` is called directly. - -Upstream bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68210 - -This patch ensures that the `nothrow` `delete` operators are overridden -as well. ---- - main.cc | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/main.cc b/main.cc -index b390b0f7..5c1f5450 100644 ---- a/main.cc -+++ b/main.cc -@@ -6,6 +6,13 @@ - - #ifdef USE_SYSTEM_MIMALLOC - #include <mimalloc-new-delete.h> -+ -+// Additionally override the nothrow delete operators for compatibility with -+// buggy libstdc++ < 9 -+#if MI_MALLOC_VERSION < 206 -+void operator delete(void* p, const std::nothrow_t&) noexcept { mi_free(p); } -+void operator delete[](void* p, const std::nothrow_t&) noexcept { mi_free(p); } -+#endif - #endif - - namespace mold { --- -2.35.1 - diff --git a/mold.spec b/mold.spec index 14c2bc5..ccf7284 100644 --- a/mold.spec +++ b/mold.spec @@ -17,10 +17,6 @@ Patch0: tbb-strip-werror.patch # Skip test if dwarfdump is unavailable Patch1: 0001-Skip-test-if-dwarfdump-is-unavailable.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 - # mold can produce native binaries for i686, x86_64, ARMv7, aarch64 and riscv64, # but it only runs on a 64-bit host ExclusiveArch: x86_64 aarch64 riscv64
commit d86874335d990bd6cc1fe4ff726559115e63fa7f Author: Christoph Erhardt fedora@sicherha.de Date: Sun Apr 24 13:28:15 2022 +0200
Drop build dependency on 32-bit static libc
It is no longer needed for mold 1.2; dropping it allows us to build mold for epel8.
diff --git a/mold.spec b/mold.spec index 0f38d9f..14c2bc5 100644 --- a/mold.spec +++ b/mold.spec @@ -40,9 +40,6 @@ BuildRequires: zlib-devel # The following packages are only required for executing the tests BuildRequires: clang BuildRequires: glibc-static -%ifarch x86_64 -BuildRequires: /usr/lib/libc.a -%endif %if ! 0%{?el8} BuildRequires: libdwarf-tools %endif
commit 5fb9a10d67865327f05f42dcf118b5fe39377d96 Author: Christoph Erhardt fedora@sicherha.de Date: Mon Apr 18 09:38:53 2022 +0200
Fix syntax of negated distribution check
This change affects only the test-suite execution, so there's no need to do another build.
diff --git a/mold.spec b/mold.spec index 6aeae9c..0f38d9f 100644 --- a/mold.spec +++ b/mold.spec @@ -43,7 +43,7 @@ BuildRequires: glibc-static %ifarch x86_64 BuildRequires: /usr/lib/libc.a %endif -%if 0%{!?el8} +%if ! 0%{?el8} BuildRequires: libdwarf-tools %endif BuildRequires: libstdc++-static
arch-excludes@lists.fedoraproject.org