From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRKWc-0007ZJ-IE for guix-patches@gnu.org; Fri, 08 Jun 2018 12:46:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRKWX-0004re-VU for guix-patches@gnu.org; Fri, 08 Jun 2018 12:46:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60252) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRKWX-0004rZ-RQ for guix-patches@gnu.org; Fri, 08 Jun 2018 12:46:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fRKWX-0003D0-LO for guix-patches@gnu.org; Fri, 08 Jun 2018 12:46:01 -0400 Subject: [bug#31741] [PATCH] gnu: linux-libre: Fix build on AArch64. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180606223635.12450-1-mbakke@fastmail.com> Date: Fri, 08 Jun 2018 18:45:08 +0200 In-Reply-To: <20180606223635.12450-1-mbakke@fastmail.com> (Marius Bakke's message of "Thu, 7 Jun 2018 00:36:35 +0200") Message-ID: <87y3fpi5wr.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Marius Bakke Cc: 31741@debbugs.gnu.org Hello Marius! Marius Bakke skribis: > * gnu/packages/patches/binutils-aarch64-symbol-relocation.patch: New file. > * gnu/local.mk (dist_patch_DATA): Register it. > * gnu/packages/base.scm (binutils-sans-bug-22764): New public variable. > * gnu/packages/linux.scm (make-linux-libre)[native-inputs]: On aarch64, d= efine > new ld-wrapper with the above binutils and use it. Woohoo, excellent! > +++ b/gnu/packages/patches/binutils-aarch64-symbol-relocation.patch > @@ -0,0 +1,108 @@ > +Fix a regression in Binutils 2.30 where some symbols are incorrectly ass= umed > +to be addresses: > + > +https://sourceware.org/bugzilla/show_bug.cgi?id=3D22764 > + > +Patch taken from upstream (with ChangeLog entries omitted): > + > +https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;a=3Dcommitdif= f;h=3D279b2f94168ee91e02ccd070d27c983fc001fe12 > + > +diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c > +index af448f9..2737773 100644 > +--- a/bfd/elfnn-aarch64.c > ++++ b/bfd/elfnn-aarch64.c > +@@ -7189,10 +7189,19 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bf= d_link_info *info, > + #if ARCH_SIZE =3D=3D 64 > + case BFD_RELOC_AARCH64_32: > + #endif > +- if (bfd_link_pic (info) > +- && (sec->flags & SEC_ALLOC) !=3D 0 > +- && (sec->flags & SEC_READONLY) !=3D 0) > ++ if (bfd_link_pic (info) && (sec->flags & SEC_ALLOC) !=3D 0) > + { > ++ if (h !=3D NULL > ++ /* This is an absolute symbol. It represents a value instead > ++ of an address. */ > ++ && ((h->root.type =3D=3D bfd_link_hash_defined > ++ && bfd_is_abs_section (h->root.u.def.section)) > ++ /* This is an undefined symbol. */ > ++ || h->root.type =3D=3D bfd_link_hash_undefined)) > ++ break; > ++ > ++ /* For local symbols, defined global symbols in a non-ABS sectio= n, > ++ it is assumed that the value is an address. */ > + int howto_index =3D bfd_r_type - BFD_RELOC_AARCH64_RELOC_START; > + _bfd_error_handler > + /* xgettext:c-format */ Perhaps you can omit the ld/testsuite bits that follow (I don=E2=80=99t thi= nk we run this test suite, do we?). Apart from that LGTM, thank you! Ludo=E2=80=99.