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

jre/lib/s390x/compressedrefs/libjvm.so missing libdl reference #25

Closed
nealef opened this issue Oct 3, 2019 · 15 comments
Closed

jre/lib/s390x/compressedrefs/libjvm.so missing libdl reference #25

nealef opened this issue Oct 3, 2019 · 15 comments
Assignees
Labels

Comments

@nealef
Copy link

nealef commented Oct 3, 2019

Platform:
Linux

Architecture:
s390x

The libjvm.so found in the java-8 compressedrefs directory doesn't reference libdl so that linking against it results in unresolved references to things like dlopen. Adding -ldl circumvents this but the other libjvm.so that are part of the tarball have been linked against the library:

$ ldd jre/lib/s390x/compressedrefs/libjvm.so
	libpthread.so.0 => /lib/s390x-linux-gnu/libpthread.so.0 (0x000003ff93880000)
	libm.so.6 => /lib/s390x-linux-gnu/libm.so.6 (0x000003ff93780000)
	libc.so.6 => /lib/s390x-linux-gnu/libc.so.6 (0x000003ff93580000)
	/lib/ld64.so.1 (0x000003ff93a00000)

$ nm jre/lib/s390x/compressedrefs/libjvm.so | grep dlopen
                 U dlopen

$ ldd jre/lib/s390x/j9vm/libjvm.so
	libdl.so.2 => /lib/s390x-linux-gnu/libdl.so.2 (0x000003ff9ec00000)
	libm.so.6 => /lib/s390x-linux-gnu/libm.so.6 (0x000003ff9eb00000)
	libc.so.6 => /lib/s390x-linux-gnu/libc.so.6 (0x000003ff9e900000)
	/lib/ld64.so.1 (0x000003ff9ed80000)

$ nm jre/lib/s390x/j9vm/libjvm.so | grep dlopen
                 U dlopen@@GLIBC_2.2

Is there a reason for this difference? Although it can be circumvented building packages like hadoop requires changes to the canonical sources which is never a great thing to have to do and doesn't happen when using the standard java-1.8.0-openjdk that comes with the distros.

@karianna
Copy link
Contributor

karianna commented Oct 4, 2019

@nealef Can you give us the output of java --version?

@nealef
Copy link
Author

nealef commented Oct 4, 2019

OpenJDK Runtime Environment (build 1.8.0_222-b10)
Eclipse OpenJ9 VM (build openj9-0.15.1, JRE 1.8.0 Linux s390x-64-Bit Compressed References 20190717_371 (JIT enabled, AOT enabled)
OpenJ9   - 0f66c6431
OMR      - ec782f26
JCL      - f147086df1 based on jdk8u222-b10)

@keithc-ca
Copy link

jre/lib/s390x/compressedrefs/libjvm.so is an implementation detail of OpenJ9. You should be linking against one of these:

jre/lib/s390x/server/libjvm.so
jre/lib/s390x/j9vm/libjvm.so

both of which reference libdl.so:

$ ldd jre/lib/s390x/server/libjvm.so jre/lib/s390x/j9vm/libjvm.so
j9vm/libjvm.so:
	libdl.so.2 => /lib/s390x-linux-gnu/libdl.so.2 (0x000003ff9e800000)
	libm.so.6 => /lib/s390x-linux-gnu/libm.so.6 (0x000003ff9e700000)
	libc.so.6 => /lib/s390x-linux-gnu/libc.so.6 (0x000003ff9e500000)
	/lib/ld64.so.1 (0x000003ff9e980000)
server/libjvm.so:
	libdl.so.2 => /lib/s390x-linux-gnu/libdl.so.2 (0x000003ffbc600000)
	libm.so.6 => /lib/s390x-linux-gnu/libm.so.6 (0x000003ffbc500000)
	libc.so.6 => /lib/s390x-linux-gnu/libc.so.6 (0x000003ffbc300000)
	/lib/ld64.so.1 (0x000003ffbc780000)

