Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Native Image] #10753

Open
1 task
wuxindao opened this issue Feb 25, 2025 · 0 comments
Open
1 task

[Native Image] #10753

wuxindao opened this issue Feb 25, 2025 · 0 comments

Comments

@wuxindao
Copy link

Describe the Issue

Failed generating 'mysql-server' after 2m 2s.

The build process encountered an unexpected error:

java.lang.RuntimeException: There was an error linking the native image: Linker command exited with 2
C:\java\graalvm-jdk-21.0.6+8.1\lib\svm\clibraries\windows-amd64\jvm.lib
????????? C:\Users\admin\AppData\Local\Temp\SVM-12951718054456300078\mysql-server.lib ????? C:\Users\admin\AppData\Local\Temp\SVM-12951718054456300078\mysql-server.exp
mysql-server.obj : error LNK2001: ??????????????? Java_java_lang_Thread_getStackTrace0
G:\gitee\wxd-gaming-maria-db\target\winfm\mysql-server.exe : fatal error LNK1120: 1 ?????????????????
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.image.NativeImageViaCC.handleLinkerFailure(NativeImageViaCC.java:202)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.image.NativeImageViaCC.runLinkerCommand(NativeImageViaCC.java:152)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.image.NativeImageViaCC.write(NativeImageViaCC.java:118)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:742)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:551)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:539)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:721)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:143)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:98)

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

G:\gitee\wxd-gaming-maria-db>java -version
java version "21.0.6" 2025-01-21 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.6+8.1 (build 21.0.6+8-LTS-jvmci-23.1-b55)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.6+8.1 (build 21.0.6+8-LTS-jvmci-23.1-b55, mixed mode, sharing)

Operating System and Version

windows11

Build Command

-H:+UnlockExperimentalVMOptions -H:+ReportExceptionStackTraces -H:-ParseRuntimeOptions -H:+AddAllCharsets --enable-http --enable-https --no-fallback --report-unsupported-elements-at-runtime --allow-incomplete-classpath --initialize-at-build-time=com.sh --initialize-at-run-time=com.sh --trace-class-initialization=com.sun.beans.introspect.ClassInfo --trace-class-initialization=com.sun.beans.introspect.MethodInfo --trace-class-initialization=com.sun.beans.TypeResolver --trace-class-initialization=java.beans.Introspector --trace-class-initialization=java.beans.ThreadGroupContext --trace-class-initialization=wxdgaming.mariadb --trace-object-instantiation=java.util.jar.JarFile --add-exports=java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Dlogback.configurationFile=logback.xml -Dfile.encoding=UTF-8 -Dio.netty.tryReflectionSetAccessible=true -H:NativeLinkerOption=/SUBSYSTEM:WINDOWS -H:NativeLinkerOption=/ENTRY:mainCRTStartup

Expected Behavior

output server.exe

Actual Behavior

error

Steps to Reproduce

w

Additional Context

No response

Build Log Output and Error Messages

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant