$ sh ./configure --with-debug-level=slowdebug --disable-precompiled-headers --with-jvm-variants=minimal
Build fails:
* For target hotspot_variant-minimal_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link:
/home/shade/trunks/jdk-jdk/build/linux-x86_64-minimal-slowdebug/hotspot/variant-minimal/libjvm/objs/nmethod.o: In function `nmethod::post_compiled_method_load_event(JvmtiThreadState*)':
/home/shade/trunks/jdk-jdk/src/hotspot/share/code/nmethod.cpp:1597: undefined reference to `JvmtiThreadState::enqueue_event(JvmtiDeferredEvent*)'
collect2: error: ld returned 1 exit status
* For target hotspot_variant-minimal_libjvm_objs_BUILD_LIBJVM_link:
/home/shade/trunks/jdk-jdk/build/linux-x86_64-minimal-slowdebug/hotspot/variant-minimal/libjvm/objs/nmethod.o: In function `nmethod::post_compiled_method_load_event(JvmtiThreadState*)':
/home/shade/trunks/jdk-jdk/src/hotspot/share/code/nmethod.cpp:1597: undefined reference to `JvmtiThreadState::enqueue_event(JvmtiDeferredEvent*)'
collect2: error: ld returned 1 exit status
Simple fix:
diff -r e9a406eba26c src/hotspot/share/code/nmethod.cpp
--- a/src/hotspot/share/code/nmethod.cpp Tue Dec 17 11:24:28 2019 +0100
+++ b/src/hotspot/share/code/nmethod.cpp Tue Dec 17 19:33:11 2019 +0100
@@ -1592,11 +1592,11 @@
// (which is a real Java thread) post the event
JvmtiDeferredEvent event = JvmtiDeferredEvent::compiled_method_load_event(this);
if (state == NULL) {
ServiceThread::enqueue_deferred_event(&event);
} else {
- state->enqueue_event(&event);
+ JVMTI_ONLY(state->enqueue_event(&event);)
}
}
}
void nmethod::post_compiled_method_unload() {