Project

General

Profile

Bug #5851

Feature #4719: update gate build environment to [open]jdk7

usr/lib/pool/poold has incorrect run path after 4719

Added by Richard PALO about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
2015-04-17
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

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

History

#2

Updated by Andrew Stormont about 5 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?

#3

Updated by Richard PALO about 5 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.

#4

Updated by Andrew Stormont about 5 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.

#5

Updated by Richard PALO about 5 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.

#6

Updated by Richard PALO about 5 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.

#7

Updated by Richard PALO about 5 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
#8

Updated by Gordon Ross about 5 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
#9

Updated by Gordon Ross about 5 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
#10

Updated by Electric Monk about 5 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>

Also available in: Atom PDF