Please see the following threads:
And the following gentoo bug:
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.
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:
for GCC 6:
"-std=c++98 -fno-delete-null-pointer-checks -flifetime-dse=1"
False alarm on GCC 5.x -- I still can't get it to build and run with `-O3'. I'm not sure why.
This is obsolete; icedtea-3.1.0 and icedtea-22.214.171.124 both support GCC 6.
"The OpenJDK developers don't seem to be interested in backporting changes." -- what is this based on, exactly?
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.