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

Giulio Benetti giulio.benetti at benettiengineering.com
Mon Oct 4 20:37:55 UTC 2021


On 10/4/21 10:35 PM, Giulio Benetti wrote:
> Hi again Peter, Yann, All,
> 
> On 10/4/21 5:23 PM, Giulio Benetti wrote:
>> Hi Peter, Yann, All,
>>
>>> Il giorno 4 ott 2021, alle ore 17:01, Yann E. MORIN <yann.morin.1998 at free.fr> ha scritto:
>>>
>>> Peter, Giulio, All,
>>>
>>> On 2021-10-04 13:46 +0200, Peter Korsgaard spake thusly:
>>>>>>>>> "Giulio" == Giulio Benetti <giulio.benetti at benettiengineering.com> writes:
>>>>
>>>>> 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. This can be done only with m68k gcc version >= 7.x
>>>>> because gcc flag used to fix this(-mlong-jump-table-offsets) is
>>>>> available only from that version on.
>>>>
>>>>> Fixes:
>>>>> http://autobuild.buildroot.net/results/60c4653c2a93125edbdd0beb43cd47301643464a/
>>>>
>>>>> Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
>>>>> ---
>>>>> V1-> V2:
>>>>> * add gcc >= 7.x dependency to Config.in as suggested by Yann Morin
>>>>> * improve commit log according to Config.in change
>>>>
>>>> ..
>>>>
>>>>> +# m68k needs 32-bit offsets in switch tables to build
>>>>> +ifeq ($(BR2_m68k),y)
>>>>> +MESA3D_CFLAGS += -mlong-jump-table-offsets
>>>>> +endif
>>>>> +
>>>>> +MESA3D_CONF_OPTS += -DCMAKE_C_FLAGS="$(MESA3D_CFLAGS)"
>>>>> +
>>>>> $(eval $(meson-package))
>>>>
>>>> Does that really work? mesa3d is using meson, not cmake.
> 
> It comes out that it works
> 
>>>
>>> Apparently, no:
>>>      http://autobuild.buildroot.org/results/26a/26a97e080c49c42c06ed59ec6a9d51d81b0ab882/build-end.log
> 
> This has not this patch applied, so it's ok it fails.
> 
> There is one unnecessary line:
> MESA3D_CONF_OPTS += -DCMAKE_C_FLAGS="$(MESA3D_CFLAGS)"
> 
> On meson we don't need it, so it's superflous and what really passes the
> additional CFLAGS is itself:
> MESA3D_CFLAGS += -mlong-jump-table-offsets
> because in pkg-meson.mk:
> $(2)_CFLAGS ?= $$(TARGET_CFLAGS)
> 
> I've just submitted a patch to remove the unnecessary line:

https://patchwork.ozlabs.org/project/buildroot/patch/20211004203535.923467-1-giulio.benetti@benettiengineering.com/

I've forgotten to point it, sorry for the noise

Best regards
-- 
Giulio Benetti
Benetti Engineering sas


More information about the buildroot mailing list