Created attachment 440068 [details] build log As can be deduced from the almost-completely-useless logs, build of dev-ruby/json failed for me trying to use no-longer-installed gcc version that I happened to have in CC when I rebuilt dev-lang/ruby last time. Which means it doesn't respect the current value of CC/CXX after all. If this is a generic issue with Ruby packages, feel free to transform this bug into a generic one.
Created attachment 440070 [details] mkmf.log
Yes, this is a generic ruby extension built system issue. I think bug 476668 is related.
I suspect the modern-day version of this was fixed by: commit 2a348f36672c06a1075dc02a0ca852f7934fbdbf Author: Hans de Graaff <graaff@gentoo.org> Date: Mon Aug 23 19:33:18 2021 +0200 eclass/ruby-fakegem.eclass: set flags for compilation Explicitly pass CC, CFLAGS and LDFLAGS when compiling ruby extensions. By default ruby re-uses the stored flags used when compiling ruby itself. This is intended to create a better chance of compatibility between extensions and ruby itself, and extensions do not need to bother with this themselves, but it does not match the expectations of a Gentoo system where each compile action should use the currently defined flags. We also cannot guarantee this compatibility in any case since toolchain packages may have been updated in the meantime. This change uses the current CC, CFLAGS and LDFLAGS, and adds -fPIC which ruby extensions need and which would otherwise be added by ruby. This combination is already used in some ebuilds without any reported issues. Signed-off-by: Hans de Graaff <graaff@gentoo.org> commit f02edc97cad6e965ddf85db2af4b978c732f13ab Author: Hans de Graaff <graaff@gentoo.org> Date: Fri Nov 19 11:01:15 2021 +0100 eclass/ruby-fakegem.eclass: fix CFLAGS and LDFLAGS for extensions Set the CFLAGS and LDFLAGS for extensions using the mkmf options during configuration. This ensures that the flags are correctly set in the Makefile and we don't need to second-guess any further actions of extensions themselves, leading to breakage that is hard to work around. Closes: https://bugs.gentoo.org/823730 Signed-off-by: Hans de Graaff <graaff@gentoo.org> fwiw I haven't seen this kind of problem in a long time