[PING^5][PATCH v2] Fix 64-bit BFD detection causing build failures

Luis Machado luis.machado@arm.com
Tue Apr 22 12:47:24 GMT 2025


On 4/18/25 10:51, Alan Modra wrote:
> On Tue, Apr 15, 2025 at 11:13:08AM +0100, Luis Machado wrote:
>> I tried building a 32-bit hosted variation, but I'm running into some build issues.
>>
>> Did you build this recently? I ask just to make sure this build issue is not something
>> specific to my system.
>>
>> ../../../repos/binutils-gdb/ld/ldmain.c: In function ‘report_phases’:
>> ../../../repos/binutils-gdb/ld/ldmain.c:519:28: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘__time64_t’ {aka ‘long long int’} [-Werror=format=]
>>   519 |         l = fprintf (file, "%-*" FORMAT, columns[N].width, VAL);        \
>>       |                            ^~~~~
>> ../../../repos/binutils-gdb/ld/ldmain.c:566:7: note: in expansion of macro ‘COLUMN_ENTRY’
>>   566 |       COLUMN_ENTRY (pd->use.ru_utime.tv_sec, "ld", 3);
>>       |       ^~~~~~~~~~~~
> 
> I'll commit the following which ought to fix your problem.
> 
> diff --git a/ld/ldmain.c b/ld/ldmain.c
> index 716272b02ab..67c60c3f80d 100644
> --- a/ld/ldmain.c
> +++ b/ld/ldmain.c
> @@ -563,8 +563,8 @@ report_phases (FILE * file, time_t * start, char ** argv)
>        COLUMN_ENTRY (pd->duration, "ld", 1);
>  #if defined (HAVE_GETRUSAGE)
>        COLUMN_ENTRY (pd->use.ru_maxrss, "ld", 2);
> -      COLUMN_ENTRY (pd->use.ru_utime.tv_sec, "ld", 3);
> -      COLUMN_ENTRY (pd->use.ru_stime.tv_sec, "ld", 4);
> +      COLUMN_ENTRY ((int64_t) pd->use.ru_utime.tv_sec, PRId64, 3);
> +      COLUMN_ENTRY ((int64_t) pd->use.ru_stime.tv_sec, PRId64, 4);
>  #endif
>        fprintf (file, "\n");
>      }
> 
> 

Thanks Alan. I can confirm that addressed the build issues I was seeing, and it builds to
completion now.


More information about the Binutils mailing list