[RFH]: 8186443: Missing stdint.h for zero builds

John Paul Adrian Glaubitz glaubitz at physik.fu-berlin.de
Sat Aug 19 00:40:36 UTC 2017

On 08/19/2017 01:54 AM, Kim Barrett wrote:
> Presumably that means INCLUDE_VM_STRUCTS is true.


> The include should still be moved inside the conditional guard.

Ok. But that should go into a different bug report then, I guess :-).

> But I think the
> problem is indeed with vmStructs.hpp itself.
> vmStructs.hpp has this for #includes:
> #include "utilities/debug.hpp"
> #ifdef COMPILER1
> #include "c1/c1_Runtime1.hpp"
> #endif
> debug.hpp was recently changed to have fairly minimal #includes.  In
> particular, it no longer #includes globalDefinitions.hpp, which is
> where most of our code gets <stdint.h> and the like from.

Aha. I was already looking where globalDefinitions.hpp was coming from
because I had found that globalDefintions.hpp was the place where
stdint.h was included but I couldn't find it.

> I think zero doesn't define COMPILER1; zero only uses the interpreter,
> not any of the compilers.

Makes absolutely sense now. Thanks for the quick heads-up.

> So for zero, it used to get <stdint.h> indirectly from
> globalDefinitions.hpp via debug.hpp, but no longer does.  And when
> COMPILER1 is defined (which it normally is, except for zero), I bet
> there's an indirect include of globalDefinitions.hpp from there.
> I think adding an #include of <stdint.h> to vmStructs.hpp is
> reasonable.  Alternatively, #include globalDefinitions.hpp, though I'm
> personally not a fan of that file.

What about guarding it:

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        Sat Aug 19 02:39:41 2017 +0200
@@ -28,6 +28,8 @@
 #include "utilities/debug.hpp"
 #ifdef COMPILER1
 #include "c1/c1_Runtime1.hpp"
+#include "utilities/globalDefinitions.hpp"

 // This table encapsulates the debugging information required by the

I have verified that zero builds fine with that change. I know the #else
is not really necessary here but it might make the code more readable.


 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz at debian.org
`. `'   Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

More information about the hotspot-dev mailing list