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

2017-08-29 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx |3 ++-
 jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx |7 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit a2fb0739bd1a9823f9b52f8efabae0bcf9ff6b0c
Author: Stephan Bergmann 
Date:   Mon Aug 28 15:35:43 2017 +0200

tdf#100501: Adapt to Java 9 (at least on Linux x86-64)

Checking with both jdk-9+181_linux-x64_bin.tar.gz and
jre-9+181_linux-x64_bin.tar.gz as currently available at
 "JDK 9 Early-Access Builds":

For one, make SunVersion::init understand 
"JEP 223: New Version-String Scheme" at least insofar as to accept strings 
like
"9" with less than three dot-separated segments (where the missing segments 
are
treated like "0").

For another, at least for Linux x86-64, libjvm.so is now apparently located 
in a
path without an "amd64" architecture segment, "lib/server/libjvm.so".  (But
could that also be "client"?)  Other platforms may need further adjustments.

(cherry picked from commit 52ffad9bb7be800790de6d918154dbeade88cadd, plus
cda4cea7cdfc9a8de814b901b3b957f029d36aaf "tdf#100501: Fix thinko")
Reviewed-on: https://gerrit.libreoffice.org/41678
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 
(cherry picked from commit c83aec1d026b9567e7e6d982e4d19f3a566b66d2)

Change-Id: Idcebc833472c81a1dc74dcdd481b0a37274a8713
Reviewed-on: https://gerrit.libreoffice.org/41700
Reviewed-by: Michael Stahl 
Tested-by: Jenkins 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
index 7f7c4943c8be..7543f497eb83 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx
@@ -68,7 +68,8 @@ char const* const* SunInfo::getRuntimePaths(int * size)
 "/lib/" JFW_PLUGIN_ARCH "/client/libjvm.so",
 "/lib/" JFW_PLUGIN_ARCH "/server/libjvm.so",
 "/lib/" JFW_PLUGIN_ARCH "/classic/libjvm.so",
-"/lib/" JFW_PLUGIN_ARCH "/jrockit/libjvm.so"
+"/lib/" JFW_PLUGIN_ARCH "/jrockit/libjvm.so",
+"/lib/server/libjvm.so"
 #endif
 };
 *size = SAL_N_ELEMENTS(ar);
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
index b4ad7019d449..2aedaa29938c 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
@@ -88,7 +88,7 @@ bool SunVersion::init(const char *szVersion)
 ! (nPartPos == 0) // prevents: ".4.1", "..1", part must start with 
digit
 && (
 //separators after maintenance (1.4.1_01, 1.4.1-beta, or 1.4.1)
-((pCur == pEnd || *pCur == '_' || *pCur == '-') && (nPart == 2 
))
+(pCur == pEnd || *pCur == '_' || *pCur == '-')
 ||
 //separators between major-minor and minor-maintenance
 (nPart < 2 && *pCur == '.') )
@@ -96,6 +96,8 @@ bool SunVersion::init(const char *szVersion)
 //prevent 1.4.0. 1.4.0-
 pCur + 1 != pEnd || isdigit(*(pCur))) )
 {
+bool afterMaint = pCur == pEnd || *pCur == '_' || *pCur == '-';
+
 int len = pCur - pLast;
 if (len >= 127)
 return false;
@@ -106,6 +108,9 @@ bool SunVersion::init(const char *szVersion)
 pLast = pCur;
 
 m_arVersionParts[nPart] = atoi(buf);
+
+if (afterMaint)
+nPart = 2;
 nPart ++;
 nPartPos = 0;
 if (nPart == 3)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-03-22 Thread Michael Stahl
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c78d39066ace32e0324365bcf10882aa6e976a03
Author: Michael Stahl 
Date:   Wed Mar 22 00:35:19 2017 +0100

jvmfwk: fix JVM detection on 64-bit Windows

_WIN32 is also defined on 64-bit Windows so reorder these ifdefs.

Should i be surprised that this breaks several dbaccess tests
for me but all tinderboxes are green?

(regression from 9143dd4ebe37b608e43d04434cf831624bf55b65)

Change-Id: Id917952d3135768355af711688ff70bf6c019a6e
(cherry picked from commit 2aa20cfb7a11dd8d86372af4065a5887a0b752ca)
Reviewed-on: https://gerrit.libreoffice.org/35530
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Jenkins 

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index ef9da176ebc4..27b3ddcd7422 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -215,10 +215,10 @@ bool VendorBase::isValidArch() const
 // It is not defined what the exact values are.
 // Oracle JRE 8 has "x86" and "amd64", the others were found at 
http://lopica.sourceforge.net/os.html .
 // There might still be missing some options; we need to extend the check 
once we find out.
-#if defined _WIN32
-return m_sArch == "x86" || m_sArch == "i386" || m_sArch == "i686";
-#elif defined _WIN64
+#if defined _WIN64
 return m_sArch == "amd64" || m_sArch == "x86_64";
+#elif defined _WIN32
+return m_sArch == "x86" || m_sArch == "i386" || m_sArch == "i686";
 #else
 (void)this;
 return true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-02-27 Thread Stephan Bergmann
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit 90c7d328f3fca95f140affb5dd83622ae3b988c9
Author: Stephan Bergmann 
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 
Tested-by: Jenkins 

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);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits