Many panama foreign tests fail on Mac after fix for JDK-8216485
SystemABI.getInstance() fails by throwing UnsupportedOperationException on Mac. This is because "os.arch" is checked to be "amd64" but on Mac "os.arch" value is "x86_64". The following change is needed to fix this issue:
hg diff
diff -r 59c605f5cfb5 src/java.base/share/classes/jdk/internal/foreign/abi/SystemABI.java
--- a/src/java.base/share/classes/jdk/internal/foreign/abi/SystemABI.java Fri Jan 11 17:18:11 2019 +0100
+++ b/src/java.base/share/classes/jdk/internal/foreign/abi/SystemABI.java Mon Jan 14 11:45:09 2019 +0530
@@ -126,7 +126,7 @@
static SystemABI getInstance() {
String arch = System.getProperty("os.arch");
String os = System.getProperty("os.name");
- if (arch.equals("amd64")) {
+ if (arch.equals("amd64") || arch.equals("x86_64")) {
if (os.startsWith("Windows")) {
return Windowsx64ABI.getInstance();
} else {
SystemABI.getInstance() fails by throwing UnsupportedOperationException on Mac. This is because "os.arch" is checked to be "amd64" but on Mac "os.arch" value is "x86_64". The following change is needed to fix this issue:
hg diff
diff -r 59c605f5cfb5 src/java.base/share/classes/jdk/internal/foreign/abi/SystemABI.java
--- a/src/java.base/share/classes/jdk/internal/foreign/abi/SystemABI.java Fri Jan 11 17:18:11 2019 +0100
+++ b/src/java.base/share/classes/jdk/internal/foreign/abi/SystemABI.java Mon Jan 14 11:45:09 2019 +0530
@@ -126,7 +126,7 @@
static SystemABI getInstance() {
String arch = System.getProperty("os.arch");
String os = System.getProperty("os.name");
- if (arch.equals("amd64")) {
+ if (arch.equals("amd64") || arch.equals("x86_64")) {
if (os.startsWith("Windows")) {
return Windowsx64ABI.getInstance();
} else {
- relates to
-
JDK-8216485 Binder changes are needed to support panama foreign API on Windows
-
- Resolved
-