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

Giulio Benetti giulio.benetti at benettiengineering.com
Tue Sep 14 22:10:53 UTC 2021


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
+endif
+
+MESA3D_CONF_OPTS += -DCMAKE_C_FLAGS="$(MESA3D_CFLAGS)"
+
 $(eval $(meson-package))
-- 
2.25.1



More information about the buildroot mailing list