From aa05fed64a98e73b60c2dd76e10186ac2a0c761e Mon Sep 17 00:00:00 2001 From: psykose Date: Wed, 22 Jun 2022 15:47:12 +0000 Subject: [PATCH] main/binutils: backport fix for -Os on ppc64le (cherry picked from commit d2e0b0585998c0db05e977e8ccbbb583cb21e716) --- main/binutils/APKBUILD | 4 ++- .../binutils/binutils-ppc64le-assertion.patch | 32 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 main/binutils/binutils-ppc64le-assertion.patch diff --git a/main/binutils/APKBUILD b/main/binutils/APKBUILD index dc97c7854c0..17fab6ace8b 100644 --- a/main/binutils/APKBUILD +++ b/main/binutils/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Ariadne Conill pkgname=binutils pkgver=2.38 -pkgrel=2 +pkgrel=3 pkgdesc="Tools necessary to build programs" url="https://www.gnu.org/software/binutils/" makedepends_build="bison flex texinfo" @@ -20,6 +20,7 @@ source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz binutils-ppc-fix-machine-options.patch binutils-s390x-1.patch binutils-s390x-2.patch + binutils-ppc64le-assertion.patch " builddir="$srcdir/$pkgname-$pkgver" @@ -144,4 +145,5 @@ f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488 27ea91e0e406e2ed464fd692cf92a07e338781789f2d968c8b95d9d5545985056a6f7f500df3952e5ab42165db28b741aa33d6b717e880b11a2e41fe406b13c4 binutils-ppc-fix-machine-options.patch a9efe2689624865f0ff33d4776a5bd295bcad6484bdd38d0ca490fea43691c4933ab33d17478851998eef12922dbf83d6c3225bb1f8faf92a1367d086390f7d3 binutils-s390x-1.patch 0e291df80ad279005265634014d0935d2c115a5ed708d25407094b7ad4ddf267d1fb7fcbcb2d9ad73bd305b4e3974628b820bd1f249f56c095e4896872434cc9 binutils-s390x-2.patch +63e58f45df3570279cb1ee5215ba3de77de012cac20da9cdd23f86a93890056e1efa397521559cfd0716d5239604607c440d8f4d089d83c98b8fbc1b5c5305f8 binutils-ppc64le-assertion.patch " diff --git a/main/binutils/binutils-ppc64le-assertion.patch b/main/binutils/binutils-ppc64le-assertion.patch new file mode 100644 index 00000000000..cd6113e6f8b --- /dev/null +++ b/main/binutils/binutils-ppc64le-assertion.patch @@ -0,0 +1,32 @@ +From 97dd8079feb35456d7b387a594b5e00f7654b3b8 Mon Sep 17 00:00:00 2001 +From: Alan Modra +Date: Thu, 23 Jun 2022 17:50:30 +0930 +Subject: [PATCH] PowerPC64: fix assertion in ppc_build_one_stub with -Os code + +save_res stubs aren't written in ppc_build_one_stub, their offsets +(which are zero) should not be checked. + + * elf64-ppc.c (ppc_build_one_stub): Don't check save_res offsets. + +(cherry picked from commit 570e911f4e533fad33ad5e4e1102929cf7e80bd7) +--- + bfd/elf64-ppc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c +index cb12ed476d8..df503341fe9 100644 +--- a/bfd/elf64-ppc.c ++++ b/bfd/elf64-ppc.c +@@ -11700,7 +11700,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) + if (htab == NULL) + return false; + +- BFD_ASSERT (stub_entry->stub_offset >= stub_entry->group->stub_sec->size); ++ BFD_ASSERT (stub_entry->stub_offset >= stub_entry->group->stub_sec->size ++ || stub_entry->type.main == ppc_stub_save_res); + loc = stub_entry->group->stub_sec->contents + stub_entry->stub_offset; + + htab->stub_count[stub_entry->type.main - 1] += 1; +-- +2.31.1 +