< prev index next >

test/compiler/aot/AotCompiler.java

Print this page
rev 13534 : 8187020: AOT tests should not fail if devkit dependency isn't resolved
Reviewed-by: duke

@@ -145,17 +145,20 @@
                 + " [-compile <compileItems>]* [-extraopt <java option>]*");
     }
 
     public static String resolveLinker() {
         Path linker = null;
-        // 1st, check if PATH has ld
+        // if non windows, 1st, check if PATH has ld
+        if (!Platform.isWindows()) {
+            String bin = "ld";
         for (String path : System.getenv("PATH").split(File.pathSeparator)) {
-            if (Files.exists(Paths.get(path).resolve("ld"))) {
-                // there is ld in PATH, jaotc is supposed to find it by its own
+                if (Files.exists(Paths.get(path).resolve(bin))) {
+                    // there is linker in PATH, jaotc is supposed to find it by its own
                 return null;
             }
         }
+        }
         // there is no ld in PATH, will use ld from devkit
         // artifacts are got from common/conf/jib-profiles.js
         try {
             if (Platform.isWindows()) {
                 if (Platform.isX64()) {

@@ -273,11 +276,13 @@
                     linker = devkit.resolve("bin")
                                    .resolve("ld");
                 }
             }
         } catch (FileNotFoundException e) {
-            throw new Error("artifact resolution error: " + e, e);
+            System.err.println("artifact resolution error: " + e);
+            // let jaotc try to find linker
+            return null;
         }
         if (linker != null) {
             return linker.toAbsolutePath().toString();
         }
         return null;
< prev index next >