Created attachment 859613 [details] emerge --info x11-libs/cairo-1.17.8 fail to build
Created attachment 859614 [details] emerge log
Created attachment 859615 [details, diff] solved with this patch
It's not fixed for anybody else.
There are 2 problems that lead to this bug. The first is that the build system assumes that libexecinfo is part of the C standard library and it doesn't try to link against anything when deciding to compile malloc-stats.c, leading to a linking error on musl systems that have the execinfo.h header present. This issue is solved upstream in https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/458. The second problem is the build system deciding to build malloc-stats.c based on the availability of the execinfo.h header. I try to solve this in https://github.com/gentoo/gentoo/pull/31775 by adding an option instead of the autodetection. Given that libexecinfo is not available in ::gentoo this bug only happens when an user installs the library from an overlay on a musl system, in the reporter's (and my) case, it came from 12101111-overlay (https://github.com/12101111/overlay) as a dependency of chromium.
I can confirm this bug is still present as of x11-libs/cairo-1.18.0.