[Buildroot] [PATCH] package/mesa3d: fix build on m68k

Arnout Vandecappelle arnout at mind.be
Sun Sep 19 11:49:02 UTC 2021



On 18/09/2021 14:47, Yann E. MORIN wrote:
> Giulio, All,
> 
> On 2021-09-15 00:10 +0200, Giulio Benetti spake thusly:
>> To build mesa3d for m68k we need to pass -mlong-jump-table-offsets CFLAG
>> since 'switch' blocks are pretty wide and lead to build failure. This way
>> 'switch' blocks will have a 32-bit addressing by default instead of the
>> standard 16-bit.
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/60c4653c2a93125edbdd0beb43cd47301643464a/
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
>> ---
>>   package/mesa3d/mesa3d.mk | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
>> index 54b50f684f..809a7d8e88 100644
>> --- a/package/mesa3d/mesa3d.mk
>> +++ b/package/mesa3d/mesa3d.mk
>> @@ -259,4 +259,13 @@ else
>>   MESA3D_CONF_OPTS += -Dzstd=disabled
>>   endif
>>   
>> +MESA3D_CFLAGS = $(TARGET_CFLAGS)
>> +
>> +# m68k needs 32-bit offsets in switch tables to build
>> +ifeq ($(BR2_m68k),y)
>> +MESA3D_CFLAGS += -mlong-jump-table-offsets
> 
> That option has only been added to gcc-7 [0] [1], which makes gcc >= 7 a
> pre-requisite for m68k, while mesa3d currently has no such requirement.

  It's been merged, so OK for now, but I think this is exactly the reason why we 
decided some time ago to just pass -O0 to work around compiler bugs for niche 
architectures...

  Regards,
  Arnout


More information about the buildroot mailing list