fontconfig: fix build with SDK producing -dD style output
authorAlexandru Ardelean <redacted>
Mon, 11 May 2026 06:58:59 +0000 (09:58 +0300)
committerAlexandru Ardelean <redacted>
Wed, 13 May 2026 04:27:14 +0000 (07:27 +0300)
commitd7b891ddd0fa03724d80e97d7604b39e40ab5681
tree96ad79933f353d41609fd5adab1d9febfee099ca
parent986edeb2e4d386c97563bf05c42c30d2be0b91bd
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 <redacted>
utils/fontconfig/Makefile
utils/fontconfig/patches/001-cutout-strip-preprocessor-artifacts.patch [new file with mode: 0644]
git clone https://git.99rst.org/PROJECT