Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 902765 - dev-libs/libgcrypt-1.10.1-r3 - flag munging does not account for -Oz
Summary: dev-libs/libgcrypt-1.10.1-r3 - flag munging does not account for -Oz
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor
Assignee: Gentoo's Team for Core System packages
URL: https://dev.gnupg.org/T6432
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-22 21:38 UTC by Jeff Cliff
Modified: 2024-06-24 01:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Cliff 2023-03-22 21:38:04 UTC
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
Comment 1 Mike Gilbert gentoo-dev 2023-03-28 16:14:21 UTC
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.
Comment 2 Jeff Cliff 2023-03-29 13:45:44 UTC
https://dev.gnupg.org/T6432
Comment 3 Mike Gilbert gentoo-dev 2023-03-29 14:38:48 UTC
Thanks!
Comment 4 Jeff Cliff 2023-04-03 05:05:12 UTC
fixed in their master for 1.10  https://dev.gnupg.org/T6432 https://dev.gnupg.org/rC7edf1abb9a0d892a80cbf7ab42f64b2720671ee9
Comment 5 Jeff Cliff 2023-04-03 05:07:07 UTC
> fixed in their master for 1.10  

i mean their master not 1.10
Comment 6 Larry the Git Cow gentoo-dev 2023-04-03 14:51:11 UTC
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(+)