public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Frager, Neal" <neal.frager@amd.com>
To: Mark Wielaard <mark@klomp.org>,
	Michael Eager <eager@eagercon.com>,
	"Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: "Nali, Appa Rao" <appa.rao.nali@amd.com>,
	"binutils@sourceware.org" <binutils@sourceware.org>,
	"Erkiaga Elorza, Ibai" <ibai.erkiaga-elorza@amd.com>,
	"luca.ceresoli@bootlin.com" <luca.ceresoli@bootlin.com>,
	"Hatle, Mark" <mark.hatle@amd.com>,
	"Mekala, Nagaraju" <nagaraju.mekala@amd.com>,
	"nickc@redhat.com" <nickc@redhat.com>,
	"Mutyala, Sadanand" <sadanand.mutyala@amd.com>,
	"Hunsigida, Vidhumouli" <vidhumouli.hunsigida@amd.com>
Subject: RE: [PATCH] microblaze: fix build error on 32-bit hosts
Date: Mon, 9 Oct 2023 12:42:50 +0000	[thread overview]
Message-ID: <CH2PR12MB5004EA782CB069BE224B09CAF0CEA@CH2PR12MB5004.namprd12.prod.outlook.com> (raw)
In-Reply-To: <0fa85fa35025cf0771ecad670e57b446f6da6796.camel@klomp.org>

Hi Mark,

> The only thing I am unable to verify is using a 32-bit host.  I have only been building with a 64-bit host.
> 
> Does anyone have an idea why this patch would lead to issues with a 32-bit build host and not a 64-bit host?

> It is as the error says:

> elf32-microblaze.c: In function ‘microblaze_elf_relax_section’:
> elf32-microblaze.c:1989:53: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘bfd_vma’ {aka ‘unsigned int’} [-Werror=format=]
> 1989 |       fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, irel->r_addend);
>      |                                                   ~~^                    ~~~~~~~~~~~~~~
>      |                                                     |                        |
>      |                                                     long unsigned int        bfd_vma {aka unsigned int}
>      |                                                   %x
> elf32-microblaze.c:2074:51: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘bfd_vma’ {aka ‘unsigned int’} [-Werror=format=]
> 2074 |    fprintf(stderr, "%d: CORRUPT relax reloc! %x %lx\n", __LINE__, val, 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.

I already solved this build issue.  I thought the issue Maciej was reporting was another one.

If this is the only build issue, then I will submit v3 which solves this problem now.

Could you please confirm that this is the only issue that needs to be fixed?

Best regards,
Neal Frager
AMD

  reply	other threads:[~2023-10-09 12:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 12:51 [PATCH v2 1/1] opcodes: microblaze: Add new bit-field instructions Neal Frager
2023-10-06 19:17 ` Michael Eager
2023-10-07 19:23   ` Maciej W. Rozycki
2023-10-07 22:33     ` Michael Eager
2023-10-07 23:11     ` Michael Eager
2023-10-09  6:32       ` Frager, Neal
2023-10-09 13:32         ` Maciej W. Rozycki
2023-10-09 15:09         ` Michael Eager
2023-10-10  6:54           ` Frager, Neal
2023-10-10 16:16             ` Michael Eager
2023-10-10 17:54               ` Michael Eager
2023-10-09 10:53     ` Frager, Neal
2023-10-09 17:53       ` Michael Eager
2023-10-07 22:01   ` [PATCH] microblaze: fix build error on 32-bit hosts Mark Wielaard
2023-10-07 22:53     ` Michael Eager
2023-10-07 23:07       ` Michael Eager
2023-10-07 23:14         ` Mark Wielaard
2023-10-09 11:58           ` Frager, Neal
2023-10-09 12:37             ` Mark Wielaard
2023-10-09 12:42               ` Frager, Neal [this message]
2023-10-09 12:48                 ` Mark Wielaard
2023-10-09 12:56                   ` Frager, Neal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CH2PR12MB5004EA782CB069BE224B09CAF0CEA@CH2PR12MB5004.namprd12.prod.outlook.com \
    --to=neal.frager@amd.com \
    --cc=appa.rao.nali@amd.com \
    --cc=binutils@sourceware.org \
    --cc=eager@eagercon.com \
    --cc=ibai.erkiaga-elorza@amd.com \
    --cc=luca.ceresoli@bootlin.com \
    --cc=macro@orcam.me.uk \
    --cc=mark.hatle@amd.com \
    --cc=mark@klomp.org \
    --cc=nagaraju.mekala@amd.com \
    --cc=nickc@redhat.com \
    --cc=sadanand.mutyala@amd.com \
    --cc=vidhumouli.hunsigida@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).