summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-11-17 14:01:55 +0100
committerStephan Bergmann <sbergman@redhat.com>2021-11-17 16:53:47 +0100
commitf05a42ef8c8192186f91a169047742e5c3ae9b9e (patch)
tree55f8b3e2175d1b36fba94407a5381eda73017a21 /jvmfwk
parentf3bd9ef889d1834f7b1feb49197a58e679826c00 (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>
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 8863df3352ff..f4cf14a9ab3f 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -175,10 +175,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;