graal icon indicating copy to clipboard operation
graal copied to clipboard

`Could not find any unresolved JVM_* symbols in static JDK libraries`

Open Melab opened this issue 3 years ago • 2 comments

Attempting to build GraalVM according to the instructions found in vm/README.md fails:

$ mx --dynamicimports /substratevm,/tools,/sulong,/graal-js --exclude-components=nju,nic,ni,nil,llp --force-bash-launcher=polyglot build 2>&1 | tee log.txtJAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64
15 unsatisfied dependencies were removed from build (use -v to list them)
52 non-default dependencies were removed from build (use -v to list them, mx build --all to build them)
WARNING: Adding non-default dependency com.oracle.svm.graal.hotspot.libgraal as it is needed by standard dependency GRAAL_HOTSPOT_LIBRARY
WARNING: Adding non-default dependency GRAAL_HOTSPOT_LIBRARY as it is needed by standard dependency jvmcicompiler-library_native-image.properties
Downloading LLVM_ORG from ['https://lafo.ssw.uni-linz.ac.at/pub/llvm-org/llvm-llvmorg-14.0.3-2-g772a7a659e-bgd661ed0276-linux-amd64.tar.gz']
JvmFuncsFallbacksBuildTask svm-jvmfuncs-fallback-builder... [/media/main/code/graal/substratevm/mxbuild/jdk11/svm-jvmfuncs-fallback-builder/src_gen/JvmFuncsFallbacks.c does not exist]
Could not find any unresolved JVM_* symbols in static JDK libraries

I think I had already run it once before, thus explaining the lack of download messages.

Tangential: Also, how would I just build the JS launcher without Node?

Melab avatar Jul 24 '22 23:07 Melab

Your JDK probably doesn't include static libraries. Check: ls $JAVA_HOME/lib/*.a

petermz avatar Jul 25 '22 11:07 petermz

Your JDK probably doesn't include static libraries. Check: ls $JAVA_HOME/lib/*.a

You are correct. There are no static libraries there. Are there supposed to be?

Melab avatar Jul 30 '22 03:07 Melab

I'm also running into the same issue, using the corretto 11 JVM on macOS. Anyone find a solution?

copumpkin avatar Oct 04 '22 14:10 copumpkin

You are correct. There are no static libraries there. Are there supposed to be?

Not necessarily for running a regular Java program, but GraalVM needs that. Solutions include:

  1. use a LabsJDK e.g. https://github.com/graalvm/labs-openjdk-19/releases (actually I'm not sure if their release contains shared libraries, but labsjdk are indeed for building graalvm)
  2. build a jdk with shared library (by cd jdk && sh configure <args> && make graal-builder-image)

oraluben avatar Oct 08 '22 07:10 oraluben

Neither the OpenJDK labs releases nor the results of mx fetch-jdk work for me -- both end with Could not find any unresolved JVM_* symbols in static JDK libraries when trying to mx build SubstrateVM.

tekknolagi avatar Jan 17 '23 23:01 tekknolagi

Looks like labsjdk-ce-19 does not work but labsjdk-ce-20 does.

tekknolagi avatar Jan 18 '23 00:01 tekknolagi

For me building OpenJDK (I used jdk-20+36) as @oraluben described in his second solution worked just fine. Build OpenJDK, set JAVA_HOME to <OpenJDK repo>/build/<system-specific dir>/images/graal-builder-jdk, and build GraalVM.

TimPushkin avatar Aug 13 '23 12:08 TimPushkin