[Buildroot] [PATCH] package/mesa3d: fix build on m68k
Giulio Benetti
giulio.benetti at benettiengineering.com
Sun Sep 19 00:53:56 UTC 2021
Hi Yann,
On 9/18/21 2:47 PM, 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.
> Maybe add something like:
>
> depends on !BR2_m68k || BR2_TOOLCHAIN_GCC_AT_LEAST_7
>
> Then it should be propagated to the few packages that select mesa3d;
>
> package/intel-mediadriver/
> -> not needed, already depends on x86_64, so implies !m68k
>
> package/x11r7/xdriver_xf86-video-imx-viv/
> -> this should not be needed either, because imx is an ARM, but
> xdriver_xf86-video-imx-viv is missing a depends on BR2_arm
> (although the comments do have that dependency). However, it
> depends on other imx related packages, and they depend on
> either arm or aarch64, so that implies !m68k.
>
> So, no need to propagate the new dependency.
>
> [0] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57583#c15
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57583#c16
Thank you for reviewing and pointing me this, I didn't think about CFLAG
availability through version.
Just submitted v2.
Best regards
--
Giulio Benetti
Benetti Engineering sas
> Regards,
> Yann E. MORIN.
>
>> +endif
>> +
>> +MESA3D_CONF_OPTS += -DCMAKE_C_FLAGS="$(MESA3D_CFLAGS)"
>> +
>> $(eval $(meson-package))
>> --
>> 2.25.1
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot at lists.buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
>
More information about the buildroot
mailing list