You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the issue
I am trying to figure out how I can compile a static library (COFF file) when building with native-image. Is this possible? I have been trying to play around with --static and --shared but I am not allowed to use both. I also tried to use --native-compiler-options=-c. My ultimate goal is to generate a static library (.a) file from this.
Steps to reproduce the issue
Please include both build steps as well as run steps
Compile this HelloWorld.java using: javac HelloWorld
$ native-image --native-compiler-options=-c HelloWorld
========================================================================================================================
GraalVM Native Image: Generating 'helloworld' (executable)...
========================================================================================================================
[1/8] Initializing...
(0.0s @ 0.09GB)
------------------------------------------------------------------------------------------------------------------------
0.3s (9.2% of total time) in 11 GCs | Peak RSS: 0.45GB | CPU load: 4.06
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
/home/user/Downloads/helloworld/svm_err_b_20240908T023752.138_pid990389.md (build_info)
========================================================================================================================
Failed generating 'helloworld' after 2.4s.
The build process encountered an unexpected error:
> com.oracle.svm.core.util.VMError$HostedError: Unable to run '/tmp/SVM-1725755871806/JNIHeaderDirectives' to compute offsets in C data structures. Is it possible that your antivirus software interferes and puts the resulting file into quarantine?
Please inspect the generated error report at:
/home/user/Downloads/helloworld/svm_err_b_20240908T023752.138_pid990389.md
If you are unable to resolve this problem, please file an issue with the error report at:
https://graalvm.org/support
Describe GraalVM and your environment:
Oracle GraalVM 17.0.12+8.1
JDK major version: Java version: 17.0.12+8-LTS
OS: Linux / Ubuntu
Architecture: AMD64
More details
N/A
The text was updated successfully, but these errors were encountered:
Thank you for reaching out to us! Unfortunately, native-image does not support generating static libraries like that. The native-image tool is designed primarily for producing native executables, and while it can generate shared libraries using the --shared option, it does not support generating static libraries since --static is meant for producing static executables, not libraries. Also The --static and --shared options cannot be used together.
Describe the issue
I am trying to figure out how I can compile a static library (COFF file) when building with native-image. Is this possible? I have been trying to play around with
--static
and--shared
but I am not allowed to use both. I also tried to use--native-compiler-options=-c
. My ultimate goal is to generate a static library (.a) file from this.Steps to reproduce the issue
Please include both build steps as well as run steps
javac HelloWorld
native-image --native-compiler-options=-c HelloWorld
Describe GraalVM and your environment:
More details
N/A
The text was updated successfully, but these errors were encountered: