|
39 | 39 | import java.util.List; |
40 | 40 | import java.util.function.Predicate; |
41 | 41 |
|
42 | | -import com.oracle.svm.core.c.libc.MuslLibC; |
43 | 42 | import org.graalvm.collections.EconomicMap; |
44 | 43 | import org.graalvm.collections.UnmodifiableEconomicMap; |
45 | 44 | import org.graalvm.compiler.api.replacements.Fold; |
|
55 | 54 | import org.graalvm.nativeimage.Platforms; |
56 | 55 |
|
57 | 56 | import com.oracle.svm.core.c.libc.LibCBase; |
| 57 | +import com.oracle.svm.core.c.libc.MuslLibC; |
58 | 58 | import com.oracle.svm.core.deopt.DeoptimizationSupport; |
59 | 59 | import com.oracle.svm.core.heap.ReferenceHandler; |
60 | 60 | import com.oracle.svm.core.option.APIOption; |
|
67 | 67 | import com.oracle.svm.core.thread.VMOperationControl; |
68 | 68 | import com.oracle.svm.core.util.UserError; |
69 | 69 | import com.oracle.svm.core.util.VMError; |
| 70 | +import com.oracle.svm.util.ModuleSupport; |
| 71 | +import com.oracle.svm.util.ReflectionUtil; |
70 | 72 |
|
71 | 73 | import jdk.internal.misc.Unsafe; |
72 | 74 |
|
@@ -530,7 +532,13 @@ public static long getTearDownFailureNanos() { |
530 | 532 | @Override |
531 | 533 | protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, String oldValue, String newValue) { |
532 | 534 | if ("llvm".equals(newValue)) { |
533 | | - if (ModuleLayer.boot().findModule("org.graalvm.nativeimage.llvm").isEmpty()) { |
| 535 | + boolean isLLVMBackendMissing; |
| 536 | + if (ModuleSupport.modulePathBuild) { |
| 537 | + isLLVMBackendMissing = ModuleLayer.boot().findModule("org.graalvm.nativeimage.llvm").isEmpty(); |
| 538 | + } else { |
| 539 | + isLLVMBackendMissing = ReflectionUtil.lookupClass(true, "com.oracle.svm.core.graal.llvm.LLVMFeature") == null; |
| 540 | + } |
| 541 | + if (isLLVMBackendMissing) { |
534 | 542 | throw UserError.abort("Please install the LLVM backend for GraalVM Native Image via `$JAVA_HOME/bin/gu install native-image-llvm-backend`."); |
535 | 543 | } |
536 | 544 |
|
|
0 commit comments