icedtea-2.6.1 successfully compiled on gentoo-sparc64-linux

Hinrich chghs at
Sat Aug 29 11:25:44 UTC 2015


I have successfully compiled icedtea-2.6.1 on gentoo-sparc64-linux
(CHOST=sparc64-unknown-linux-gnu). The initial bootstrapping process of
icedtea-1.11.3 has already been done earlier and is described in the
last posts of this thread:

For icedtea-1.11.3 it was possible to use a multilib gentoo/sparc
installation (i.e. 64-bit-kernel + 32-bit userland + 64-bit glibc) and
then compiling the required libraries for icedtea in 64-bit-version as
add-ons. Icedtea7 however has much more library dependencies and it was
not possible for me to build all those packages on a 32-bit host
environment (CHOST=sparc-unknown-linux-gnu).

The only way out for me was to transform a multilib-gentoo-sparc
installation into a native single-lib64-installation, i.e. compile
everything with -m64 option of gcc.

This is a highly experimental procedure and usually discouraged by the
sparc community. But I found that once you have an initial sparc64
system running, the build process for the required libraries is really
easy. The gentoo ebuilds can then be used without any modification and
compiling (emerging) is straightforward with very few exceptions.

All you need to arrive there is a 64-bit-stage3-image for gentoo/sparc64
(which I can prepare on demand) and the usual sparc installation-guide
(plus some minor modifications). This is for those who need a native
64-bit-stack on sparc for running applications with large memory
requirements (e.g. application server, database). The price is some loss
of performance with respect to a 32-bit environment.

Now, what I had to do for building icedtea-2.6.1 with build-jdk
icedtea-1.11.3 for sparc64, is not much:

1. `configure' must know that a "native HotSpot port is available for
this architecture"

$ diff -Naur configure.orig configure
--- configure.orig      2015-08-24 20:31:27.373224829 +0200
+++ configure   2015-08-24 20:32:12.617224818 +0200
@@ -7411,6 +7411,7 @@
     arm64) ;;
     i?86) ;;
     sparc) ;;
+    sparc64) ;;
     x86_64) ;;
     powerpc64) ;;
     powerpc64le) ;;

2. openjdk/hotspot/agent/src/os/linux/libproc.h needs an additional include

$ diff -Naur libproc.h.orig libproc.h
--- libproc.h.orig      2015-08-25 17:57:15.092968890 +0200
+++ libproc.h   2015-08-25 18:07:35.861968742 +0200
@@ -29,6 +29,7 @@
 #include <unistd.h>
 #include <stdint.h>
 #include "proc_service.h"
+#include <asm/ptrace.h>

 #if defined(arm) || defined(ppc)
 #include "libproc_md.h"

That's all. There are some remaining problems in 'make check', required
classes in openjdk/hotspot/test are not compiled and make fail a lot of
tests. I will report this problem in a separate post.

As the host system is a 64-bit-only installation (`gcc -m32` fails) the
resulting j2sdk is 64-bit-only as well, `java -d32` is not supported:

$ uname -a
Linux sirrah 3.18.12-gentoo #1 SMP Fri Aug 7 17:16:46 2015 sparc64 sun4u
TI UltraSparc IIIi (Jalapeno) GNU/Linux

$ java -version
java version "1.7.0_85"
OpenJDK Runtime Environment (IcedTea 2.6.1) (linux-gnu build 1.7.0_85-b01)
OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode)


More information about the distro-pkg-dev mailing list