Steps to reproduce on a fresh install of Ubuntu Lunar:
export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git --depth=1 ./bitcoin-core && cd bitcoin-core && apt install libc++abi-16-dev libc++-16-dev clang-16 llvm-16 build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq make automake cmake curl g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison -y
Then:
0( cd depends && make CC=clang-16 CXX="clang++-16" fontconfig )
Output:
0Making all in fc-list
1make[3]: Entering directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216/fc-list'
2 CC fc-list.o
3fc-list.c:119:27: error: call to undeclared function 'strdup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
4 format = (FcChar8 *) strdup (optarg);
5 ^
6fc-list.c:119:27: note: did you mean 'strcmp'?
7/usr/include/string.h:156:12: note: 'strcmp' declared here
8extern int strcmp (const char *__s1, const char *__s2)
9 ^
10fc-list.c:119:15: warning: cast to 'FcChar8 *' (aka 'unsigned char *') from smaller integer type 'int' [-Wint-to-pointer-cast]
11 format = (FcChar8 *) strdup (optarg);
12 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
131 warning and 1 error generated.
14make[3]: *** [Makefile:510: fc-list.o] Error 1
15make[3]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216/fc-list'
16make[2]: *** [Makefile:581: all-recursive] Error 1
17make[2]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216'
18make[1]: *** [Makefile:465: all] Error 2
19make[1]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216'
20make: *** [funcs.mk:291: /bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216/./.stamp_built] Error 2