From 71a7d6ff201522a216910eacc2f40467c8e7ab06 Mon Sep 17 00:00:00 2001 From: Thomas Devoogdt Date: Mon, 27 Jan 2025 13:56:42 +0100 Subject: [PATCH] package/fontconfig: fix compile issue if BR2_DEBUG_3 has been selected When BR2_DEBUG_3=y, fontconfig fails to build with error: src/fcobjshash.gperf:568:7: error: stray '#' in program src/fcobjshash.gperf:1:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant 1 | #define __STDC__ 1 | ^ This issue has been raised upstream [1], and reported in buildroot [2]. Upstream has not yet defined a solution, so force it to -g2 for the time being. Fixes: - https://autobuild.buildroot.org/results/6ae/6aef28611ad05d8db65105ab150ae980bc6bff4e/build-end.log - https://autobuild.buildroot.org/results/cc3/cc38846fdf63954422ec08d3ae57f2f09ebbf8c8/build-end.log - https://autobuild.buildroot.org/results/b7a/b7ad9a7ecb1d06b8a3d9e86d386195f3c212b9d8/build-end.log - ... [1] https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/436 [2] https://patchwork.ozlabs.org/comment/3450162/ Signed-off-by: Thomas Devoogdt [Julien: add a link to the issue in the .mk file] Signed-off-by: Julien Olivain --- package/fontconfig/fontconfig.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/fontconfig/fontconfig.mk b/package/fontconfig/fontconfig.mk index cc6ca88585..21eba76a83 100644 --- a/package/fontconfig/fontconfig.mk +++ b/package/fontconfig/fontconfig.mk @@ -20,5 +20,12 @@ FONTCONFIG_CONF_OPTS = \ -Dcache-dir=/var/cache/fontconfig \ -Ddoc=disabled +FONTCONFIG_CFLAGS = $(TARGET_CFLAGS) + +# See: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/436 +ifeq ($(BR2_DEBUG_3),y) +FONTCONFIG_CFLAGS += -g2 +endif + $(eval $(meson-package)) $(eval $(host-meson-package))