Compiling a statically linked binary for bitcoin core v0.12.0 I'm trying to compile a statically linked binary following https://github.com/bitcoin/bitcoin/tree/master/depends. But when I run make I got this error:

fcmatch.c:284:63: error: 'PRI_CHAR_WIDTH_STRONG' undeclared here (not in a function); did you mean 'PRI_CHAR_HEIGHT_STRONG'?
  284 | #define FC_OBJECT(NAME, Type, Cmp) { FC_##NAME##_OBJECT, Cmp, PRI_##NAME##_STRONG, PRI_##NAME##_WEAK },
      |                                                               ^~~~
fcobjs.h:54:1: note: in expansion of macro 'FC_OBJECT'
   54 | FC_OBJECT (CHAR_WIDTH,  FcTypeInteger, NULL)
      | ^~~~~~~~~
fcmatch.c:284:84: error: 'PRI_CHAR_WIDTH_WEAK' undeclared here (not in a function); did you mean 'PRI_CHAR_HEIGHT_WEAK'?
  284 | #define FC_OBJECT(NAME, Type, Cmp) { FC_##NAME##_OBJECT, Cmp, PRI_##NAME##_STRONG, PRI_##NAME##_WEAK },
      |                                                                                    ^~~~
fcobjs.h:54:1: note: in expansion of macro 'FC_OBJECT'
   54 | FC_OBJECT (CHAR_WIDTH,  FcTypeInteger, NULL)
      | ^~~~~~~~~
make[4]: *** [Makefile:613: fcmatch.lo] Error 1
make[4]: Leaving directory '/usr/local/src/bitcoin-0.12.0/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.11.1-14f43f3a52a/src'
make[3]: *** [Makefile:474: all] Error 2
make[3]: Leaving directory '/usr/local/src/bitcoin-0.12.0/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.11.1-14f43f3a52a/src'
make[2]: *** [Makefile:561: all-recursive] Error 1
make[2]: Leaving directory '/usr/local/src/bitcoin-0.12.0/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.11.1-14f43f3a52a'
make[1]: *** [Makefile:444: all] Error 2
make[1]: Leaving directory '/usr/local/src/bitcoin-0.12.0/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.11.1-14f43f3a52a'
make: *** [funcs.mk:240: /usr/local/src/bitcoin-0.12.0/depends/work/build/x86_64-pc-linux-gnu/fontconfig/2.11.1-14f43f3a52a/./.stamp_built] Error 2

I'm doing this on ubuntu 20.04 LTS using the source code of bitcoin core v0.12.0. I already compiled the source code and because it is an old version it was necessary to install some old libraries. But I believe the problem is related to the C++ version and I don't know how to set the right C++ version. How can I fix that?
Apply these two commits in order to update fontconfig.
https://github.com/bitcoin/bitcoin/commit/86d410d91b2188405a56bba5f1a1f74694be886a#diff-7cec5704a9b80e0db0bdc569395a7e8f2584356138b37b6a70ff30ba38224516
https://github.com/bitcoin/bitcoin/commit/3498a8d018fa02de17e1f9c4cda49f4c7edb3c6c#diff-7cec5704a9b80e0db0bdc569395a7e8f2584356138b37b6a70ff30ba38224516