graal icon indicating copy to clipboard operation
graal copied to clipboard

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

Open cnuernber opened this issue 3 years ago • 7 comments

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:

  • GraalVM version graalvm-ce-java16-21.1.0-dev using included java for jdk-16 access.
  • OS: Ubuntu
  • Architecture: AMD64

More details

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

cnuernber avatar Mar 27 '21 12:03 cnuernber

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

oubidar-Abderrahim avatar Mar 30 '21 10:03 oubidar-Abderrahim

My pleasure:

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

cnuernber avatar Mar 30 '21 13:03 cnuernber

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

I'm using graal 21.3, jdk 17.

mosheduminer avatar Nov 29 '21 21:11 mosheduminer

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

mosheduminer avatar Jan 26 '22 11:01 mosheduminer

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

oubidar-Abderrahim avatar Jan 27 '22 11:01 oubidar-Abderrahim

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

pjonsson avatar Sep 11 '23 20:09 pjonsson

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.

Varstahl avatar Jul 10 '24 15:07 Varstahl