summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-11-17 14:01:55 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-18 15:00:37 +0100
commita7e36439bc79580b92e4b2636a831b1b0e64c6e8 (patch)
tree21f663c973588b2ddb4212201d96b57842a9196e /jvmfwk
parent7153209d9aa34d92141ae29afa98ad5262da5d9c (diff)
tdf#144695 VendorBase::isValidArch also for macOS
Lets extend it only to macOS (where there is some confusion now with Rosetta- translated vs. native processes on Apple M1 machines), not to all Unix-like OSs: The comment that it "is not defined what the exact [os.arch] values are" is still relevant. At least for OpenJDK, while Windows has a hardcoded list of possible values in GetJavaProperties at <https://github.com/openjdk/jdk/blob/9604ee82690f89320614b37bfef4178abc869777/src/java.base/windows/native/libjava/java_props_md.c#L568>, the corresponding non-Windows code in GetJavaProperties at <https://github.com/openjdk/jdk/blob/319a3b994703aac84df7bcde272adfcb3cdbbbf0/jdk/src/solaris/native/java/lang/java_props_md.c#L175> uses ARCHPROPNAME which, via > -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"' at <https://github.com/openjdk/jdk/blob/c363db8ed00ff27eadf06294364d908d6a7d03a6/jdk/makefiles/CompileNativeLibraries.gmk#L185>, appears to somehow come out of Autoconf at <https://github.com/openjdk/jdk/blob/228c21635b011fbf956b83a0b07fc297e9a34c46/common/autoconf/spec.gmk.in#L93>, so probably can show some variance in actual values being used. Change-Id: I16725cd9365f6bd034372c653aa43ab84d487b98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125401 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit f05a42ef8c8192186f91a169047742e5c3ae9b9e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125363 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 4bfc1fd90af0..1f2a5f756280 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -176,10 +176,12 @@ 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 _WIN64
+#if defined _WIN64 || (defined MACOSX && defined __x86_64__)
return m_sArch == "amd64" || m_sArch == "x86_64";
#elif defined _WIN32
return m_sArch == "x86" || m_sArch == "i386" || m_sArch == "i686";
+#elif defined MACOSX && defined __aarch64__
+ return m_sArch == "aarch64";
#else
(void)this;
return true;