Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC

Bug 585868

Summary: dev-java/icedtea-3.0.1 build failure with GCC 6 -- numerous issues.
Product: Gentoo Linux Reporter: Aric Belsito <lluixhi>
Component: Current packagesAssignee: Java team <java>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 582084    

Description Aric Belsito 2016-06-13 21:24:45 UTC
Please see the following threads:
1. http://mail.openjdk.java.net/pipermail/build-dev/2016-March/016767.html
2. http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-February/021734.html

And the following gentoo bug:
3. https://bugs.gentoo.org/show_bug.cgi?id=581186

First of all, dev-java/icedtea-3.0.1 with the CFLAGS="-march=native -O2 -pipe" builds correctly on GCC 5.

dev-java/icedtea-3.0.1 with the CFLAGS="-march=native -pipe" does not build correctly  even with GCC 5 because the configuration script automatically appends `-O3' the the CFLAGS, meaning that icedtea builds with the `-fdelete-null-pointer-checks' flag that causes segmentation faults (See 3) GCC 6 adds -fdelete-null-pointer-checks to the `-O2' optimization level, so it will always segmentation fault unless we unconditionally append `-fno-delete-null-pointer-checks' in CFLAGS until they fix the issue upstream. The OpenJDK developers don't seem to be interested in backporting changes.

Second of all, because dev-java/icedtea-3.0.1 is not compatible with the C++11 standard, we need to pass `-std=c++98' to configure. Interestingly, passing `-std=c++98' in CXXFLAGS is ignored, while it works if passed in CFLAGS only.

Finally, GCC 6 makes dead storage elimination much more aggressive, so instead of passing `-flifetime-dse=1' as GCC 5 does, it passes `-flifetime-dse=2', which also causes segmentation faults.
Comment 1 Aric Belsito 2016-06-13 21:38:48 UTC
One can build dev-java/icedtea with `-O2' or `-O3' with GCC 5 and GCC 6 if we append the C/CXXFLAGS:

What's interesting is that GCC 5 doesn't necessarily need the flag in some cases. Would be nice to have some people verify..

for GCC 5:
"-fno-delete-null-pointer-checks"
for GCC 6:
"-std=c++98 -fno-delete-null-pointer-checks -flifetime-dse=1"
Comment 2 Aric Belsito 2016-06-14 05:06:23 UTC
False alarm on GCC 5.x -- I still can't get it to build and run with `-O3'. I'm not sure why.
Comment 3 Andrew John Hughes 2016-08-24 21:32:57 UTC
This is obsolete; icedtea-3.1.0 and icedtea-7.2.6.7 both support GCC 6.

"The OpenJDK developers don't seem to be interested in backporting changes." -- what is this based on, exactly?
Comment 4 Aric Belsito 2016-08-24 22:52:09 UTC
@Andrew

That was the feeling I got from the 2nd thread I linked in the issue -- sorry if I'm putting words in other people's mouths. :P

Confirming that it is obsolete now. Closing.