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:
( cd depends && make CC=clang-16 CXX="clang++-16" fontconfig )
Output:
Making all in fc-list
make[3]: Entering directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216/fc-list'
CC fc-list.o
fc-list.c:119:27: error: call to undeclared function 'strdup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
format = (FcChar8 *) strdup (optarg);
^
fc-list.c:119:27: note: did you mean 'strcmp'?
/usr/include/string.h:156:12: note: 'strcmp' declared here
extern int strcmp (const char *__s1, const char *__s2)
^
fc-list.c:119:15: warning: cast to 'FcChar8 *' (aka 'unsigned char *') from smaller integer type 'int' [-Wint-to-pointer-cast]
format = (FcChar8 *) strdup (optarg);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
make[3]: *** [Makefile:510: fc-list.o] Error 1
make[3]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216/fc-list'
make[2]: *** [Makefile:581: all-recursive] Error 1
make[2]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216'
make[1]: *** [Makefile:465: all] Error 2
make[1]: Leaving directory '/bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216'
make: *** [funcs.mk:291: /bitcoin-core/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.12.6-a8f2b26f216/./.stamp_built] Error 2