pretty much https://bugs.gentoo.org/707330 only with -Oz instead of -Os ... libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/dev-libs/libgcrypt-1.10.1-r3/work/libgcrypt-1.10.1/random -I.. -I../src -I/var/tmp/portage/dev-libs/libgcrypt-1.10.1-r3/work/libgcrypt-1.10.1/src -Os -Oz -march=ivybridge -maes -mavx -mcx16 -mf16c -mfsgsbase -mfxsr -mmmx -mpclmul -mpopcnt -mrdrnd -msahf -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsaveopt --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=4096 -mtune=ivybridge -fvisibility=hidden -fno-delete-null-pointer-checks -Wall -c /var/tmp/portage/dev-libs/libgcrypt-1.10.1-r3/work/libgcrypt-1.10.1/random/random-drbg.c -fPIC -DPIC -o .libs/random-drbg.o libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/dev-libs/libgcrypt-1.10.1-r3/work/libgcrypt-1.10.1/random -I.. -I../src -I/var/tmp/portage/dev-libs/libgcrypt-1.10.1-r3/work/libgcrypt-1.10.1/src -O0 -Oz -march=ivybridge -maes -mavx -mcx16 -mf16c -mfsgsbase -mfxsr -mmmx -mpclmul -mpopcnt -mrdrnd -msahf -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsaveopt --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=4096 -mtune=ivybridge -fvisibility=hidden -fno-delete-null-pointer-checks -Wall -c /var/tmp/portage/dev-libs/libgcrypt-1.10.1-r3/work/libgcrypt-1.10.1/random/rndjent.c -fPIC -DPIC -o .libs/rndjent.o In file included from /var/tmp/portage/dev-libs/libgcrypt-1.10.1-r3/work/libgcrypt-1.10.1/random/rndjent.c:88: /var/tmp/portage/dev-libs/libgcrypt-1.10.1-r3/work/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." | ^~~~~ make[2]: *** [Makefile:780: rndjent.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/var/tmp/portage/dev-libs/libgcrypt-1.10.1-r3/work/libgcrypt-1.10.1-abi_x86_64.amd64/random' make[1]: *** [Makefile:504: all-recursive] Error 1 make[1]: Leaving directory '/var/tmp/portage/dev-libs/libgcrypt-1.10.1-r3/work/libgcrypt-1.10.1-abi_x86_64.amd64' make: *** [Makefile:436: all] Error 2 Reproducible: Always Steps to Reproduce: 1. set CFLAG to include -Oz 2. emerge --ask dev-libs/libgcrypt Actual Results: -Oz is passed to libgcrypt, which fails at jitterentropy.c Expected Results: probably not fail to compile, just -O0 compile that file perhaps this issue was mostly hashed out in https://bugs.gentoo.org/707330 but this one subcase remains an issue and, according to Sam James, "it's something we need to handle upstream." it is possible to work around this by a package-specific env : /etc/portage/env/libgcrypt.conf: CFLAGS=" -O0 " CXXFLAGS=" -O0 " /etc/portage/package.env: dev-libs/libgcrypt libgcrypt.conf
This really needs to be reported/fixed upstream. https://www.gnupg.org/documentation/bts.html We can backport a fix once that has been done.
https://dev.gnupg.org/T6432
Thanks!
fixed in their master for 1.10 https://dev.gnupg.org/T6432 https://dev.gnupg.org/rC7edf1abb9a0d892a80cbf7ab42f64b2720671ee9
> fixed in their master for 1.10 i mean their master not 1.10
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4d457bd94c24853e0f6fe5ad3551f9407edde79 commit c4d457bd94c24853e0f6fe5ad3551f9407edde79 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2023-04-03 14:47:14 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-04-03 14:47:46 +0000 dev-libs/libgcrypt: enable munging of -Oz Closes: https://bugs.gentoo.org/902765 Signed-off-by: Mike Gilbert <floppym@gentoo.org> .../libgcrypt-1.10-build-Allow-build-with-Oz.patch | 50 ++++++++++++++++++++++ dev-libs/libgcrypt/libgcrypt-1.10.1-r3.ebuild | 1 + 2 files changed, 51 insertions(+)