JDK14 cross-compile to arm64 fails to locate c++ header new

Choe, Jiwon jiwon_choe at brown.edu
Tue Aug 25 20:06:38 UTC 2020


Hello all,

I'm trying to cross-compile JDK 14 to target aarch64-linux-gnu, from a
64-bit x86 Linux machine. I followed the steps described in the
documentation (
https://hg.openjdk.java.net/jdk/jdk14/raw-file/tip/doc/building.html#creating-and-using-sysroots-with-qemu-deboostrap),
but when I try to make the target image, I get the following error:

=== Output from failing command(s) repeated here ===
* For target
hotspot_variant-server_libjvm_gtest_objs_precompiled_precompiled.hpp.gch:
In file included from
/home/jiwon/jdk-related/jdk14/jdk14/src/hotspot/share/classfile/classLoaderData.hpp:28:0,
                 from
/home/jiwon/jdk-related/jdk14/jdk14/src/hotspot/share/precompiled/precompiled.hpp:34:
/home/jiwon/jdk-related/jdk14/jdk14/src/hotspot/share/memory/allocation.hpp:31:15:
fatal error: new: No such file or directory
 #include <new>
               ^
compilation terminated.
* For target
hotspot_variant-server_libjvm_objs_precompiled_precompiled.hpp.gch:
In file included from
/home/jiwon/jdk-related/jdk14/jdk14/src/hotspot/share/classfile/classLoaderData.hpp:28:0,
                 from
/home/jiwon/jdk-related/jdk14/jdk14/src/hotspot/share/precompiled/precompiled.hpp:34:
/home/jiwon/jdk-related/jdk14/jdk14/src/hotspot/share/memory/allocation.hpp:31:15:
fatal error: new: No such file or directory
 #include <new>
               ^
compilation terminated.

Could anyone help me figure out how to fix this?
This is how I configured the build, and the output I got from configure:

$ sudo qemu-debootstrap --arch=arm64 --verbose
--include=fakeroot,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng12-dev
--resolve-deps trusty /opt/sysroot/

$ CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ bash configure
--openjdk-target=aarch64-linux-gnu
--with-build-jdk=build/linux-x86_64-server-release/images/jdk
--with-sysroot=/opt/sysroot --with-toolchain-path=/opt/sysroot
configure: Configuration created at Tue Aug 25 15:55:28 EDT 2020.
checking for basename... /usr/bin/basename
checking for bash... /bin/bash
checking for cat... /bin/cat
checking for chmod... /bin/chmod
checking for cmp... /usr/bin/cmp
checking for comm... /usr/bin/comm
checking for cp... /bin/cp
checking for cut... /usr/bin/cut
checking for date... /bin/date
checking for gdiff... no
checking for diff... /usr/bin/diff
checking for dirname... /usr/bin/dirname
checking for echo... /bin/echo
checking for expr... /usr/bin/expr
checking for file... /usr/bin/file
checking for find... /usr/bin/find
checking for head... /usr/bin/head
checking for gunzip... /bin/gunzip
checking for pigz... no
checking for gzip... /bin/gzip
checking for ln... /bin/ln
checking for ls... /bin/ls
checking for gmkdir... no
checking for mkdir... /bin/mkdir
checking for mktemp... /bin/mktemp
checking for mv... /bin/mv
checking for nawk... /usr/bin/nawk
checking for printf... /usr/bin/printf
checking for greadlink... no
checking for readlink... /bin/readlink
checking for rm... /bin/rm
checking for rmdir... /bin/rmdir
checking for sh... /bin/sh
checking for sort... /usr/bin/sort
checking for tail... /usr/bin/tail
checking for gtar... no
checking for tar... /bin/tar
checking for tee... /usr/bin/tee
checking for touch... /usr/bin/touch
checking for tr... /usr/bin/tr
checking for uname... /bin/uname
checking for uniq... /usr/bin/uniq
checking for wc... /usr/bin/wc
checking for which... /usr/bin/which
checking for xargs... /usr/bin/xargs
checking for gawk... gawk
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for a sed that does not truncate output... /bin/sed
checking for cygpath... no
checking for wslpath... no
checking for df... /bin/df
checking for cpio... /bin/cpio
checking for nice... /usr/bin/nice
checking for lsb_release... /usr/bin/lsb_release
checking for cmd.exe... no
checking for /mnt/c/Windows/System32/cmd.exe... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking target system type... aarch64-unknown-linux-gnu
checking openjdk-build os-cpu... linux-x86_64
checking openjdk-target os-cpu... linux-aarch64
checking compilation type... cross
checking for top-level directory... /home/jiwon/jdk-related/jdk14/jdk14
checking if custom source is suppressed (openjdk-only)... no
checking which debug level to use... release
checking which variants of the JVM to build... server
checking for sysroot... /opt/sysroot
checking for toolchain path... /opt/sysroot
checking for extra path...
checking where to store configuration... in default location
checking what configuration name to use... linux-aarch64-server-release
checking for zypper... no
checking for apt-get... apt-get
checking for pandoc... no
checking for gmake... no
checking for make... /usr/bin/make
configure: Testing potential make at /usr/bin/make, found using make in PATH
configure: Using GNU make at /usr/bin/make (version: GNU Make 3.81)
checking if make --output-sync is supported... no
checking if find supports -delete... yes
checking what type of tar was found... gnu
checking that grep (/bin/grep) -Fx handles empty lines in the pattern list
correctly... yes
checking for unzip... /usr/bin/unzip
checking for zip... /usr/bin/zip
checking for ldd... /usr/bin/ldd
checking for greadelf... no
checking for readelf... /usr/bin/readelf
checking for dot... /usr/bin/dot
checking for hg... /usr/bin/hg
checking for git... /usr/bin/git
checking for stat... /usr/bin/stat
checking for time... /usr/bin/time
checking for flock... /usr/bin/flock
checking for dtrace... no
checking for gpatch... no
checking for patch... /usr/bin/patch
checking for ulimit... no
configure: Required tool ulimit not found in PATH, checking built-in
configure: Found ulimit as shell built-in. Using it
checking bash version... 4.3.11
checking if bash supports pipefail... yes
checking if bash supports errexit (-e)... yes
checking for aarch64-linux-gnu-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
configure: WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.9.0... yes
checking for default LOG value...
checking headless only... no
checking for graphviz dot... yes
checking for pandoc... no, cannot generate full docs
checking full docs... no, missing dependencies
checking for cacerts file... default
checking for jni library path... default
checking if packaged modules are kept... yes (default)
checking for version string... 14-internal+0-adhoc.jiwon.jdk14
checking for javac... /usr/bin/javac
checking for java... /usr/bin/java
configure: Found potential Boot JDK using java(c) in PATH
checking for Boot JDK... /usr/lib/jvm/jdk-13.0.2
checking Boot JDK version... openjdk version "13.0.2" 2020-01-14 OpenJDK
Runtime Environment (build 13.0.2+8) OpenJDK 64-Bit Server VM (build
13.0.2+8, mixed mode, sharing)
checking for java in Boot JDK... ok
checking for javac in Boot JDK... ok
checking for javadoc in Boot JDK... ok
checking for jar in Boot JDK... ok
checking for jarsigner in Boot JDK... ok
checking if Boot JDK is 32 or 64 bits... 64
checking for local Boot JDK Class Data Sharing (CDS)... yes, created
configure: Found potential Build JDK using configure arguments
checking for Build JDK...
/home/jiwon/jdk-related/jdk14/jdk14/build/linux-x86_64-server-release/images/jdk
checking Build JDK version... openjdk version "14-internal" 2020-03-17
OpenJDK Runtime Environment (build 14-internal+0-adhoc.jiwon.jdk14) OpenJDK
64-Bit Server VM (build 14-internal+0-adhoc.jiwon.jdk14, mixed mode,
sharing)
configure: Using default toolchain gcc (GNU Compiler Collection)
configure: Will use user supplied compiler CC=aarch64-linux-gnu-gcc
checking for aarch64-linux-gnu-gcc... /usr/bin/aarch64-linux-gnu-gcc
checking resolved symbolic links for CC...
/usr/bin/aarch64-linux-gnu-gcc-4.8
configure: Using gcc C compiler version 4.8.4 [aarch64-linux-gnu-gcc
(Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) 4.8.4]
checking for aarch64-linux-gnu-/usr/bin/aarch64-linux-gnu-gcc...
/usr/bin/aarch64-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/aarch64-linux-gnu-gcc accepts -g... yes
checking for /usr/bin/aarch64-linux-gnu-gcc option to accept ISO C89...
none needed
configure: Will use user supplied compiler CXX=aarch64-linux-gnu-g++
checking for aarch64-linux-gnu-g++... /usr/bin/aarch64-linux-gnu-g++
checking resolved symbolic links for CXX...
/usr/bin/aarch64-linux-gnu-g++-4.8
configure: Using gcc C++ compiler version 4.8.4 [aarch64-linux-gnu-g++
(Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) 4.8.4]
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/bin/aarch64-linux-gnu-g++ accepts -g... yes
checking how to run the C preprocessor... /usr/bin/aarch64-linux-gnu-gcc -E
checking how to run the C++ preprocessor... /usr/bin/aarch64-linux-gnu-g++
-E
checking for aarch64-linux-gnu-ld... aarch64-linux-gnu-ld
configure: Rewriting LD_JAOTC to "/usr/bin/aarch64-linux-gnu-ld"
configure: Using gcc linker version 2.24 [GNU ld (GNU Binutils for Ubuntu)
2.24]
checking for aarch64-linux-gnu-ar... aarch64-linux-gnu-ar
configure: Rewriting AR to "/usr/bin/aarch64-linux-gnu-ar"
checking for aarch64-linux-gnu-strip... aarch64-linux-gnu-strip
configure: Rewriting STRIP to "/usr/bin/aarch64-linux-gnu-strip"
checking for aarch64-linux-gnu-nm... aarch64-linux-gnu-nm
configure: Rewriting NM to "/usr/bin/aarch64-linux-gnu-nm"
checking for aarch64-linux-gnu-gobjcopy... no
checking for aarch64-linux-gnu-objcopy... aarch64-linux-gnu-objcopy
configure: Rewriting OBJCOPY to "/usr/bin/aarch64-linux-gnu-objcopy"
checking for aarch64-linux-gnu-gobjdump... no
checking for aarch64-linux-gnu-objdump... aarch64-linux-gnu-objdump
configure: Rewriting OBJDUMP to "/usr/bin/aarch64-linux-gnu-objdump"
checking for aarch64-linux-gnu-c++filt... aarch64-linux-gnu-c++filt
configure: Rewriting CXXFILT to "/usr/bin/aarch64-linux-gnu-c++filt"
checking for cl... no
checking for cc... /usr/bin/cc
checking for cl... no
checking for CC... no
checking for g++... /usr/bin/g++
checking for nm... /usr/bin/nm
checking for ar... /usr/bin/ar
checking for objcopy... /usr/bin/objcopy
checking for strip... /usr/bin/strip
configure: Using gcc BuildC compiler version 4.8.4 [cc (Ubuntu
4.8.4-2ubuntu1~14.04.4) 4.8.4]
configure: Using gcc BuildC++ compiler version 4.8.4 [g++ (Ubuntu
4.8.4-2ubuntu1~14.04.4) 4.8.4]
configure: Using gcc build linker version 2.24 [GNU ld (GNU Binutils for
Ubuntu) 2.24]
checking for jtreg... no
checking for jtreg test harness... no, not found
checking for jmh (Java Microbenchmark Harness)... no, disabled
checking for jib... no
checking if @file is supported by gcc... yes
checking if CC supports "-m64"... no
checking if CXX supports "-m64"... no
checking if both CC and CXX support "-m64"... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking size of int *... 8
checking for target address size... 64 bits
checking whether byte ordering is bigendian... no
checking if native warnings are errors... true (default)
checking for library containing clock_gettime... none required
checking if CC supports "-Xassembler -mrelax-relocations=no"... no
checking if CXX supports "-Xassembler -mrelax-relocations=no"... no
checking if both CC and CXX support "-Xassembler -mrelax-relocations=no"...
no
checking if CXX supports "-std=gnu++98 -Werror"... yes
checking if CC supports "-fno-delete-null-pointer-checks -Werror"... yes
checking if CXX supports "-fno-delete-null-pointer-checks -Werror"... yes
checking if both CC and CXX support "-fno-delete-null-pointer-checks
-Werror"... yes
checking if CC supports "-fno-lifetime-dse -Werror"... no
checking if CXX supports "-fno-lifetime-dse -Werror"... no
checking if both CC and CXX support "-fno-lifetime-dse -Werror"... no
checking if CC supports
"-fmacro-prefix-map=/home/jiwon/jdk-related/jdk14/jdk14/="... no
checking if CXX supports
"-fmacro-prefix-map=/home/jiwon/jdk-related/jdk14/jdk14/="... no
checking if both CC and CXX support
"-fmacro-prefix-map=/home/jiwon/jdk-related/jdk14/jdk14/="... no
checking if CC supports "-ffp-contract=off"... yes
checking if CXX supports "-ffp-contract=off"... yes
checking if both CC and CXX support "-ffp-contract=off"... yes
checking if BUILD_CXX supports "-std=gnu++98 -Werror"... yes
checking if BUILD_CC supports "-fno-delete-null-pointer-checks -Werror"...
yes
checking if BUILD_CXX supports "-fno-delete-null-pointer-checks -Werror"...
yes
checking if both BUILD_CC and BUILD_CXX support
"-fno-delete-null-pointer-checks -Werror"... yes
checking if BUILD_CC supports "-fno-lifetime-dse -Werror"... no
checking if BUILD_CXX supports "-fno-lifetime-dse -Werror"... no
checking if both BUILD_CC and BUILD_CXX support "-fno-lifetime-dse
-Werror"... no
checking if BUILD_CC supports
"-fmacro-prefix-map=/home/jiwon/jdk-related/jdk14/jdk14/="... no
checking if BUILD_CXX supports
"-fmacro-prefix-map=/home/jiwon/jdk-related/jdk14/jdk14/="... no
checking if both BUILD_CC and BUILD_CXX support
"-fmacro-prefix-map=/home/jiwon/jdk-related/jdk14/jdk14/="... no
checking if BUILD_CC supports "-ffp-contract=off"... yes
checking if BUILD_CXX supports "-ffp-contract=off"... yes
checking if both BUILD_CC and BUILD_CXX support "-ffp-contract=off"... yes
checking what type of native debug symbols to use... external
checking for dtrace tool... not found, cannot build dtrace
checking sys/sdt.h usability... no
checking sys/sdt.h presence... no
checking for sys/sdt.h... no
checking if dtrace should be built... no, missing dependencies
checking if Hotspot gtest unit tests should be built... yes
checking if static link of stdc++ is possible... yes
checking how to link with libstdc++... static
checking for X... libraries , headers /opt/sysroot/usr/include
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for X11/extensions/shape.h... yes
checking for X11/extensions/Xrender.h... yes
checking for X11/extensions/XTest.h... yes
checking for X11/Intrinsic.h... yes
checking for X11/extensions/Xrandr.h... yes
checking if XlinearGradient is defined in Xrender.h... yes
checking cups/cups.h usability... yes
checking cups/cups.h presence... yes
checking for cups/cups.h... yes
checking cups/ppd.h usability... yes
checking cups/ppd.h presence... yes
checking for cups/ppd.h... yes
checking fontconfig/fontconfig.h usability... yes
checking fontconfig/fontconfig.h presence... yes
checking for fontconfig/fontconfig.h... yes
configure: Found freetype include files at
/opt/sysroot/usr/include/freetype2 using well-known location
configure: Could not find /opt/sysroot/usr/lib/libfreetype.so. Ignoring
location.
configure: Found freetype include files at
/opt/sysroot/usr/include/freetype2 using well-known location
checking for freetype includes... /opt/sysroot/usr/include/freetype2
checking for freetype libraries... /opt/sysroot/usr/lib/aarch64-linux-gnu
Using freetype: system
checking alsa/asoundlib.h usability... yes
checking alsa/asoundlib.h presence... yes
checking for alsa/asoundlib.h... yes
checking for which libjpeg to use... bundled
checking for which giflib to use... bundled
checking for PNG... yes
checking for which libpng to use... bundled
checking for compress in -lz... yes
checking for which zlib to use... system
checking for system zlib functionality... ok
checking for which lcms to use... bundled
checking for cos in -lm... yes
checking for dlopen in -ldl... yes
checking if shenandoah can be built... yes
checking if zgc can be built... yes
checking if jvmci module jdk.internal.vm.ci should be built... yes
checking if graal module jdk.internal.vm.compiler should be built... yes
checking if aot should be enabled... yes
checking if cds should be enabled... yes
checking if elliptic curve crypto implementation is present... yes
checking if jtreg failure handler should be built... no, missing jtreg
checking if the CDS classlist generation should be enabled... yes
checking if any translations should be excluded... no
checking if static man pages should be copied... yes
checking if a default CDS archive should be generated... no, not possible
with cross compilation
checking for number of cores... 8
checking for memory size... 32097 MB
checking for appropriate number of jobs to run in parallel... 8
checking flags for boot jdk java command ...  -Duser.language=en
-Duser.country=US  -XX:+UnlockDiagnosticVMOptions -XX:-VerifySharedSpaces
-XX:SharedArchiveFile=/home/jiwon/jdk-related/jdk14/jdk14/build/linux-aarch64-server-release/configure-support/classes.jsa
-Xshare:auto
checking flags for boot jdk java command for big workloads...  -Xms64M
-Xmx1600M -XX:ThreadStackSize=1536
checking flags for bootcycle boot jdk java command for big workloads...
-Xms64M -Xmx1600M -XX:ThreadStackSize=1536
checking flags for boot jdk java command for small workloads...
 -XX:+UseSerialGC -Xms32M -Xmx512M -XX:TieredStopAtLevel=1
checking whether to use sjavac... no
checking whether to use javac server... yes
checking If precompiled header is enabled... yes
checking that precompiled headers work... yes
checking is ccache enabled... no
checking if build directory is on local disk... yes
checking JVM features for JVM variant 'server'... "aot cds compiler1
compiler2 epsilongc g1gc graal jfr jni-check jvmci jvmti management nmt
parallelgc serialgc services shenandoahgc vm-structs zgc"
configure: creating
/home/jiwon/jdk-related/jdk14/jdk14/build/linux-aarch64-server-release/configure-support/config.status
config.status: creating
/home/jiwon/jdk-related/jdk14/jdk14/build/linux-aarch64-server-release/spec.gmk
config.status: creating
/home/jiwon/jdk-related/jdk14/jdk14/build/linux-aarch64-server-release/bootcycle-spec.gmk
config.status: creating
/home/jiwon/jdk-related/jdk14/jdk14/build/linux-aarch64-server-release/buildjdk-spec.gmk
config.status: creating
/home/jiwon/jdk-related/jdk14/jdk14/build/linux-aarch64-server-release/compare.sh
config.status: creating
/home/jiwon/jdk-related/jdk14/jdk14/build/linux-aarch64-server-release/Makefile

====================================================
A new configuration has been successfully created in
/home/jiwon/jdk-related/jdk14/jdk14/build/linux-aarch64-server-release
using configure arguments '--openjdk-target=aarch64-linux-gnu
--with-build-jdk=build/linux-x86_64-server-release/images/jdk
--with-sysroot=/opt/sysroot --with-toolchain-path=/opt/sysroot'.

Configuration summary:
* Debug level:    release
* HS debug level: product
* JVM variants:   server
* JVM features:   server: 'aot cds compiler1 compiler2 epsilongc g1gc graal
jfr jni-check jvmci jvmti management nmt parallelgc serialgc services
shenandoahgc vm-structs zgc'
* OpenJDK target: OS: linux, CPU architecture: aarch64, address length: 64
* Version string: 14-internal+0-adhoc.jiwon.jdk14 (14-internal)

Tools summary:
* Boot JDK:       openjdk version "13.0.2" 2020-01-14 OpenJDK Runtime
Environment (build 13.0.2+8) OpenJDK 64-Bit Server VM (build 13.0.2+8,
mixed mode, sharing)  (at /usr/lib/jvm/jdk-13.0.2)
* Toolchain:      gcc (GNU Compiler Collection)
* C Compiler:     Version 4.8.4 (at /usr/bin/aarch64-linux-gnu-gcc)
* C++ Compiler:   Version 4.8.4 (at /usr/bin/aarch64-linux-gnu-g++)

Build performance summary:
* Cores to use:   8
* Memory limit:   32097 MB

The following warnings were produced. Repeated here for convenience:
WARNING: using cross tools not prefixed with host triplet



Thanks,
Jiwon



More information about the build-dev mailing list