[11u] Remove the Experimental AOT and JIT Compiler

Hohensee, Paul hohensee at amazon.com
Wed Oct 27 19:47:51 UTC 2021


Oracle has removed the Experimental AOT and JIT Compiler (Graal compiler) in 11.0.13, see

https://www.oracle.com/java/technologies/javase/11all-relnotes.html#R11_0_13

There doesn’t appear to be a JBS issue for this. I.e., there’s no 11.0.13 backport issue for

https://bugs.openjdk.java.net/browse/JDK-8263327

or its sub-tasks.

But, the Graal team seems to be maintaining an 11u port, see

https://github.com/graalvm/labs-openjdk-11

The current OpenJDK 11u implementation breaks the MacOS port on Big Sur 11.0.1. We have a patch (see below) which we can submit to the Graal project.

The larger question is, do the Maintainers want to follow Oracle and remove the Graal compiler from 11u? If not, we’ll also file a JBS issue against OpenJDK 11u.

Thanks,
Paul


diff --git a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Linker.java b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Linker.java
index 92c80aad397..d0a01eeb3a6 100644
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Linker.java
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Linker.java
@@ -97,8 +97,9 @@ final class Linker {
                     objectFileName = name.substring(0, name.length() - ".dylib".length());
                 }
                 objectFileName = objectFileName + ".o";
+                Path libPath = Paths.get(getMacOSLibPath().toString(), "usr/lib");
                 linkerPath = (options.linkerpath != null) ? options.linkerpath : "ld";
-                linkerCmd = linkerPath + " -dylib -o " + libraryFileName + " " + objectFileName;
+                linkerCmd = linkerPath + " -dylib -o " + libraryFileName + " " + objectFileName + " -L" + libPath.toString() + " -lSystem";
                 linkerCheck = linkerPath + " -v";
                 break;
             default:
@@ -266,5 +267,21 @@ final class Linker {
             return wkp;
         }
     }
+
+    private static Path getMacOSLibPath() throws Exception {
+        ProcessBuilder processBuilder = new ProcessBuilder("xcrun", "--show-sdk-path");
+        processBuilder.redirectOutput(ProcessBuilder.Redirect.PIPE);
+        processBuilder.redirectError(ProcessBuilder.Redirect.PIPE);
+        Process process = processBuilder.start();
+        final int exitCode = process.waitFor();
+        if (exitCode != 0) {
+            String errorMessage = getString(process.getErrorStream());
+            if (errorMessage.isEmpty()) {
+                errorMessage = getString(process.getInputStream());
+            }
+            throw new IllegalStateException("xcrun could not find path for SDK. Error: " + errorMessage);
+        }
+        return Paths.get(getLines(process.getInputStream()).findFirst().orElseThrow(() -> new IllegalStateException("Unexpected empty output from xcrun")));
+    }
     // @formatter:on
}



More information about the jdk-updates-dev mailing list