Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 716020

Summary: dev-java/icedtea-3.15.0 fails to compile with gcc-9.[23]
Product: Gentoo Linux Reporter: Helmut Jarausch <jarausch>
Component: Current packagesAssignee: Andrew John Hughes <gnu_andrew>
Status: UNCONFIRMED ---    
Severity: normal CC: gyakovlev, java, jstein, proxy-maint, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Output of emerge --info dev-java/icedtea
Contents of /var/tmp/portage/dev-java/icedtea-3.19.0/temp/build.log

Description Helmut Jarausch 2020-04-03 11:59:00 UTC
I get the error messages:

/var/tmp/Big_Tmp/portage/dev-java/icedtea-3.15.0/work/icedtea-3.15.0/openjdk-boot/jdk/src/share/native/com/sun/java/util/jar/pack/constants.h:226:37: error: left operand of shift expression '(-1 << 13)' is negative [-fpermissive]
  226 |     AO_UNUSED_MBZ             = (-1)<<13, // options bits reserved for future use.
      |                                 ~~~~^~~~
/var/tmp/Big_Tmp/portage/dev-java/icedtea-3.15.0/work/icedtea-3.15.0/openjdk-boot/jdk/src/share/native/com/sun/java/util/jar/pack/constants.h:226:39: error: enumerator value for 'AO_UNUSED_MBZ' is not an integer constant
  226 |     AO_UNUSED_MBZ             = (-1)<<13, // options bits reserved for future use.

A fix would be to replace
(-1) << 13
by
(unsigned int)(-1) << 13

but this file doesn't exist after ebuild .. unpack.

My current workaround is to my the change after compilation has failed and
resume compile with  ebuild ... merge
Comment 1 Jonas Stein gentoo-dev 2020-04-03 21:46:31 UTC
Thank you for the report. We need to have all information at hand before ticket assignment. That is why I ask you to 
* attach the logs and 
* paste the emerge info 
as described on 
https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
Comment 2 Markus Ewald 2021-10-09 17:53:47 UTC
I've been getting this error, too, and for a long time. It's still present in dev-java/icedtea-3.19.0.

It happens with GCC 9.x and GCC 10.x and with near certainty all future versions of GCC as well.

In /var/tmp/Big_Tmp/portage/dev-java/icedtea-3.15.0/work/icedtea-3.15.0/openjdk-boot/jdk/src/share/native/com/sun/java/util/jar/pack/constants.h at line 226, a constant for unused bits is declared by left-shifting a negative number:

    AO_UNUSED_MBZ = (-1)<<13,

It can be fixed by starting the emerge and ninja'ing the following change in place in the affected line after the source has been unpacked:

    AO_UNUSED_MBZ = static_cast<unsigned int>(-1)<<13,

As far as I can tell, the error is independent of any use flags or such and should happen to anyone running GCC 9.x or newer and emerge the icedtea package (rather than the icedtea-bin package or oracle java instead, which I suspect are the more popular choices).

I'll attach my build info and logs in a moment.
Comment 3 Markus Ewald 2021-10-09 18:32:19 UTC
Created attachment 744159 [details]
Output of emerge --info dev-java/icedtea
Comment 4 Markus Ewald 2021-10-09 19:08:41 UTC
Created attachment 744162 [details]
Contents of /var/tmp/portage/dev-java/icedtea-3.19.0/temp/build.log