Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Oct 2015 16:14:29 -0400
From:      "Curtis Hamilton" <hamiltcl@verizon.net>
To:        "'Justin Hibbits'" <jrh29@alumni.cwru.edu>
Cc:        "'FreeBSD PowerPC ML'" <freebsd-ppc@freebsd.org>
Subject:   RE: OpenJDK for PowerPC64
Message-ID:  <003701d1102a$ee366c70$caa34550$@verizon.net>
In-Reply-To: <CAHSQbTAurUob%2B5ypH%2BG5_2V8dh-iGWpxobGe-EzPHBXF-ptDfg@mail.gmail.com>
References:  <002a01d11001$a4b126e0$ee1374a0$@verizon.net> <CAHSQbTAurUob%2B5ypH%2BG5_2V8dh-iGWpxobGe-EzPHBXF-ptDfg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multipart message in MIME format.

------=_NextPart_000_0038_01D11009.672FC8F0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

I don't have a wiki page.  My initial success was in building the mercurial
OpenJDK7 BSD-Port, using the attached build script and instructions obtained
from the OpenJDK Wiki Darwin9Build
(https://wiki.openjdk.java.net/display/BSDPort/Darwin9Build) section.
Subsequently, I used information from the arm patch to modify the ports
Makefile and build the ports distribution.  Other than what's in the make
file patch, no other patches were needed, as I used the mercurial build as
the bootstrap.

The key for non-x86 builds is the bootstrap.  I used the GCC java tools and
created a bootstrap (/usr/local/bootstrap-openjdk) using sym links to the
GCC java executables in /usr/local/bin.   I can provide more details if
needed, however, building GCC java was not as straight forward as it is not
a configurable option for non-x86 GCC builds.  I had to modify the port
Makefile.

Regards,

Curtis


-----Original Message-----
From: chmeeedalf@gmail.com [mailto:chmeeedalf@gmail.com] On Behalf Of Justin
Hibbits
Sent: Monday, October 26, 2015 3:26 PM
To: Curtis Hamilton <hamiltcl@verizon.net>
Cc: FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject: Re: OpenJDK for PowerPC64

On Mon, Oct 26, 2015 at 10:19 AM, Curtis Hamilton <hamiltcl@verizon.net>
wrote:
> Here is my contribution to all those interested in keeping the PowerPC 
> relevant.  I've been successful in building OpenJDK7 using Zero VM for 
> PPC64.  The binaries for openjdk7 for powerpc64 can be found at the 
> below
> URL:
>
> https://drive.google.com/folderview?id=0Bz7VO-WP3rlpM3BabUd6ejlya3c&us
> p=shar
> ing
>
> Give them a try and provide any feedback to the list.
>
> Enjoy!
>
> BTW: OpenJDK8 may soon be on the way!

That's fantastic!  I'll try this soon on my G5.  Do you have any wiki page
with build steps, or even better a port change to add this to ports?

- Justin

------=_NextPart_000_0038_01D11009.672FC8F0
Content-Type: application/octet-stream;
	name="openjdk7_non-x86.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="openjdk7_non-x86.patch"

--- ./Makefile=0A=
+++ ./Makefile=0A=
@@ -78,11 +78,12 @@=0A=
 =0A=
 DOS2UNIX_FILES=3D	=
jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/x=
mlsecurity_en.properties=0A=
 =0A=
-OPENJDK_OSARCH=3D	bsd-${ARCH:S/i386/i586/}=0A=
+OPENJDK_OSARCH=3D	=
bsd-${ARCH:S/i386/x86/:S/amd64/x86_64/:S/armv6/arm/:S/powerpc64/powerpc/}=0A=
 =0A=
 NOPRECIOUSMAKEVARS=3D	yes=0A=
 =0A=
-ONLY_FOR_ARCHS=3D	i386 amd64=0A=
+ONLY_FOR_ARCHS=3D	i386 amd64 armv6 powerpc64=0A=
 =0A=
 _MAKE_JOBS=3D	#=0A=
 MAKE_ENV+=3D	LANG=3D"C" \=0A=
@@ -116,6 +117,23 @@=0A=
 =0A=
 MAKE_ENV+=3D	HOTSPOT_BUILD_JOBS=3D${MAKE_JOBS_NUMBER}=0A=
=0A=
 .include <bsd.port.options.mk>=0A=
=0A=
+.if ${ARCH} =3D=3D "armv6"=0A=
+CONFIGURE_ARGS+=3D	--with-jvm-variants=3Dzero=0A=
+=0A=
+# we're building a zero build=0A=
+JDK_BUILDDIR=3D	=
${WRKSRC}/build/${OPENJDK_OSARCH}-normal-zero-${JDK_BUILD_TYPE}=0A=
+=0A=
+# bootstrap-openjdk is based on openjdk7 and can compile openjdk8=0A=
+BOOTSTRAP_JDKS=3D		${LOCALBASE}/bootstrap-openjdk=0A=
+BOOTSTRAPJDKDIR=3D	${LOCALBASE}/bootstrap-openjdk=0A=
+=0A=
+# libffi is needed for zerobuild=0A=
+BUILD_DEPENDS+=3D =
${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/bootstrap-openjdk=0A=
+LIB_DEPENDS+=3D	libffi.so:${PORTSDIR}/devel/libffi=0A=
+.endif=0A=
+=0A=
+.if ${ARCH} =3D=3D "powerpc64"=0A=
+CONFIGURE_ARGS+=3D	--with-jvm-variants=3Dzero=0A=
+=0A=
+# libffi is needed for zerobuild=0A=
+BUILD_DEPENDS+=3D =
${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/bootstrap-openjdk=0A=
+LIB_DEPENDS+=3D	libffi.so:${PORTSDIR}/devel/libffi=0A=
+=0A=
+MAKE_ENV+=3D	ZERO_BUILD=3Dtrue \=0A=
+			ZERO_ENDIANNESS=3Dbig \=0A=
+			ZERO_LIBARCH=3Dppc \=0A=
+			ZERO_ARCHDEF=3DPPC \=0A=
+			ZERO_ARCHFLAG=3D"-mpowerpc64" \=0A=
+			PARALLEL_COMPILE_JOBS=3D8 =0A=
+=0A=
+.endif=0A=
+=0A=
 BOOTSTRAP_JDKS=3D	${LOCALBASE}/openjdk7 \=0A=
 		${LOCALBASE}/openjdk6 \=0A=
 		${LOCALBASE}/bootstrap-openjdk=0A=
@@ -143,7 +161,7 @@=0A=
 =0A=
 # GCC is broken with PCH: =
https://lists.freebsd.org/pipermail/svn-src-all/2015-March/101722.html=0A=
 .if ${COMPILER_TYPE} =3D=3D gcc=0A=
-MAKE_ENV+=3D	USE_PRECOMPILED_HEADER=3D0=0A=
+MAKE_ENV+=3D	USE_PRECOMPILED_HEADER=3D1=0A=
 .endif=0A=
 =0A=
 .if empty(ICONV_LIB)=0A=
@@ -160,6 +178,34 @@=0A=
 		${WRKSRC}/jdk/make/sun/splashscreen/Makefile \=0A=
 		${WRKSRC}/jdk/make/java/npt/Makefile \=0A=
 		${WRKSRC}/jdk/make/java/instrument/Makefile=0A=
+.endif=0A=
+=0A=
+.if ${ARCH} =3D=3D "armv6" || "powerpc64"=0A=
+	# From NetBSD =
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/openjdk7/hacks.mk=0A=
+	# Workaround incorrect constant folding of subnormals in javac when =
the FPU=0A=
+	# does not handle subnormal arithmetic, like on powerpc in =
Flush-to-zero mode.=0A=
+	# These workarounds avoid underflow conditions during the bootstrap so =
the=0A=
+	# JDK can correctly build itself. Compiling or running programs other =
than=0A=
+	# openjdk itself on such hardware may still cause unexpected behaviour.=0A=
+	#=0A=
+	@${REINPLACE_CMD} -e =
's|2.2250738585072014e-308d*|Double.longBitsToDouble(0x10000000000000L)|i=
g' \=0A=
+		-e 's|0x1.0p-1022d*|Double.longBitsToDouble(0x10000000000000L)|ig' \=0A=
+		-e 's|4.9e-324d*|Double.longBitsToDouble(0x1L)|ig' \=0A=
+		-e 's|0x0.0000000000001p-1022d*|Double.longBitsToDouble(0x1L)|ig' \=0A=
+		${WRKSRC}/jdk/src/share/classes/sun/misc/DoubleConsts.java \=0A=
+		${WRKSRC}/jdk/src/share/classes/java/lang/Double.java=0A=
+	@${REINPLACE_CMD} -e =
's|1.17549435e-38f*|Float.intBitsToFloat(0x800000)|ig' \=0A=
+		-e 's|0x1.0p-126f*|Float.intBitsToFloat(0x800000)|ig' \=0A=
+		-e 's|1.4e-45f*|Float.intBitsToFloat(0x1)|ig' \=0A=
+		-e 's|0x0.000002P-126f*|Float.intBitsToFloat(0x1)|ig' \=0A=
+		${WRKSRC}/jdk/src/share/classes/sun/misc/FloatConsts.java \=0A=
+		${WRKSRC}/jdk/src/share/classes/java/lang/Float.java=0A=
+	@${REINPLACE_CMD} -e 's|n.floatValue() =3D=3D 0.0f && =
!isZero(proper)|& \&\& Float.floatToIntBits(n) !=3D 0x1|' \=0A=
+		-e 's|n.doubleValue() =3D=3D 0.0d && !isZero(proper)|& \&\& =
Double.doubleToLongBits(n) !=3D 0x1L|' \=0A=
+		=
${WRKSRC}/langtools/src/share/classes/com/sun/tools/javac/parser/JavacPar=
ser.java=0A=
+	@${REINPLACE_CMD} -e 's|x =3D=3D 0.0f && 1.0f / x > =
0.0f|Float.floatToIntBits(x) =3D=3D 0x0|g' \=0A=
+		-e 's|x =3D=3D 0.0d && 1.0d / x > 0.0d|Double.doubleToLongBits(x) =
=3D=3D 0x0L|g' \=0A=
+		=
${WRKSRC}/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java=0A=
 .endif=0A=
 =0A=
 .if ${PORT_OPTIONS:MTZUPDATE}=0A=

------=_NextPart_000_0038_01D11009.672FC8F0
Content-Type: application/octet-stream;
	name="build_script.sh"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="build_script.sh"

#!/bin/sh=0A=
cd /usr/ports/tmp/bsd-port=0A=
time env -i \=0A=
 PATH=3D/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin \=0A=
 LANG=3DC \=0A=
 gmake \=0A=
 CC=3Dgcc48 \=0A=
 CXX=3Dg++48 \=0A=
 ALLOW_DOWNLOADS=3Dtrue \=0A=
 ALT_JAVA_HOME=3D/usr/local/bootstrap-openjdk \=0A=
 ALT_BOOTDIR=3D/usr/local/bootstrap-openjdk \=0A=
 ALT_JDK_IMPORT_PATH=3D/usr/local/bootstrap-openjdk \=0A=
 ALT_FREETYPE_HEADERS_PATH=3D/usr/local/include \=0A=
 ALT_FREETYPE_LIB_PATH=3D/usr/local/lib \=0A=
 =
ALT_CACERTS_FILE=3D/usr/local/bootstrap-openjdk/jre/lib/security/cacerts =
\=0A=
 LIBFFI_CFLAGS=3D"-I/usr/local/lib/libffi-3.2.1/include" \=0A=
 DEFAULT_LIBPATH=3D"/lib:/usr/lib:/usr/local/lib" \=0A=
 NO_DOCS=3Dtrue \=0A=
 ZERO_BUILD=3Dtrue \=0A=
 ZERO_ENDIANNESS=3Dbig \=0A=
 ZERO_LIBARCH=3Dppc \=0A=
 ZERO_ARCHDEF=3DPPC \=0A=
 ZERO_ARCHFLAG=3D"-mpowerpc64" \=0A=
 PARALLEL_COMPILE_JOBS=3D8 \=0A=
 HOTSPOT_BUILD_JOBS=3D8 =0A=

------=_NextPart_000_0038_01D11009.672FC8F0--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003701d1102a$ee366c70$caa34550$>