From: Alexandru Ardelean Date: Mon, 11 May 2026 06:58:59 +0000 (+0300) Subject: fontconfig: fix build with SDK producing -dD style output X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=d7b891ddd0fa03724d80e97d7604b39e40ab5681;p=openwrt-packages.git fontconfig: fix build with SDK producing -dD style output Some SDK/host GCC configurations, when meson invokes cc.preprocess() to expand fcobjshash.gperf.h, produce output that includes predefined macro dumps (e.g. #define __STDC__ 1) alongside linemarker lines. The upstream cutout.py script, which strips CUT_OUT_BEGIN/END-delimited sections from the preprocessed output before feeding it to gperf, passes these lines through verbatim into fcobjshash.gperf. gperf then copies them into the declarations section of fcobjshash.h. When fcobjs.c includes fcobjshash.h, the compiler encounters #define redefinitions and stray # tokens, causing a build failure. Fix cutout.py to skip any line starting with # (C preprocessor linemarkers and predefined macro definitions) before writing to the output gperf file. Signed-off-by: Alexandru Ardelean --- diff --git a/utils/fontconfig/Makefile b/utils/fontconfig/Makefile index 69409d991..e1eb0073e 100644 --- a/utils/fontconfig/Makefile +++ b/utils/fontconfig/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fontconfig PKG_VERSION:=2.16.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://www.freedesktop.org/software/fontconfig/release/ diff --git a/utils/fontconfig/patches/001-cutout-strip-preprocessor-artifacts.patch b/utils/fontconfig/patches/001-cutout-strip-preprocessor-artifacts.patch new file mode 100644 index 000000000..ceaa694d9 --- /dev/null +++ b/utils/fontconfig/patches/001-cutout-strip-preprocessor-artifacts.patch @@ -0,0 +1,11 @@ +--- a/src/cutout.py ++++ b/src/cutout.py +@@ -19,6 +19,8 @@ if __name__== '__main__': + + if write and l: + stripped = re.sub(r'^\s+', '', l) ++ if stripped.startswith('#'): ++ continue + stripped = re.sub(r'\s*,\s*', ',', stripped) + if not stripped.isspace() and stripped: + out.write('%s\n' % stripped)