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

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

Open
JianpingZeng opened this issue Dec 1, 2019 · 7 comments

Comments

@JianpingZeng
Copy link

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.

@dz333
Copy link
Collaborator

dz333 commented Dec 3, 2019

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.

@JianpingZeng
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@dz333
Copy link
Collaborator

dz333 commented Dec 5, 2019

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.

@JianpingZeng
Copy link
Author

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

@dz333
Copy link
Collaborator

dz333 commented Dec 12, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants