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

Fatal error: com.oracle.svm.core.util.VMError$HostedError: Option name "UseLibC" has multiple definitions #10266

Closed
1 task done
rawoof-git opened this issue Dec 9, 2024 · 1 comment
Assignees

Comments

@rawoof-git
Copy link

Describe the Issue

Getting below error while building native-image
Fatal error: com.oracle.svm.core.util.VMError$HostedError: Option name "UseLibC" has multiple definitions: com.oracle.svm.hosted.c.libc.HostedLibCFeature$LibCOptions.UseLibC and com.oracle.svm.core.posix.linux.libc.LibCFeature$LibCOptions.UseLibC
at com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:72)
at com.oracle.svm.hosted.option.HostedOptionParser.lambda$collectOptions$0(HostedOptionParser.java:77)
at com.oracle.svm.common.option.CommonOptionParser.collectOptions(CommonOptionParser.java:173)
at com.oracle.svm.core.option.SubstrateOptionsParser.collectOptions(SubstrateOptionsParser.java:118)
at com.oracle.svm.hosted.option.HostedOptionParser.collectOptions(HostedOptionParser.java:66)
at com.oracle.svm.hosted.option.HostedOptionParser.(HostedOptionParser.java:61)
at com.oracle.svm.hosted.NativeImageClassLoaderSupport.setupHostedOptionParser(NativeImageClassLoaderSupport.java:189)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.installNativeImageClassLoader(NativeImageGeneratorRunner.java:186)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:129)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:94)
at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:626)

GraalVM version : 17.0.12

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

GraalVM version : 17.0.12

Operating System and Version

Windows 11

Build Command

mvn clean -Pnative native:compile

Expected Behavior

should create native image

Actual Behavior

Getting exception after few steps

Steps to Reproduce

Add below plugin and try to create image

org.graalvm.buildtools native-maven-plugin 0.10.0
    <mainClass>com.test.Hello</mainClass>
    <buildArgs>
        --no-fallback
        <arg>--add-exports=jdk.internal.vm.compiler/org.graalvm.compiler.options=ALL-UNNAMED</arg>
    </buildArgs>
</configuration>
<executions>
    <execution>
        <id>build-native</id>
        <goals>
            <goal>compile-no-fork</goal>
        </goals>
        <phase>package</phase>
    </execution>
</executions>
        </plugin> 

Additional Context

No response

Build Log Output and Error Messages

No response

@fernando-valdez
Copy link
Member

Hi @rawoof-git, thanks for reporting this issue. The error indicates that the UseLibC option is defined more than once in the GraalVM native image build configuration. Can you please confirm that UseLibC is defined only once in your build configuration?

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

2 participants