瀏覽代碼

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 <thomas@devoogdt.com>
[Julien: add a link to the issue in the .mk file]
Signed-off-by: Julien Olivain <ju.o@free.fr>
Thomas Devoogdt 6 月之前
父節點
當前提交
71a7d6ff20
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      package/fontconfig/fontconfig.mk

+ 7 - 0
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))