Skip to content

Commit 083e7cf

Browse files
committed
[GR-41650] Adjust LLVM backend check for legacy classpath builds.
PullRequest: graal/12934
2 parents c207739 + 3e5ac66 commit 083e7cf

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import java.util.List;
4040
import java.util.function.Predicate;
4141

42-
import com.oracle.svm.core.c.libc.MuslLibC;
4342
import org.graalvm.collections.EconomicMap;
4443
import org.graalvm.collections.UnmodifiableEconomicMap;
4544
import org.graalvm.compiler.api.replacements.Fold;
@@ -55,6 +54,7 @@
5554
import org.graalvm.nativeimage.Platforms;
5655

5756
import com.oracle.svm.core.c.libc.LibCBase;
57+
import com.oracle.svm.core.c.libc.MuslLibC;
5858
import com.oracle.svm.core.deopt.DeoptimizationSupport;
5959
import com.oracle.svm.core.heap.ReferenceHandler;
6060
import com.oracle.svm.core.option.APIOption;
@@ -67,6 +67,8 @@
6767
import com.oracle.svm.core.thread.VMOperationControl;
6868
import com.oracle.svm.core.util.UserError;
6969
import com.oracle.svm.core.util.VMError;
70+
import com.oracle.svm.util.ModuleSupport;
71+
import com.oracle.svm.util.ReflectionUtil;
7072

7173
import jdk.internal.misc.Unsafe;
7274

@@ -530,7 +532,13 @@ public static long getTearDownFailureNanos() {
530532
@Override
531533
protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, String oldValue, String newValue) {
532534
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) {
534542
throw UserError.abort("Please install the LLVM backend for GraalVM Native Image via `$JAVA_HOME/bin/gu install native-image-llvm-backend`.");
535543
}
536544

0 commit comments

Comments
 (0)