[core-updates-frozen] icedtea-6 fails to build.

  • Done
  • quality assurance status badge
Details
4 participants
  • Guillaume Le Vaillant
  • Julien Lepiller
  • Ludovic Courtès
  • Marius Bakke
Owner
unassigned
Submitted by
Guillaume Le Vaillant
Severity
normal
G
G
Guillaume Le Vaillant wrote on 13 Sep 2021 15:01
(address . bug-guix@gnu.org)
875yv44o1o.fsf@kitej
I'm trying to get icedtea-6 to build on the core-updates-frozen branch.
I fixed a few C/C++ related issues, but then I get this error:

Toggle snippet (4 lines)
Preload failed: checksum of class list was incorrect.
make: *** [Makefile:2746: stamps/add-archive-ecj.stamp] Error 1

Does someone know how to solve that?

Here's the patch I'm using to get to this point:
From 6767793eccffea3bfddca5c4a0c0cff21abb965b Mon Sep 17 00:00:00 2001
From: Guillaume Le Vaillant <glv@posteo.net>
Date: Mon, 13 Sep 2021 14:37:40 +0200
Subject: [PATCH] WIP: gnu: icedtea-6: Fix build.

* gnu/packages/java.scm (icedtea-6)[arguments]: Add 'fix-openjdk' phase.
---
gnu/packages/java.scm | 14 ++++++++++++++
1 file changed, 14 insertions(+)

