JDK-8226871 : invalid use of incomplete type class MacroAssembler when building minimal after JDK-8191278
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 14
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2019-06-27
  • Updated: 2021-08-04
  • Resolved: 2019-06-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13 JDK 14
13.0.9Fixed 14 b04Fixed
Related Reports
Relates :  
Description
minimal build fails after JDK-8191278.

$ make images CONF=linux-x86_64-minimal-release
Building target 'images' in configuration 'linux-x86_64-minimal-release'
/home/aoqi/jdk/src/hotspot/share/runtime/stubRoutines.cpp: In constructor 'UnsafeCopyMemoryMark::UnsafeCopyMemoryMark(StubCodeGenerator*, bool, bool, address)':
/home/aoqi/jdk/src/hotspot/share/runtime/stubRoutines.cpp:610:67: error: invalid use of incomplete type 'class MacroAssembler'
     _ucm_entry = UnsafeCopyMemory::add_to_table(_cgen->assembler()->pc(), NULL, err_exit_pc);
                                                                   ^
In file included from /home/aoqi/jdk/src/hotspot/share/runtime/thread.hpp:38:0,
                 from /home/aoqi/jdk/src/hotspot/share/runtime/safepoint.hpp:30,
                 from /home/aoqi/jdk/src/hotspot/share/gc/shared/collectedHeap.hpp:34,
                 from /home/aoqi/jdk/src/hotspot/share/precompiled/precompiled.hpp:37:
/home/aoqi/jdk/src/hotspot/share/runtime/javaFrameAnchor.hpp:36:7: error: forward declaration of 'class MacroAssembler'
 class MacroAssembler;
       ^
/home/aoqi/jdk/src/hotspot/share/runtime/stubRoutines.cpp: In destructor 'UnsafeCopyMemoryMark::~UnsafeCopyMemoryMark()':
/home/aoqi/jdk/src/hotspot/share/runtime/stubRoutines.cpp:616:46: error: invalid use of incomplete type 'class MacroAssembler'
     _ucm_entry->set_end_pc(_cgen->assembler()->pc());
                                              ^
In file included from /home/aoqi/jdk/src/hotspot/share/runtime/thread.hpp:38:0,
                 from /home/aoqi/jdk/src/hotspot/share/runtime/safepoint.hpp:30,
                 from /home/aoqi/jdk/src/hotspot/share/gc/shared/collectedHeap.hpp:34,
                 from /home/aoqi/jdk/src/hotspot/share/precompiled/precompiled.hpp:37:
/home/aoqi/jdk/src/hotspot/share/runtime/javaFrameAnchor.hpp:36:7: error: forward declaration of 'class MacroAssembler'
 class MacroAssembler;
       ^
/home/aoqi/jdk/src/hotspot/share/runtime/stubRoutines.cpp:618:55: error: invalid use of incomplete type 'class MacroAssembler'
       _ucm_entry->set_error_exit_pc(_cgen->assembler()->pc());
                                                       ^
In file included from /home/aoqi/jdk/src/hotspot/share/runtime/thread.hpp:38:0,
                 from /home/aoqi/jdk/src/hotspot/share/runtime/safepoint.hpp:30,
                 from /home/aoqi/jdk/src/hotspot/share/gc/shared/collectedHeap.hpp:34,
                 from /home/aoqi/jdk/src/hotspot/share/precompiled/precompiled.hpp:37:
/home/aoqi/jdk/src/hotspot/share/runtime/javaFrameAnchor.hpp:36:7: error: forward declaration of 'class MacroAssembler'
 class MacroAssembler;
       ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-misleading-indentation" [enabled by default]
cc1plus: warning: unrecognized command line option "-Wno-implicit-fallthrough" [enabled by default]
cc1plus: warning: unrecognized command line option "-Wno-int-in-bool-context" [enabled by default]
gmake[3]: *** [/home/aoqi/jdk/build/linux-x86_64-minimal-release/hotspot/variant-minimal/libjvm/objs/stubRoutines.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
gmake[2]: *** [hotspot-minimal-libs] Error 1

ERROR: Build failed for target 'images' in configuration 'linux-x86_64-minimal-release' (exit code 2) 

=== Output from failing command(s) repeated here ===
* For target hotspot_variant-minimal_libjvm_objs_stubRoutines.o:
/home/aoqi/jdk/src/hotspot/share/runtime/stubRoutines.cpp: In constructor 'UnsafeCopyMemoryMark::UnsafeCopyMemoryMark(StubCodeGenerator*, bool, bool, address)':
/home/aoqi/jdk/src/hotspot/share/runtime/stubRoutines.cpp:610:67: error: invalid use of incomplete type 'class MacroAssembler'
     _ucm_entry = UnsafeCopyMemory::add_to_table(_cgen->assembler()->pc(), NULL, err_exit_pc);
                                                                   ^
In file included from /home/aoqi/jdk/src/hotspot/share/runtime/thread.hpp:38:0,
                 from /home/aoqi/jdk/src/hotspot/share/runtime/safepoint.hpp:30,
                 from /home/aoqi/jdk/src/hotspot/share/gc/shared/collectedHeap.hpp:34,
                 from /home/aoqi/jdk/src/hotspot/share/precompiled/precompiled.hpp:37:
/home/aoqi/jdk/src/hotspot/share/runtime/javaFrameAnchor.hpp:36:7: error: forward declaration of 'class MacroAssembler'
 class MacroAssembler;
       ^
/home/aoqi/jdk/src/hotspot/share/runtime/stubRoutines.cpp: In destructor 'UnsafeCopyMemoryMark::~UnsafeCopyMemoryMark()':
   ... (rest of output omitted)

* All command lines available in /home/aoqi/jdk/build/linux-x86_64-minimal-release/make-support/failure-logs.
=== End of repeated output ===

No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See doc/building.html#troubleshooting for assistance.

make[1]: *** [main] Error 1
make: *** [images] Error 2

Comments
Fix Request (13u, 11u) Applies cleanly, need for arm32/64 build fix
04-08-2021

Errors of building zero are different with building minimal. I filed another issue (JDK-8226878) to track the zero crash.
27-06-2019