JLang icon indicating copy to clipboard operation
JLang copied to clipboard

dynamic loader gives an error showing version 'SUNWprivate_1_1' not found in jdk1.7.0

Open JianpingZeng opened this issue 4 years ago • 7 comments

Hi, I am trying to build and run unit tests. But I encountered the following error when I tried to run the generated binary on the Ubuntu 16.04 + X86 platform with recommended clang+llvm 5.0.1.

./Add.binary: /home/xlous/Development/Compiler/JLang/runtime/out/libjvm.so: version `SUNWprivate_1.1' not found (required by /usr/lib/jdk/jdk1.7.0/jre/lib/amd64/libjava.so)

BTW, I solved three compilation problems on my Ubuntu 16.06 system.

  1. the --version-script=linux_version.map linker options defined in the defs.Linux should be removed for successfully building the project.
  2. It is required to add an -ldl option in the tests/isolated/Makefile to build the binary for unit tests.
  3. Any version of JDK higher than the 1.7.10 can not be used for compiling the project because there are some internal API functions, such as JPEG, etc, used by java library have been removed in any version of JDK newer than the JDK 1.7.10 (included). I successfully built the project with oracle JDK 1.7.0.

Thanks, Jianping.

JianpingZeng avatar Dec 01 '19 21:12 JianpingZeng

The reason you're having the linking problem is because you removed the --version-script=linux_version.map

What errors were you getting by building JLang with that included? I've also tested on an Ubuntu 16.06 system and had no problems so I'm curious as to what exact errors you're running into.

dz333 avatar Dec 03 '19 16:12 dz333

The linker gives me an error "/usr/bin/ld: error: linux_version.map:24:4: invalid character" BTW, a minor typo in my previous reply. My OS version is Ubuntu 16.04.

JianpingZeng avatar Dec 05 '19 15:12 JianpingZeng

I solved that problem which is caused by an extra newline character at the end of the linux_version.map. Just delete it. It would be fine!

JianpingZeng avatar Dec 05 '19 15:12 JianpingZeng

But, there is another problem happens when I try to run make tests even with the modified linux_version.map used.

./Subtype.binary: relocation error: /usr/lib/jdk/jdk1.7.0/jre/lib/amd64/libjava.so: symbol JVM_GetClassLoader, version SUNWprivate_1.1 not defined in file libjvm.so with link time reference

JianpingZeng avatar Dec 05 '19 15:12 JianpingZeng

Ah ok, thanks for the clarification. I don't have an Ubuntu16.04 system to reproduce this on myself at the moment so I won't be able to help debug this right away.

But, what it looks like is happening is the JLang runtime wasn't recompiled after you updated the linux_version.map file.If so, then running make clean and then rebuilding should solve this but I can't say for sure. If it isn't that then I'll have to do a bit more digging.

dz333 avatar Dec 05 '19 19:12 dz333

I have cleaned everything and recompiled it. The same problem is there.

JianpingZeng avatar Dec 06 '19 02:12 JianpingZeng

Ah I think the problem is with the minor version of the JDK that you're using. The best supported JDK is this one here: https://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html

I believe that the version you have is probably not the same as this one.

In the future we are planning to make JLang more portable across these kinds of small changes but it's difficult based on how the internal JVM interfaces aren't actually intended to be stable or portable across versions.

dz333 avatar Dec 12 '19 21:12 dz333