From bruno.kremel at gmail.com Wed Mar 29 19:42:48 2017 From: bruno.kremel at gmail.com (Bruno Kremel) Date: Wed, 29 Mar 2017 21:42:48 +0200 Subject: Cross compiling openjdk9, problem with HotSpot assembly code Message-ID: <878tnnna3b.fsf@bruno-dell> Hi All, I am trying to compile Openjdk 9 (HG tag changeset 162) and I do following: ./configure --with-jvm-interpreter=cpp --with-jvm-variants=zero \ --enable-openjdk-only \ --with-freetype-include=~/linux/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/freetype2\ --with-freetype-lib=~/linux/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib \ --with-freetype=~/linux/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/\ --with-debug-level=release \ --openjdk-target=arm-buildroot-linux-gnueabi \ --with-sys-root=~/linux/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot\ --with-tools-dir=~/linux/buildroot/output/host --disable-freetype-bundling\ --enable-unlimited-crypto\ --enable-headless-only\ --disable-warnings-as-errors\ OBJCOPY=~/linux/buildroot/output/host/usr/bin/arm-linux-gnueabi-objcopy\ STRIP=~/linux/buildroot/output/host/usr/bin/arm-linux-gnueabi-strip\ CPP_FLAGS=-lstdc++ CXX_FLAGS=-lstdc++\ CPP=~/linux/buildroot/output/host/usr/bin/arm-linux-gnueabi-cpp\ CXX=~/linux/buildroot/output/host/usr/bin/arm-linux-gnueabi-g++\ CC=~/linux/buildroot/output/host/usr/bin/arm-linux-gnueabi-gcc\ LD=~/linux/buildroot/output/host/usr/bin/arm-linux-gnueabi-gcc After the successful configure I get following summary: Configuration summary: * Debug level: release * HS debug level: product * JDK variant: normal * JVM variants: zero * OpenJDK target: OS: linux, CPU architecture: arm, address length: 32 * Version string: 9-internal+0-adhoc.bruno.openjdk-jdk-9162 (9-internal) Tools summary: * Boot JDK: openjdk version "1.8.0_121" OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13) OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode) (at /usr/lib/jvm/java-8-openjdk-amd64) * Toolchain: gcc (GNU Compiler Collection) * C Compiler: Version 5.2.1 (at /home/bruno/linux/buildroot/output/host/usr/bin/arm-linux-gnueabi-gcc) * C++ Compiler: Version 5.2.1 (at /home/bruno/linux/buildroot/output/host/usr/bin/arm-linux-gnueabi-g++) Build performance summary: * Cores to use: 8 * Memory limit: 15773 MB All seems fine... But the make fails on some hotspot assembly code: /home/bruno/linux/buildroot/output/build/openjdk-jdk-9+162/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp:1530:8: error: 'void MacroAssembler::movptr(Address, int32_t)' cannot be overloaded void movptr(Address dst, int32_t imm32); ^ /home/bruno/linux/buildroot/output/build/openjdk-jdk-9+162/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp:1513:8: error: with 'void MacroAssembler::movptr(Address, intptr_t)' void movptr(Address dst, intptr_t src); ^ /home/bruno/linux/buildroot/output/build/openjdk-jdk-9+162/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp:1531:8: error: 'void MacroAssembler::movptr(Register, int32_t)' cannot be overloaded void movptr(Register dst, int32_t imm32); ^ /home/bruno/linux/buildroot/output/build/openjdk-jdk-9+162/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp:1511:8: error: with 'void MacroAssembler::movptr(Register, intptr_t)' void movptr(Register dst, intptr_t src); It seems that it tries to compile some x86_64 assembly code which does not make sense when clearly configure states that I have the ARM target. The other thing I don't understand why does it even compile hotspot code? I have asked for zero interpreter AND openjdk only, I actually don't want to use HotSpot I intend to use JamVM with OpenJDK classpath. Do you have any suggestions. Thanks Bruno Kremel From akashche at redhat.com Wed Mar 29 21:43:02 2017 From: akashche at redhat.com (Alex Kashchenko) Date: Wed, 29 Mar 2017 22:43:02 +0100 Subject: Cross compiling openjdk9, problem with HotSpot assembly code In-Reply-To: <878tnnna3b.fsf@bruno-dell> References: <878tnnna3b.fsf@bruno-dell> Message-ID: <32a17f08-411f-7859-00a5-e25297ea0b80@redhat.com> Hi Bruno, On 03/29/2017 08:42 PM, Bruno Kremel wrote: > Hi All, > > I am trying to compile Openjdk 9 (HG tag changeset 162) and I do > following: > ./configure --with-jvm-interpreter=cpp --with-jvm-variants=zero \ > > [...] > > It seems that it tries to compile some x86_64 assembly code which does > not make sense when clearly configure states that I have the ARM target. > > The other thing I don't understand why does it even compile hotspot > code? I have asked for zero interpreter AND openjdk only, I actually > don't want to use HotSpot I intend to use JamVM with OpenJDK classpath. > > Do you have any suggestions. jdk9 build system tries to build a native "build jdk" (to not be confused with "boot jdk") first and then uses it during the cross-build. If you cross compiler has correct prefix (arm-linux-gnueabihf, aarch64-linux-gnu etc) and default compiler is a native one - that should work out of the box. Alternatively you can build native x86_64 jdk9 from the same hg revision manually and specify it with "--with-build-jdk" switch. Also AFAIK Zero port is currently not functional in jdk9, though you can build a full ARM32 VM (server/client/minimal) instead using "--openjdk-target=arm-linux-gnueabihf" and "--with-abi-profile=arm-vfp-hflt" switches. -- -Alex From bruno.kremel at gmail.com Wed Mar 29 22:14:32 2017 From: bruno.kremel at gmail.com (Bruno Kremel) Date: Thu, 30 Mar 2017 00:14:32 +0200 Subject: Cross compiling openjdk9, problem with HotSpot assembly code In-Reply-To: <32a17f08-411f-7859-00a5-e25297ea0b80@redhat.com> References: <878tnnna3b.fsf@bruno-dell> <32a17f08-411f-7859-00a5-e25297ea0b80@redhat.com> Message-ID: <874lybn31z.fsf@bruno-dell> Hi Alex, Just a quick question. Does the toolchain have to be hardfloat? Currently I use arm-linux-gnueabi (not hf, it's linaro toolchain). Thanks Bruno Alex Kashchenko writes: > Hi Bruno, > > On 03/29/2017 08:42 PM, Bruno Kremel wrote: >> Hi All, >> >> I am trying to compile Openjdk 9 (HG tag changeset 162) and I do >> following: >> ./configure --with-jvm-interpreter=cpp --with-jvm-variants=zero \ >> >> [...] >> >> It seems that it tries to compile some x86_64 assembly code which does >> not make sense when clearly configure states that I have the ARM target. >> >> The other thing I don't understand why does it even compile hotspot >> code? I have asked for zero interpreter AND openjdk only, I actually >> don't want to use HotSpot I intend to use JamVM with OpenJDK classpath. >> >> Do you have any suggestions. > > jdk9 build system tries to build a native "build jdk" (to not be > confused with "boot jdk") first and then uses it during the cross-build. > If you cross compiler has correct prefix (arm-linux-gnueabihf, > aarch64-linux-gnu etc) and default compiler is a native one - that > should work out of the box. Alternatively you can build native x86_64 > jdk9 from the same hg revision manually and specify it with > "--with-build-jdk" switch. > > Also AFAIK Zero port is currently not functional in jdk9, though you can > build a full ARM32 VM (server/client/minimal) instead using > "--openjdk-target=arm-linux-gnueabihf" and > "--with-abi-profile=arm-vfp-hflt" switches. From akashche at redhat.com Thu Mar 30 10:30:03 2017 From: akashche at redhat.com (Alex Kashchenko) Date: Thu, 30 Mar 2017 11:30:03 +0100 Subject: Cross compiling openjdk9, problem with HotSpot assembly code In-Reply-To: <874lybn31z.fsf@bruno-dell> References: <878tnnna3b.fsf@bruno-dell> <32a17f08-411f-7859-00a5-e25297ea0b80@redhat.com> <874lybn31z.fsf@bruno-dell> Message-ID: <15b3a3fe-7dd9-f581-e746-410529ba5a91@redhat.com> Hi Bruno, On 03/29/2017 11:14 PM, Bruno Kremel wrote: > > Hi Alex, > > Just a quick question. Does the toolchain have to be hardfloat? > Currently I use arm-linux-gnueabi (not hf, it's linaro toolchain). Softfloat builds are supported with "--with-abi-profile=arm-sflt" or "arm-vfp-sflt", I don't know the details, but this thread may be helpful - http://mail.openjdk.java.net/pipermail/aarch32-port-dev/2016-November/000610.html > Thanks > Bruno > > Alex Kashchenko writes: > >> Hi Bruno, >> >> On 03/29/2017 08:42 PM, Bruno Kremel wrote: >>> Hi All, >>> >>> I am trying to compile Openjdk 9 (HG tag changeset 162) and I do >>> following: >>> ./configure --with-jvm-interpreter=cpp --with-jvm-variants=zero \ >>> >>> [...] >>> >>> It seems that it tries to compile some x86_64 assembly code which does >>> not make sense when clearly configure states that I have the ARM target. >>> >>> The other thing I don't understand why does it even compile hotspot >>> code? I have asked for zero interpreter AND openjdk only, I actually >>> don't want to use HotSpot I intend to use JamVM with OpenJDK classpath. >>> >>> Do you have any suggestions. >> >> jdk9 build system tries to build a native "build jdk" (to not be >> confused with "boot jdk") first and then uses it during the cross-build. >> If you cross compiler has correct prefix (arm-linux-gnueabihf, >> aarch64-linux-gnu etc) and default compiler is a native one - that >> should work out of the box. Alternatively you can build native x86_64 >> jdk9 from the same hg revision manually and specify it with >> "--with-build-jdk" switch. >> >> Also AFAIK Zero port is currently not functional in jdk9, though you can >> build a full ARM32 VM (server/client/minimal) instead using >> "--openjdk-target=arm-linux-gnueabihf" and >> "--with-abi-profile=arm-vfp-hflt" switches. > -- -Alex