Trying to build zero in JDK10 taken from the current tip (r13446) fails with the problem that the definitions for the standard types from stdint.h are missing:
In file included from /tmp/glaubitz/hs/hotspot/test/native/runtime/test_vmStructs.cpp:25:0:
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:71:3: error: ‘int32_t’ does not name a type
int32_t isStatic; // Indicates whether following field is an offset or an address
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:72:3: error: ‘uint64_t’ does not name a type
uint64_t offset; // Offset of field within structure; only used for nonstatic fields
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:81:3: error: ‘int32_t’ does not name a type
int32_t isOopType; // Does this type represent an oop typedef? (i.e., "Method*" or
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:83:3: error: ‘int32_t’ does not name a type
int32_t isIntegerType; // Does this type represent an integer type (of arbitrary size)?
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:84:3: error: ‘int32_t’ does not name a type
int32_t isUnsigned; // If so, is it unsigned?
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:85:3: error: ‘uint64_t’ does not name a type
uint64_t size; // Size, in bytes, of the type
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:90:3: error: ‘int32_t’ does not name a type
int32_t value; // Value of constant
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:95:3: error: ‘uint64_t’ does not name a type
uint64_t value; // Value of constant
^
This affects zero only, in this particular case it was tested with linux-zero. Trying to build linux-x86, linux-ppc64el or linux-sparc with the same code base does not show this problem.
A workaround is to add an include for stdint.h to src/share/vm/runtime/vmStructs.hpp:
diff -r 9a75c2f7bf06 src/share/vm/runtime/vmStructs.hpp
--- a/src/share/vm/runtime/vmStructs.hpp Wed Aug 16 16:00:15 2017 +0200
+++ b/src/share/vm/runtime/vmStructs.hpp Fri Aug 18 16:13:38 2017 +0200
@@ -25,6 +25,8 @@
#ifndef SHARE_VM_RUNTIME_VMSTRUCTS_HPP
#define SHARE_VM_RUNTIME_VMSTRUCTS_HPP
+#include <stdint.h>
+
#include "utilities/debug.hpp"
#ifdef COMPILER1
#include "c1/c1_Runtime1.hpp"
However, that's obviously not the right way to fix it. I have looked at the implementations for the other CPU types and couldn't find any obvious place where stdint.h is included.
Built with:
CONF=linux-x86_64-normal-zero-release MAKE_VERBOSE=y QUIETLY= LOG=debug ./configure --with-jvm-variants=zero --with-boot-jdk=/usr/lib/jvm/java-8-openjdk-amd64 --disable-precompiled-headers --disable-warnings-as-errors && make JOBS=16 MAKE_VERBOSE=y QUIETLY= LOG=debug CONF=linux-x86_64-normal-zero-release
In file included from /tmp/glaubitz/hs/hotspot/test/native/runtime/test_vmStructs.cpp:25:0:
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:71:3: error: ‘int32_t’ does not name a type
int32_t isStatic; // Indicates whether following field is an offset or an address
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:72:3: error: ‘uint64_t’ does not name a type
uint64_t offset; // Offset of field within structure; only used for nonstatic fields
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:81:3: error: ‘int32_t’ does not name a type
int32_t isOopType; // Does this type represent an oop typedef? (i.e., "Method*" or
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:83:3: error: ‘int32_t’ does not name a type
int32_t isIntegerType; // Does this type represent an integer type (of arbitrary size)?
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:84:3: error: ‘int32_t’ does not name a type
int32_t isUnsigned; // If so, is it unsigned?
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:85:3: error: ‘uint64_t’ does not name a type
uint64_t size; // Size, in bytes, of the type
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:90:3: error: ‘int32_t’ does not name a type
int32_t value; // Value of constant
^
/tmp/glaubitz/hs/hotspot/src/share/vm/runtime/vmStructs.hpp:95:3: error: ‘uint64_t’ does not name a type
uint64_t value; // Value of constant
^
This affects zero only, in this particular case it was tested with linux-zero. Trying to build linux-x86, linux-ppc64el or linux-sparc with the same code base does not show this problem.
A workaround is to add an include for stdint.h to src/share/vm/runtime/vmStructs.hpp:
diff -r 9a75c2f7bf06 src/share/vm/runtime/vmStructs.hpp
--- a/src/share/vm/runtime/vmStructs.hpp Wed Aug 16 16:00:15 2017 +0200
+++ b/src/share/vm/runtime/vmStructs.hpp Fri Aug 18 16:13:38 2017 +0200
@@ -25,6 +25,8 @@
#ifndef SHARE_VM_RUNTIME_VMSTRUCTS_HPP
#define SHARE_VM_RUNTIME_VMSTRUCTS_HPP
+#include <stdint.h>
+
#include "utilities/debug.hpp"
#ifdef COMPILER1
#include "c1/c1_Runtime1.hpp"
However, that's obviously not the right way to fix it. I have looked at the implementations for the other CPU types and couldn't find any obvious place where stdint.h is included.
Built with:
CONF=linux-x86_64-normal-zero-release MAKE_VERBOSE=y QUIETLY= LOG=debug ./configure --with-jvm-variants=zero --with-boot-jdk=/usr/lib/jvm/java-8-openjdk-amd64 --disable-precompiled-headers --disable-warnings-as-errors && make JOBS=16 MAKE_VERBOSE=y QUIETLY= LOG=debug CONF=linux-x86_64-normal-zero-release