[RFH]: 8186443: Missing stdint.h for zero builds
David Holmes
david.holmes at oracle.com
Fri Aug 18 22:35:59 UTC 2017
Hi Adrian,
On 19/08/2017 12:27 AM, John Paul Adrian Glaubitz wrote:
> Hi!
>
> Zero currently fails to build from source because the definitions 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
> ^
>
> I'm asking for help because I haven't come up with a proper patch yet to
> fix this particular issue.
> It does not affect any of the other CPU targets (tested linux-x86,
> ppc64el, sparc), so this must
> be another case of neglected code.
>
> A work-around is to patch vmStructs.hpp to include stdint.h to fix the
> problem:
>
> 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"
>
> But that's obviously not the right fix because that would affect the
> other CPU targets as well.
>
> Any ideas?
There is a bug in the test file:
test/native/runtime/test_vmStructs.cpp
#include "precompiled.hpp"
#include "runtime/vmStructs.hpp"
#include "utilities/macros.hpp"
#include "unittest.hpp"
#if INCLUDE_VM_STRUCTS
If we aren't including VM structs then we probably shouldn't be
#include'ing vmStructs.hpp!
The #include needs to move inside the guard.
Cheers,
David
> Adrian
>
More information about the hotspot-dev
mailing list