@nealef
Copy link
Author

nealef commented Oct 4, 2019

True, but unfortunately tools like cmake's find_library() macro will find it ahead of the others. So building things like hadoop 3.2.0 will be problematic against the openj9 variant.

@keithc-ca
Copy link

I suggest that is a bug in cmake.

@nealef
Copy link
Author

nealef commented Oct 4, 2019

It can be coded around in a cmake receipt by specifying the search order. However, what I had liked about Adopt openjdk was that it didn't matter if you were using hotspot or openj9 things would just work. Now we have to add exceptions in existing package builds to use it. That means generating PRs that maintainers may or may not want to apply. Does the compressedrefs/libjvm.so have to live in jre/lib/<arch>/ part of the tree? Does it have to have that exact name?

@keithc-ca
Copy link

eclipse-openj9/openj9#7355 proposes that it be renamed.

@nealef
Copy link
Author

nealef commented Oct 4, 2019

Perfect! Thank you so much.

@sxa
Copy link
Member

sxa commented Dec 6, 2019

Problems have been found trying to do this across platforms as per eclipse-openj9/openj9#7380 (comment) so this fix is still on hold

@sxa sxa transferred this issue from adoptium/temurin-build Dec 6, 2019
@karianna karianna added this to the January 2020 milestone Jan 4, 2020
@karianna karianna modified the milestones: January 2020, February 2020 Feb 3, 2020
@karianna karianna modified the milestones: February 2020, March 2020 Mar 6, 2020
@karianna karianna modified the milestones: March 2020, April 2020 Apr 1, 2020
@karianna karianna modified the milestones: April 2020, May 2020 May 1, 2020
@karianna karianna modified the milestones: May 2020, June 2020 Jun 4, 2020
@karianna karianna modified the milestones: June 2020, July 2020 Jul 1, 2020
@karianna karianna modified the milestones: July 2020, August 2020 Aug 2, 2020
@karianna karianna added this to the October 2020 milestone Oct 5, 2020
@karianna karianna modified the milestones: October 2020, November 2020 Nov 3, 2020
@karianna karianna modified the milestones: November 2020, December 2020 Dec 2, 2020
@karianna karianna modified the milestones: December 2020, January 2021 Jan 3, 2021
@karianna karianna modified the milestones: January 2021, February 2021 Feb 3, 2021
@karianna karianna modified the milestones: February 2021, March 2021 Mar 8, 2021
@karianna karianna modified the milestones: March 2021, April 2021 Apr 16, 2021
@karianna karianna modified the milestones: April 2021, June 2021 Jun 7, 2021
@karianna karianna removed this from the June 2021 milestone Jul 19, 2021
@github-actions
Copy link

We are marking this issue as stale because it has not been updated for a while. This is just a way to keep the support issues queue manageable.
It will be closed soon unless the stale label is removed by a committer, or a new comment is made.

@github-actions github-actions bot added the stale label May 10, 2022
@karianna karianna removed the stale label May 10, 2022
@karianna
Copy link
Contributor

Still open upstream

@github-actions
Copy link

github-actions bot commented Aug 9, 2022

We are marking this issue as stale because it has not been updated for a while. This is just a way to keep the support issues queue manageable.
It will be closed soon unless the stale label is removed by a committer, or a new comment is made.

@github-actions github-actions bot added the stale label Aug 9, 2022
@karianna
Copy link
Contributor

karianna commented Aug 9, 2022

Still open upstream

@karianna karianna added bug Something isn't working and removed stale labels Aug 9, 2022
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

We are marking this issue as stale because it has not been updated for a while. This is just a way to keep the support issues queue manageable.
It will be closed soon unless the stale label is removed by a committer, or a new comment is made.

@github-actions github-actions bot added the stale label Nov 8, 2022
@karianna
Copy link
Contributor

karianna commented Nov 8, 2022

As this has been reported upstream I'm closing this issue

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

No branches or pull requests

4 participants