Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 721970 - dev-java/openjdk-8.252_p09 fails with gcc:10
Summary: dev-java/openjdk-8.252_p09 fails with gcc:10
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-10 04:24 UTC by charles17
Modified: 2020-09-25 07:37 UTC (History)
6 users (show)

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


Attachments
build log (build.log.gz,268.39 KB, application/gzip)
2020-05-10 04:24 UTC, charles17
Details
emerge --info (emerge --info,6.47 KB, text/plain)
2020-05-10 04:26 UTC, charles17
Details
hs_err_pid19927.log (hs_err_pid19927.log,40.47 KB, text/plain)
2020-05-10 11:03 UTC, charles17
Details

Note You need to log in before you can comment on or make changes to this bug.
Description charles17 2020-05-10 04:24:38 UTC
Created attachment 637234 [details]
build log

emerge -pqv '=dev-java/openjdk-8.252_p09::gentoo'
[ebuild   R   ] dev-java/openjdk-8.252_p09  USE="alsa cups jbootstrap pch -debug -doc -examples -headless-awt (-nsplugin) (-selinux) -source (-webstart)"
Comment 1 charles17 2020-05-10 04:26:34 UTC
Created attachment 637236 [details]
emerge --info
Comment 2 Andreas Sturmlechner gentoo-dev 2020-05-10 09:26:59 UTC
Sure this is GCC-10 related?

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f97d5ef7902, pid=19927, tid=0x00007f97956d2700

Please attach /var/tmp/portage/dev-java/openjdk-8.252_p09/work/langtools-jdk8u252-ga/make/hs_err_pid19927.log
Comment 3 Georgy Yakovlev archtester gentoo-dev 2020-05-10 10:38:28 UTC
Yes it may be, some of the new options in gcc-10 produce segfaults at bootstrap. need to filter out a lot of flags, will take a look later.
Comment 4 charles17 2020-05-10 11:03:02 UTC
Created attachment 637504 [details]
hs_err_pid19927.log

(In reply to Andreas Sturmlechner from comment #2)
> Sure this is GCC-10 related?
> 
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> #  SIGSEGV (0xb) at pc=0x00007f97d5ef7902, pid=19927, tid=0x00007f97956d2700
> 
> Please attach
> /var/tmp/portage/dev-java/openjdk-8.252_p09/work/langtools-jdk8u252-ga/make/
> hs_err_pid19927.log
Comment 5 Mike Lothian 2020-05-12 11:02:35 UTC
Might be worth taking a look at what's changed build wise in 11.0.7, as it's building fine with GCC 10.1
Comment 6 Mike Lothian 2020-05-12 11:06:23 UTC
The fix will probably be in here:

https://src.fedoraproject.org/rpms/java-1.8.0-openjdk/commits

Will start testing once my "emerge world" has finished
Comment 8 Mike Lothian 2020-05-12 11:49:22 UTC
I can confirm those two worked for me

I couldn't figure out how to patch hotspot, so did so manually
Comment 9 Xavier Miller (RETIRED) gentoo-dev 2020-05-15 07:50:35 UTC
same problem with icedtea:8. See Bug 723102
Comment 10 Georgy Yakovlev archtester gentoo-dev 2020-05-15 07:53:57 UTC
heh, so it really needs to append all those flags to compile?

-fno-tree-pta -fno-tree-scev-cprop -fno-tree-sink -fno-tree-slp-vectorize -fno-tree-slsr -fno-tree-sra -fno-tree-switch-conversion -fno-tree-tail-merge -fno-tree-ter -fno-tree-vrp -fno-unit-at-a-time -fno-unswitch-loops -fno-vect-cost-model -fno-version-loops-for-strides -fno-tree-coalesce-vars -fno-tree-copy-prop -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-forwprop -fno-tree-fre -fno-tree-loop-distribute-patterns -fno-tree-loop-distribution -fno-tree-loop-vectorize -fno-tree-partial-pre -fno-tree-phiprop -fno-tree-pre

wonderful.

I'll setup a testing chroot and see how it works out.
Comment 11 Holger Hoffstätte 2020-05-18 15:16:34 UTC
(In reply to Georgy Yakovlev from comment #10)
> heh, so it really needs to append all those flags to compile?

You only need -fno-lifetime-dse, which prevents gcc from optimizing away
some UB code. I just built IcedTea-3.16 with it, and both C1 and C2 survive
some tests, incl. Shenandoah. They are fixing the UB code upstream, but in
the meantime this should to the trick.
Comment 12 charles17 2020-05-18 19:13:28 UTC
(In reply to Holger Hoffstätte from comment #11)
> (In reply to Georgy Yakovlev from comment #10)
> > heh, so it really needs to append all those flags to compile?
> 
> You only need -fno-lifetime-dse, which prevents gcc from optimizing away
> some UB code. I just built IcedTea-3.16 with it, and both C1 and C2 survive
> some tests, incl. Shenandoah. They are fixing the UB code upstream, but in
> the meantime this should to the trick.

Indeed, setting openjdk to fno-lifetime-dse in /etc/portage/package.env makes it compile even with gcc-10.1.0
Comment 13 Georgy Yakovlev archtester gentoo-dev 2020-05-19 01:47:13 UTC
Single append seems reasonable. Thanks for testing and confirming it.
Comment 14 Georgy Yakovlev archtester gentoo-dev 2020-05-24 03:36:44 UTC
actually it's 
-fno-delete-null-pointer-checks and -fno-lifetime-dse


build system should have passed those flag for gcc>=6, but 
gcc10 version was mis-identified

proper patch is in 
https://bugs.openjdk.java.net/browse/JDK-8244760
Comment 15 Larry the Git Cow gentoo-dev 2020-05-24 03:52:26 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9465512df55b6c865841953f2d8b5c64550fb7ba

commit 9465512df55b6c865841953f2d8b5c64550fb7ba
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2020-05-24 03:51:32 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2020-05-24 03:51:47 +0000

    dev-java/openjdk: add gcc10 patch to openjdk-8
    
    Bug: https://bugs.gentoo.org/721970
    Package-Manager: Portage-2.3.99, Repoman-2.3.22
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 .../openjdk/files/openjdk-8-detect-gcc10.patch     | 49 ++++++++++++++++++++++
 dev-java/openjdk/openjdk-8.252_p09.ebuild          |  5 +++
 2 files changed, 54 insertions(+)
Comment 16 charles17 2020-05-24 10:04:27 UTC
(In reply to Larry the Git Cow from comment #15)
> The bug has been referenced in the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=9465512df55b6c865841953f2d8b5c64550fb7ba
> [...]

Works. Thanks for fixing