See https://bugs.gentoo.org/447970 for extra details. While this gentoo report has a workaround posted just a few months ago, it seems that the test itself is faulty, as a failure mode should not be to hang the entire computer.
When running this configure test on my particular system, a NAS running busybox and btrfs, it hung for at least 12 hours before I decided to power cycle it. While hung, the system is mostly unresponsive. Pings work, for instance, but no new processes can start, and the RCU kernel thread spins its core at 100%. The test states that it is needed for old glibc and kernel versions. My NAS is using glibc 2.27 and kernel 5.13, so presumably it is no longer a useful test. Can this be modified to be less destructive? I mention btrfs, because that gentoo link highlights that the test is particularly troublesome on that file system. I mention busybox, because when I inspect the leftover directory structure after rebooting, I find that the busybox shell cannot handle the path length, with tab completion eventually failing. In my case, I hit this while configuring m4 version 1.4.19, which uses the latest (serial 25) version of this file.