Toggle diff (34 lines)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 51fc5c60a1..374a9d9cba 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2021 Vincent Legoll <vincent.legoll@gmail.com>
;;; Copyright © 2021 Mike Gerwitz <mtg@gnu.org>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -907,6 +908,19 @@ machine.")))
"patches/hotspot/hs23/drop_unlicensed_test.patch")
(("#!/bin/sh") (string-append "#!" (which "sh"))))
#t))
+ (add-after 'unpack 'fix-openjdk
+ (lambda _
+ (substitute* "openjdk/jdk/make/common/Defs-linux.gmk"
+ (("CFLAGS_COMMON = -fno-strict-aliasing" all)
+ (string-append all " -fcommon")))
+ (substitute* "openjdk/hotspot/src/share/vm/code/relocInfo.hpp"
+ (("inline friend relocInfo prefix_relocInfo\\(int datalen = 0\\);")
+ "inline friend relocInfo prefix_relocInfo(int datalen);"))
+ (substitute*
+ '("openjdk/jdk/src/solaris/native/java/net/PlainSocketImpl.c"
+ "openjdk/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
+ (("#include <sys/sysctl.h>")
+ "#include <linux/sysctl.h>"))))
(add-after 'unpack 'patch-paths
(lambda* (#:key inputs #:allow-other-keys)
;; buildtree.make generates shell scripts, so we need to replace
--
2.33.0
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYT9OQw8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j+RKgD+Kkaqbscix9kOL6bYAQRR59EGM0pk+lRwFocX
fnpkzQ8A/32WecIGImGvhCJlrnKKuvGT0WGPgkqeckEkyOfIFpI6
=NbF3
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 14 Sep 2021 10:44
(name . Guillaume Le Vaillant)(address . glv@posteo.net)
87ilz37di5.fsf@gnu.org
Hi Guillaume,

Guillaume Le Vaillant <glv@posteo.net> skribis:

Toggle quote (3 lines)
> I'm trying to get icedtea-6 to build on the core-updates-frozen branch.
> I fixed a few C/C++ related issues,

Thanks for fixing those! After https://issues.guix.gnu.org/49990#10
Julien mentioned on IRC that using an older GCC allowed us to work
around those C++ issues, but your approach looks nicer to me.

Toggle quote (5 lines)
> but then I get this error:
>
> Preload failed: checksum of class list was incorrect.
> make: *** [Makefile:2746: stamps/add-archive-ecj.stamp] Error 1

Woow, never seen that. Julien, Ricardo, does that ring a bell?

Java is the main stumbling block on core-updates-frozen; making
progress!

Thanks,
Ludo’.
G
G
Guillaume Le Vaillant wrote on 14 Sep 2021 18:25
(name . Ludovic Courtès)(address . ludo@gnu.org)
87fsu7glxn.fsf@kitej
Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (24 lines)
> Hi Guillaume,
>
> Guillaume Le Vaillant <glv@posteo.net> skribis:
>
>> I'm trying to get icedtea-6 to build on the core-updates-frozen branch.
>> I fixed a few C/C++ related issues,
>
> Thanks for fixing those! After <https://issues.guix.gnu.org/49990#10>
> Julien mentioned on IRC that using an older GCC allowed us to work
> around those C++ issues, but your approach looks nicer to me.
>
>> but then I get this error:
>>
>> Preload failed: checksum of class list was incorrect.
>> make: *** [Makefile:2746: stamps/add-archive-ecj.stamp] Error 1
>
> Woow, never seen that. Julien, Ricardo, does that ring a bell?
>
> Java is the main stumbling block on core-updates-frozen; making
> progress!
>
> Thanks,
> Ludo’.

It looks like the checksum failure is caused by the miscompilation of
a multiplication in the function computing the checksum.
I added a workaround to the other fixes in
f8cff361245cc0c546211ff51100cbaf869d15eb, which makes the build succeed.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYUDN9A8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j/0KgD/eRpr/znxl6I4IndNQHYkcjuUN2a5pH/1G/HI
35rhIvMA/iUHgwQpECcWxX1I+pvmit04xB7I/EMfLFlDu2lT9+5l
=CL+0
-----END PGP SIGNATURE-----

Closed
J
J
Julien Lepiller wrote on 13 Sep 2021 16:32
08D141F0-26AD-4987-82E6-19C03664F3E3@lepiller.eu
I had the same issue on my previous attempt. It seems that using gcc-7 as an input fixes the issue (although when I tried, I had other fixes like yours too). Our gcc on core-updates seems to be too aggressive with this old code base.

Le 13 septembre 2021 09:01:55 GMT-04:00, Guillaume Le Vaillant <glv@posteo.net> a écrit :
Toggle quote (11 lines)
>I'm trying to get icedtea-6 to build on the core-updates-frozen branch.
>I fixed a few C/C++ related issues, but then I get this error:
>
>--8<---------------cut here---------------start------------->8---
>Preload failed: checksum of class list was incorrect.
>make: *** [Makefile:2746: stamps/add-archive-ecj.stamp] Error 1
>--8<---------------cut here---------------end--------------->8---
>
>Does someone know how to solve that?
>
>Here's the patch I'm using to get to this point:
Attachment: file
J
J
Julien Lepiller wrote on 14 Sep 2021 13:37
(address . 50567@debbugs.gnu.org)
28D6969F-40B2-442F-916C-DB19ACF87AD1@lepiller.eu
Again this is exactly where I was blocked. There is a checksum being generated in classlist files from java code during the build. The classlist file is exactly the same as the one in master, so it's correctly generated. Fowever, at some point, the process needs toqload that file, and that ultimately calls some C code (identical to the java code) that re-computes and compares the checksum. After printing some values, it seems that it always computes "0…031" as the hash of any classlist file, despite running the function and taking everything into account. I think this is again an optimization issue, anl it's not clear how to work around that.

Le 14 septembre 2021 04:44:18 GMT-04:00, "Ludovic Courtès" <ludo@gnu.org> a écrit :
Toggle quote (23 lines)
>Hi Guillaume,
>
>Guillaume Le Vaillant <glv@posteo.net> skribis:
>
>> I'm trying to get icedtea-6 to build on the core-updates-frozen branch.
>> I fixed a few C/C++ related issues,
>
>Thanks for fixing those! After <https://issues.guix.gnu.org/49990#10>
>Julien mentioned on IRC that using an older GCC allowed us to work
>around those C++ issues, but your approach looks nicer to me.
>
>> but then I get this error:
>>
>> Preload failed: checksum of class list was incorrect.
>> make: *** [Makefile:2746: stamps/add-archive-ecj.stamp] Error 1
>
>Woow, never seen that. Julien, Ricardo, does that ring a bell?
>
>Java is the main stumbling block on core-updates-frozen; making
>progress!
>
>Thanks,
>Ludo’.
Attachment: file
J
J
Julien Lepiller wrote on 15 Sep 2021 22:11
(address . 50567@debbugs.gnu.org)
BEA5C999-D57A-4A84-BB72-05B7F310BE8C@lepiller.eu
Sorry for the possible confusion. These replies stacked up in my client and I didn't notice until they were sent just now. Please disregard :)

Le 14 septembre 2021 07:37:53 GMT-04:00, Julien Lepiller <julien@lepiller.eu> a écrit :
Toggle quote (26 lines)
>Again this is exactly where I was blocked. There is a checksum being generated in classlist files from java code during the build. The classlist file is exactly the same as the one in master, so it's correctly generated. Fowever, at some point, the process needs toqload that file, and that ultimately calls some C code (identical to the java code) that re-computes and compares the checksum. After printing some values, it seems that it always computes "0…031" as the hash of any classlist file, despite running the function and taking everything into account. I think this is again an optimization issue, anl it's not clear how to work around that.
>
>Le 14 septembre 2021 04:44:18 GMT-04:00, "Ludovic Courtès" <ludo@gnu.org> a écrit :
>>Hi Guillaume,
>>
>>Guillaume Le Vaillant <glv@posteo.net> skribis:
>>
>>> I'm trying to get icedtea-6 to build on the core-updates-frozen branch.
>>> I fixed a few C/C++ related issues,
>>
>>Thanks for fixing those! After <https://issues.guix.gnu.org/49990#10>
>>Julien mentioned on IRC that using an older GCC allowed us to work
>>around those C++ issues, but your approach looks nicer to me.
>>
>>> but then I get this error:
>>>
>>> Preload failed: checksum of class list was incorrect.
>>> make: *** [Makefile:2746: stamps/add-archive-ecj.stamp] Error 1
>>
>>Woow, never seen that. Julien, Ricardo, does that ring a bell?
>>
>>Java is the main stumbling block on core-updates-frozen; making
>>progress!
>>
>>Thanks,
>>Ludo’.
Attachment: file
M
M
Marius Bakke wrote on 13 Sep 2022 15:27
Unarchive
(address . control@debbugs.gnu.org)
87h71bz9o5.fsf@gnu.org
unarchive 50567
thanks
M
M
Marius Bakke wrote on 13 Sep 2022 15:49
Re: bug#50567: [core-updates-frozen] icedtea-6 fails to build.
(address . 50567@debbugs.gnu.org)
87edwfz8n8.fsf@gnu.org
Julien Lepiller <julien@lepiller.eu> skriver:

Toggle quote (2 lines)
> Again this is exactly where I was blocked. There is a checksum being generated in classlist files from java code during the build. The classlist file is exactly the same as the one in master, so it's correctly generated. Fowever, at some point, the process needs toqload that file, and that ultimately calls some C code (identical to the java code) that re-computes and compares the checksum. After printing some values, it seems that it always computes "0…031" as the hash of any classlist file, despite running the function and taking everything into account. I think this is again an optimization issue, anl it's not clear how to work around that.

For the record, this showed up again after switching to GCC 11. I ended
up disabling optimizations for dump.cpp in 321e866b1cea4916e3568efb
instead of trying to fool the compiler.

Probably it would be better to figure out exactly which optimization
causes this problem, but that's a journey for a different time.
-----BEGIN PGP SIGNATURE-----

iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCYyCKew8cbWFyaXVzQGdu
dS5vcmcACgkQ6HGLpZEUEHfsQgEA6TSVPpzEjLy2+jBJp5FWTPQktJWo19TNGK5f
yfa6kEsA/RgXWdh3eKOui1VSxpew5nV1GGMS/gEUj0eTWpTnGOME
=Fa/K
-----END PGP SIGNATURE-----

?