graal icon indicating copy to clipboard operation
graal copied to clipboard

[Native Image] Build fail with upcalls, windows platform and without x86-64-v3 support

Open MetsukiMio opened this issue 1 year ago • 2 comments

Describe the Issue

The native-image compiler couldn't deal with upcalls with 7 or more arguments on the windows platform, without x86-64-v3 support. It will throw an exception (should not reach here) On the linux platform, the execurable tells me that my machine doesn't support all the features in x86-64-v3, and the image can be rebuilt with -march=x86-64-v2 But on windows, it will throw this error

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

23.0.2+7.1

Operating System and Version

Windows 11 22H2

Build Command

native-image -O3 -march=x86-64-v2 --enable-http --enable-https --enable-native-access=ALL-UNNAMED -H:+UnlockExperimentalVMOptions -H:+ForeignAPISupport --features=com.primogemstudio.engine.NativeImageFeature --gc=serial -jar xxx.jar

hint: the jar file can be found at this link: https://github.com/PrimogemStudio/openminecraft/actions

Expected Behavior

It should create the image successfully

Actual Behavior

It throws an jdk.graal.compiler.debug.GraalError (should not reach here: kind=V128_QWORD input=xmm6|V128_QWORD result=xmm4|V128_QWORD)

Steps to Reproduce

  1. Register an upcall with 7 or more arguments (harfbuzz paint api contains these callbacks) in a feature
  2. Run the native-image with this feature

Additional Context

This error only happens on windows platform

Build Log Output and Error Messages

error.log.gz

MetsukiMio avatar Jan 31 '25 05:01 MetsukiMio

Hi @Jack253-png,

Thank you for reaching out to us! I'll take a closer look into this and I'll keep you updated.

selhagani avatar Feb 03 '25 18:02 selhagani

It seems that all upcalls on windows without x86-64-v3 support couldn't be compiled, because currently these upcall stub on windows depends on the xmm4 and xmm6 registers

MetsukiMio avatar Feb 04 '25 00:02 MetsukiMio