oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.36k stars 1.63k forks source link

[GR-30634] Native Linker - missing symbol when using JDK-16 Memory Model #3314

Open cnuernber opened 3 years ago

cnuernber commented 3 years ago

Describe the issue When compiling a codebase that uses the jdk-16 memory model into a native application you will get (at the very least) linker errors:

/usr/bin/ld: tech.v3.datatype.main.o:(.data+0xb28): undefined reference to `Java_jdk_internal_misc_ScopedMemoryAccess_closeScope0'

Steps to reproduce the issue

  1. Get JDK-16-enabled graalvm
  2. Use scoped memory segments in your application
  3. Compile to native application

Describe GraalVM and your environment:

More details

The follow on from this is going to be issues around using CLinker and various other classes from the foreign module.

oubidar-Abderrahim commented 3 years ago

Hi @cnuernber Is it possible for you to provide a small reproducer for this issue? that would be greatly helpful of you

cnuernber commented 3 years ago

My pleasure:

https://github.com/cnuernber/gn-issue-3314

mosheduminer commented 2 years ago

I'm facing this issue as well. Is this being worked on?

I'm using graal 21.3, jdk 17.

mosheduminer commented 2 years ago

I'm still having this issue with graalvm-ce-java17-22.0.0.2.

oubidar-Abderrahim commented 2 years ago

Yes, the issue is tracked internally on GR--30634

pjonsson commented 1 year ago

Recently started using Arena that is closed after use, and ran into this. Is there a workaround besides not closing the arena?

Varstahl commented 3 months ago

For the others that may currently have the same issue I just wanted to point out that it still persists with JDK 21, but I worked around it by using Corretto JDK 22, unsure if the pure JDK 22 also works.

Now compiles like a charm.