Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 716020 - dev-java/icedtea-3.15.0 fails to compile with gcc-9.[23]
Summary: dev-java/icedtea-3.15.0 fails to compile with gcc-9.[23]
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Andrew John Hughes
Depends on:
Reported: 2020-04-03 11:59 UTC by Helmut Jarausch
Modified: 2021-10-10 03:25 UTC (History)
5 users (show)

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

Output of emerge --info dev-java/icedtea (emerge-info.txt,6.58 KB, text/plain)
2021-10-09 18:32 UTC, Markus Ewald
Contents of /var/tmp/portage/dev-java/icedtea-3.19.0/temp/build.log (build.log.xz,96.23 KB, application/x-xz)
2021-10-09 19:08 UTC, Markus Ewald

Note You need to log in before you can comment on or make changes to this bug.
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
(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
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