Skip to content

Commit c7c3aed

Browse files
committed
Fix architecture error for Windows.
1 parent 162d5c0 commit c7c3aed

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/c/codegen/CCompilerInvoker.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,12 @@ protected CompilerInfo createCompilerInfo(Path compilerPath, Scanner scanner) {
159159
scanner.nextLine(); // skip blank separator line
160160
skipLineIfHasNext(scanner, "detect-cl-version-info.c");
161161
scanner.nextLine(); // skip blank separator line
162-
skipLineIfHasNext(scanner, "M_X64=100"); // _M_X64 is defined
163-
skipLineIfHasNext(scanner, "M_ARM64EC=_M_ARM64EC"); // _M_ARM64EC is not defined
162+
try {
163+
skipLineIfHasNext(scanner, "M_X64=100"); // _M_X64 is defined
164+
skipLineIfHasNext(scanner, "M_ARM64EC=_M_ARM64EC"); // _M_ARM64EC is not defined
165+
} catch (NoSuchElementException e) {
166+
throw UserError.abort("Native Image on Windows currently only supports target architecture: %s", AMD64.class.getSimpleName());
167+
}
164168
if (scanner.findInLine("MSC_FULL_VER=") == null) {
165169
return null;
166170
}
@@ -195,11 +199,6 @@ protected void verify() {
195199
UserError.abort("On Windows, GraalVM Native Image for JDK %s requires %s or later (C/C++ Optimizing Compiler Version %s.%s or later).%nCompiler info detected: %s",
196200
JavaVersionUtil.JAVA_SPEC, VISUAL_STUDIO_MINIMUM_REQUIRED_VERSION, minimumMajorVersion, minimumMinorVersion, compilerInfo.getShortDescription());
197201
}
198-
if (guessArchitecture(compilerInfo.targetArch) != AMD64.class) {
199-
String targetPrefix = compilerInfo.targetArch.matches("(.*x|i\\d)86$") ? "32-bit architecture " : "";
200-
UserError.abort("Native-image building on Windows currently only supports target architecture: %s (%s%s unsupported)",
201-
AMD64.class.getSimpleName(), targetPrefix, compilerInfo.targetArch);
202-
}
203202
}
204203

205204
@Override

0 commit comments

Comments
 (0)