Bug #5851
closedFeature #4719: update gate build environment to [open]jdk7
usr/lib/pool/poold has incorrect run path after 4719
100%
Description
As part of https://www.illumos.org/issues/4719 pools/poold is also the last remaining runpath abuser
building with the following in its Makefile:
LDFLAGS += -R$(JAVA_ROOT)/jre/lib/$(MACH)/client
This also has the side-effect of hard coding the JAVA_ROOT build time path into the binary
where all other java bits presume that JAVA_HOME is /usr/java by default.
It is not feasible to quickly port to C to avoid the java dependency, although in the long term
such a port would probably be a good thing for the gate as well.
Since poold is an SMF service, the method file should simply do the right thing.
Files
Updated by Richard PALO about 7 years ago
Updated by Andrew Stormont about 7 years ago
This fix is horrible. Setting the RUNPATH is definitely the way to go. How about introducing a new variable like DEST_JAVA_ROOT or LOCAL_JAVA_ROOT and using that instead?
Updated by Richard PALO about 7 years ago
Well, the alternative is to hardcode `-R$(ADJUNCT_PROTO)/usr/java/...`
Which is, imho, far worse in keeping a runpath where all other cases in the gate have been
removed, potentially exposing other issues.
If there are advocates with consensus that prefer this as an interim solution then naturally I'll acquiesce.
Updated by Andrew Stormont about 7 years ago
Using LD_PRELOAD is definitely the wrong thing to do and I would also say that using $ORIGIN (as suggested on the mailing list) is inappropriate. ADJUNCT_PROTO should not be in the RUNPATH full stop. What exactly is wrong with the RUNPATH the Makefile is currently setting?
EDIT: Maybe what you want is something like "-R$(JAVA_ROOT)/lib -R$(JAVA_ROOT)/jre/lib/$(MACH)/client" so that it searches in /usr/java/lib first.
Updated by Richard PALO about 7 years ago
The problem is that JAVA_ROOT is only buildtime, but poold remembers this via the runpath.
It is the only java binary that does, all the others default back to /usr/java.
Secondly, poold is the last remaining binary that uses a -R runpath setting at all.
The mission was thus twofold.
Updated by Richard PALO about 7 years ago
I've update https://www.illumos.org/rb/r/34/ with a version using runpath with a new variable JAVA_HOME
for specifying the java runtime directory, defaulting to /usr/java as well.
Updated by Richard PALO almost 7 years ago
- Subject changed from remove runpath from pools/poold to add JAVA_HOME path in gate, needed when linking pools/poold to find default run-time java jvm
Updated by Gordon Ross almost 7 years ago
- Subject changed from add JAVA_HOME path in gate, needed when linking pools/poold to find default run-time java jvm to usr/lib/poold has incorrect run path after 4719
Updated by Gordon Ross almost 7 years ago
- Subject changed from usr/lib/poold has incorrect run path after 4719 to usr/lib/pool/poold has incorrect run path after 4719
Updated by Electric Monk almost 7 years ago
- Status changed from New to Closed
- % Done changed from 90 to 100
git commit e53cbaa96c466c221cfec0d1a481c6f75be6880d
commit e53cbaa96c466c221cfec0d1a481c6f75be6880d Author: Richard PALO <richard@NetBSD.org> Date: 2015-05-31T17:04:58.000Z 5851 usr/lib/pool/poold has incorrect run path after 4719 Reviewed by: Dan McDonald <danmcd@omniti.com> Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Gordon Ross <gwr@nexenta.com>