operating system: gentoo stable(?) amd64 gnu/linux
in the past, when compiling libgcrypt ( https://bugs.gentoo.org/707330 ) there was a problem where if compiler optimization flags were used ( -O2 -Os -Oz -O3 etc etc), at a certain point ( compiling libgcrypt-${VERSION}/random/rndjent.c ) compilation would fail due to
libgcrypt-1.10.1/random/jitterentropy-base.c:58:3: error: #error "The CPU Jitter random number generator must not be compiled with optimizations. See documentation. Use the compiler switch -O0 for compiling jitterentropy.c."
58 | #error "The CPU Jitter random number generator must not be compiled with optimizations. See documentation. Use the compiler switch -O0 for compiling jitterentropy.c."
this was remedied for most compiler optimization flags ( especially -O2 -Os ) through a flag munging script according to the gentoo bug on the matter (?). Unfortunately this script does not take into account -Oz which is a valid compiler optimization flag for modern versions of gcc (>12) and, apparently, clang.
In bug 902765, gentoo developers are suggesting that the fix would be on the gnugpg side, where this munging script may live