From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 091AD3858D33 for ; Mon, 9 Oct 2023 12:38:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 091AD3858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from r6.localdomain (82-217-174-174.cable.dynamic.v4.ziggo.nl [82.217.174.174]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 8856F300B302; Mon, 9 Oct 2023 14:38:00 +0200 (CEST) Received: by r6.localdomain (Postfix, from userid 1000) id 94B643403F9; Mon, 9 Oct 2023 14:37:59 +0200 (CEST) Message-ID: <0fa85fa35025cf0771ecad670e57b446f6da6796.camel@klomp.org> Subject: Re: [PATCH] microblaze: fix build error on 32-bit hosts From: Mark Wielaard To: "Frager, Neal" , Michael Eager , "Maciej W. Rozycki" Cc: "Nali, Appa Rao" , "binutils@sourceware.org" , "Erkiaga Elorza, Ibai" , "luca.ceresoli@bootlin.com" , "Hatle, Mark" , "Mekala, Nagaraju" , "nickc@redhat.com" , "Mutyala, Sadanand" , "Hunsigida, Vidhumouli" Date: Mon, 09 Oct 2023 14:37:59 +0200 In-Reply-To: References: <5d2ce973-6287-db3d-fc82-966914f765a7@eagercon.com> <20231007220105.818599-1-mark@klomp.org> <609d027a-0671-4416-ea0f-6d59b32f94f1@eagercon.com> <20231007231407.GC728@gnu.wildebeest.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-3027.1 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Neal, On Mon, 2023-10-09 at 11:58 +0000, Frager, Neal wrote: > The only thing I am unable to verify is using a 32-bit host. I have only= been building with a 64-bit host. >=20 > Does anyone have an idea why this patch would lead to issues with a 32-bi= t build host and not a 64-bit host? It is as the error says: elf32-microblaze.c: In function =E2=80=98microblaze_elf_relax_section=E2=80= =99: elf32-microblaze.c:1989:53: error: format =E2=80=98%lx=E2=80=99 expects arg= ument of type =E2=80=98long unsigned int=E2=80=99, but argument 5 has type = =E2=80=98bfd_vma=E2=80=99 {aka =E2=80=98unsigned int=E2=80=99} [-Werror=3Df= ormat=3D] 1989 | fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__,= val, irel->r_addend); | ~~^ = ~~~~~~~~~~~~~~ | | = | | long unsigned i= nt bfd_vma {aka unsigned int} | %x elf32-microblaze.c:2074:51: error: format =E2=80=98%lx=E2=80=99 expects arg= ument of type =E2=80=98long unsigned int=E2=80=99, but argument 5 has type = =E2=80=98bfd_vma=E2=80=99 {aka =E2=80=98unsigned int=E2=80=99} [-Werror=3Df= ormat=3D] 2074 | fprintf(stderr, "%d: CORRUPT relax reloc! %x %lx\n", __LINE__, v= al, irelscan->r_addend); | ~~^ = ~~~~~~~~~~~~~~~~~~ | | = | | long unsigned int= bfd_vma {aka unsigned int} | %x On a 32bit host bfd_vma is an unsigned int, but you are using a long printf format. Casting the r_addend to (long) is one way to resolve this. Cheers, Mark P.S. If you have a commit access to binutils you can use a try branch to test patches against builder.sourceware.org which contains several 32bit hosts. See https://sourceware.org/binutils/wiki/Buildbot