[Buildroot] [PATCH 2/9] package/binutils: add upstream backported patches to support -mcmodel=large gcc option

Giulio Benetti giulio.benetti at benettiengineering.com
Tue Jun 8 22:16:58 UTC 2021


Hi Romain,

On 6/8/21 11:29 PM, Romain Naour wrote:
> Hi Giulio, All,
> 
> Le 03/05/2021 à 13:13, Giulio Benetti a écrit :
>> Add upstream backported patches that allows using -mcmodel=large gcc option
>> that in order allows fixing build failure due to binutils bug 21464:
>> https://sourceware.org/bugzilla/show_bug.cgi?id=21464
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
>> ---
>>   ...elocation-R_OR1K_GOT_AHI16-for-gotha.patch | 256 +++++++++
>>   ...K_GOT16-overflow-failures-in-presenc.patch |  61 +++
>>   ...ge-plt_relocs-when-generating-plt-en.patch | 500 ++++++++++++++++++
>>   ...elocation-R_OR1K_GOT_AHI16-for-gotha.patch | 256 +++++++++
>>   ...K_GOT16-overflow-failures-in-presenc.patch |  61 +++
>>   ...ge-plt_relocs-when-generating-plt-en.patch | 500 ++++++++++++++++++
>>   ...elocation-R_OR1K_GOT_AHI16-for-gotha.patch | 256 +++++++++
>>   ...K_GOT16-overflow-failures-in-presenc.patch |  61 +++
>>   ...ge-plt_relocs-when-generating-plt-en.patch | 500 ++++++++++++++++++
>>   ...elocation-R_OR1K_GOT_AHI16-for-gotha.patch | 256 +++++++++
>>   ...K_GOT16-overflow-failures-in-presenc.patch |  61 +++
>>   ...ge-plt_relocs-when-generating-plt-en.patch | 500 ++++++++++++++++++
>>   12 files changed, 3268 insertions(+)
>>   create mode 100644 package/binutils/2.32/0011-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch
>>   create mode 100644 package/binutils/2.32/0012-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch
>>   create mode 100644 package/binutils/2.32/0013-or1k-Support-large-plt_relocs-when-generating-plt-en.patch
>>   create mode 100644 package/binutils/2.34/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch
>>   create mode 100644 package/binutils/2.34/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch
>>   create mode 100644 package/binutils/2.34/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch
>>   create mode 100644 package/binutils/2.35.2/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch
>>   create mode 100644 package/binutils/2.35.2/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch
>>   create mode 100644 package/binutils/2.35.2/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch
>>   create mode 100644 package/binutils/2.36.1/0004-or1k-Implement-relocation-R_OR1K_GOT_AHI16-for-gotha.patch
>>   create mode 100644 package/binutils/2.36.1/0005-or1k-Avoid-R_OR1K_GOT16-overflow-failures-in-presenc.patch
>>   create mode 100644 package/binutils/2.36.1/0006-or1k-Support-large-plt_relocs-when-generating-plt-en.patch
>>
> 
>> +   unsigned nodelay = elf_elfheader (output_bfd)->e_flags & EF_OR1K_NODELAY;
>> +-  unsigned insn4;
>> ++  unsigned output_insns[PLT_MAX_INSN_COUNT];
>> ++
>> ++  /* Copy instructions into the output buffer.  */
>> ++  for (size_t i = 0; i < insn_count; i++)
>> ++    output_insns[i] = insns[i];
>> +
> 
> This syntax break with good old compilers :)
> 
> elf32-or1k.c:2251:3: error: 'for' loop initial declarations are only allowed in
> C99 or C11 mode
>     for (size_t i = 0; i < insn_count; i++)
>     ^
> 
> See:
> https://gitlab.com/bootlin/toolchains-builder/-/jobs/1325646298

Thanks for pointing, I didn't think about old host compiler. I'm going 
to fix it soon by patching actual patches initializing variable at the
begin of functions.

Best regards
-- 
Giulio Benetti
Benetti Engineering sas

> Best regards,
> Romain
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 





More information about the buildroot mailing list