Page MenuHome GnuPG

libgcrypt - flag munging does not account for -Oz
Closed, ResolvedPublic

Description

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

Details

External Link
https://bugs.gentoo.org/902765
Version
1.10.1-r3

Revisions and Commits

Event Timeline

gniibe triaged this task as Normal priority.
gniibe added a subscriber: gniibe.

Thank you for the report.
Fixed in master. Let us consider if it will be backported to 1.10 (or not).

if your'e asking me, i'd suggest just let it be fixed going forward unless someone else complains

gniibe changed the task status from Open to Testing.Apr 4 2023, 6:29 AM

After testing the builds of master for several distributions/gcc/clang, applied to 1.10 branch too.