OpenJDK9 build failure

Tiago Sturmer Daitx tdaitx at br.ibm.com
Wed Jun 18 14:52:18 UTC 2014


tl;dr I have had problems building with JDK9 due to -Werror=format flag
and also due to hotspot/agent/src/os/linux/libproc.h including
linux/ptrace.h instead of sys/ptrace.h


I have been trying to build JDK9 from
http://hg.openjdk.java.net/jdk9/dev (or /hs-comp or /jdk9) and JDK8u
from http://hg.openjdk.java.net/jdk8u/jdk8u/

First, I'm seeing the following on JDK9 only:
http://fpaste.org/110642/30430021/ (and there are many many lines with
similar errors until the build is aborted).

After ignoring the error ('CFLAGS="-Wno-error=format" make' or editing
make/linux/makefiles/gcc.make to remove "-Werror=format"), I get the
following on JDK9: http://fpaste.org/110640/42657140/

And on JDK8: http://fpaste.org/110638/40304229/

I see that both sys/ptrace.h and linux/ptrace.h have been included:

$ grep -r ptrace.h hotspot/
hotspot/agent/src/os/linux/ps_proc.c:#include <sys/ptrace.h>
hotspot/agent/src/os/linux/libproc.h:#include <linux/ptrace.h>

Usually linux/ptrace.h is used by glibc to do syscall, wile sys/ptrace.h
is used by app code to do library calls (thanks Maynard for the info).

After editing hotspot/agent/src/os/linux/libproc.h to use sys/ptrace.h
I'm able to build both JDK8 & JDK9.

Some settings:

JDK8 configure:
$ ./configure \
  --with-boot-jdk=/home/tdaitx/icedtea7/openjdk.build/j2sdk-image/ \
  --with-jvm-variants=server --with-jvm-interpreter=cpp \
  --with-extra-cflags=-Wno-strict-aliasing

JDK9 configure is similar but I point it to a JDK8 build.

Make for JDK8 and JDK9:
$ make JOBS=8 LOG=debug



$ /usr/bin/gcc -v  # g++ is the same, except for COLLECT_GCC
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/ppc64-redhat-linux/4.8.2/lto-wrapper
Target: ppc64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
--enable-shared --enable-threads=posix --enable-checking=release
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c
++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array
--enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--disable-libjava-multilib
--with-isl=/builddir/build/BUILD/gcc-4.8.2-20131212/obj-ppc64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.2-20131212/obj-ppc64-redhat-linux/cloog-install --enable-secureplt --with-long-double-128 --build=ppc64-redhat-linux
Thread model: posix
gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC) 

$ cat /etc/redhat-release 
Fedora release 20 (Heisenbug)

$ rpm -qf /usr/include/linux/ptrace.h 
kernel-headers-3.14.5-200.fc20.ppc64p7

$ rpm -qf /usr/include/sys/ptrace.h
glibc-headers-2.18-12.fc20.ppc64p7

Regards,
Tiago

-- 
Tiago Sturmer Daitx
Linux Technology Center [LTC|IBM]
tdaitx at br.ibm.com



More information about the ppc-aix-port-dev mailing list