From 5eeedfa448f6dc9b698d64dfccc3393d386f90eb Mon Sep 17 00:00:00 2001 From: Christoph Erhardt Date: Wed, 23 Feb 2022 07:36:30 +0100 Subject: [PATCH] Fix failing unit test on i686 --- 0003-Fix-dynamic-unit-test-on-i686.patch | 34 ++++++++++++++++++++++++ mold.spec | 3 +++ 2 files changed, 37 insertions(+) create mode 100644 0003-Fix-dynamic-unit-test-on-i686.patch diff --git a/0003-Fix-dynamic-unit-test-on-i686.patch b/0003-Fix-dynamic-unit-test-on-i686.patch new file mode 100644 index 0000000..907f712 --- /dev/null +++ b/0003-Fix-dynamic-unit-test-on-i686.patch @@ -0,0 +1,34 @@ +From 857d311771606ad332264719588af016e5320ede Mon Sep 17 00:00:00 2001 +Message-Id: <857d311771606ad332264719588af016e5320ede.1645598116.git.github@sicherha.de> +From: Christoph Erhardt +Date: Wed, 23 Feb 2022 07:34:21 +0100 +Subject: [PATCH] Fix dynamic unit test on i686 + +Signed-off-by: Christoph Erhardt +--- + test/elf/dynamic.sh | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/test/elf/dynamic.sh b/test/elf/dynamic.sh +index 0ea7ae82..8f9a6628 100755 +--- a/test/elf/dynamic.sh ++++ b/test/elf/dynamic.sh +@@ -30,6 +30,14 @@ EOF + + $CC -B. -o $t/exe -pie $t/b.o + count=$(readelf -W --relocs $t/exe | grep -E 'R_[a-zA-Z0-9_]+_RELATIVE' | wc -l) +-readelf -W --dynamic $t/exe | grep -q "RELACOUNT.*\b$count\b" ++ ++case "$(uname -m)" in ++i?86) ++ readelf -W --dynamic $t/exe | grep -q "RELCOUNT.*\b$count\b" ++ ;; ++*) ++ readelf -W --dynamic $t/exe | grep -q "RELACOUNT.*\b$count\b" ++ ;; ++esac + + echo OK +-- +2.35.1 + diff --git a/mold.spec b/mold.spec index c4ab880..874e8d9 100644 --- a/mold.spec +++ b/mold.spec @@ -21,6 +21,9 @@ Patch1: 0001-Skip-reloc-rodata-test-on-aarch64.patch # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68210 Patch2: 0002-Fix-compatibility-with-libstdc-9.patch +# Fix unit test on i686 +Patch3: 0003-Fix-dynamic-unit-test-on-i686.patch + # mold can currently produce native binaries for these architectures only ExclusiveArch: %{ix86} x86_64 aarch64 riscv64