[PATCH] microblaze: fix build error on 32-bit hosts
Frager, Neal
neal.frager@amd.com
Mon Oct 9 12:42:50 GMT 2023
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
More information about the Binutils
mailing list