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

Giulio Benetti giulio.benetti at benettiengineering.com
Mon Oct 4 20:35:45 UTC 2021


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.

Best regards
-- 
Giulio Benetti
Benetti Engineering sas

> Strange, I’m going to fix it tonight. I don’t know how it could be, because I’m sure the solution works. Sorry
> 
> Giulio
> 
>>
>> Damn, not sure how I let this split through... :-/
>>
>> Regards,
>> Yann E. MORIN.
>>
>> -- 
>> .-----------------.--------------------.------------------.--------------------.
>> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
>> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
>> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
>> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
>> '------------------------------^-------^------------------^--------------------'
>> _______________________________________________
>> buildroot mailing list
>> buildroot at buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
> 
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
> 



More information about the buildroot mailing list