[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - jvmfwk/plugins

Stephan Bergmann sbergman at redhat.com
Mon Feb 27 11:46:12 UTC 2017


 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 90c7d328f3fca95f140affb5dd83622ae3b988c9
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 24 17:00:28 2017 +0100

    Make JVM -Xrunjdwp option work on macOS
    
    I hope loading the jvm library as SAL_LOADMODULE_GLOBAL has no negative
    consequences (at least, there is prior art in the LINUX case already).
    
    Change-Id: If18b65bd96f7205fdf9fd41389e64e786c15af16
    (cherry picked from commit f21994e7a240563283b7a17dcb435ce7c5156b60)
    Reviewed-on: https://gerrit.libreoffice.org/34676
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 5053fda..63791bc 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -670,6 +670,16 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
     osl::Module moduleRt;
 #if defined(LINUX)
     if (!moduleRt.load(sRuntimeLib, SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_NOW))
+#elif defined MACOSX
+    // Must be SAL_LOADMODULE_GLOBAL when e.g. specifying a
+    // -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 option to
+    // JDK 1.8.0_121 at least, as JNI_CreateJavaVM -> Threads::create_vm ->
+    // JvmtiExport::post_vm_initialized -> cbEarlyVMInit -> initialize ->
+    // util_initialize -> sun.misc.VMSupport.getAgentProperties ->
+    // Java_sun_misc_VMSupport_initAgentProperties ->
+    // JDK_FindJvmEntry("JVM_INitAgentProperties") ->
+    // dlsym(RTLD_DEFAULT, "JVM_INitAgentProperties"):
+    if (!moduleRt.load(sRuntimeLib, SAL_LOADMODULE_GLOBAL))
 #else
 #if defined(_WIN32)
     do_msvcr_magic(sRuntimeLib.pData);


More information about the Libreoffice-commits mailing list