"H.Merijn Brand" <firstname.lastname@example.org> writes:
The first patch adds support for /proc/self/path/a.out which is
equivalent to /proc/self/exe on Linux. This patch is complete and
can be applied.
Looks safe. I'll wait a bit for more comments before I can do the
My first question however is: How much of this can be done in hints
and how much is really Solaris specific? If something actually is
solaris-only, I'd prefer to delegate to hints/solaris.sh if possible
Currently there is only a hints/solaris_2.sh, but you will see that
there are many os's already that have hints for specific os releases
(e.g. aix,irix, isc, next, sco, sunos, and svr)
In theory any system can implement /proc/self/path/a.out, just as
/proc/self/exe. ISTM that the question here is: Do we move this to
the Solaris hints file and risk missing it on other systems? If yes,
I'm willing to work on a patch for that.
The next patch is more of a crude hack to get the Perl executables
to use $ORIGIN in the runpath so that libperl.so can be both
dynamic and relocatable.
That part bothers me a bit in that the first hunk makes me think
that freebsd and linux will also refer to $ORIGIN, but I don't see
that happen in the second hunk, but this might be hidden in below
Yes, it was hidden in the later remarks. I have found mention of
$ORIGIN as early as 2.7 in the ld.so.1 man page. Are older Solaris
releases still actively supported? On the other hand it should be
easy enough to condition it on not SunOS 5.[0-6].
I have no idea when it cropped up in FreeBSD and Linux.
Another thing, instead of testing for userelocatableinc inside the
system specific code of setting the runpath switch it is better to set
shrpdir or archlibexp to $ORIGIN first. This will make that part of
the patch system-independent.
Another variable useorigininshrpdir (or more aptly named) can then be
added to the appropriate hints files.
Documenting this with the appriopriate warnings to users of
ExtUtils::Embed is also needed. I'm not sure I'm up to that without
Also, ExtUtils::Embed might need the "feature" to calculate the delta
between $ORIGIN and libperl.so since not all executables will end up
in the same place perl will. Or always give an absolute path unless
explicitly requested for $ORIGIN. Here is my output.
% perl -MExtUtils::Embed -e ldopts
which is appropriate for Solaris Make.
ldopts :sh= perl -MExtUtils::Embed -e ldopts
However, this particular quoting (\$$) does not seem to work in Gnu
Make. Or maybe I'm just using it wrong.
Once I have a good idea what to do about ExtUtils::Embed I'm willing
to work on patches for it.
Johann Oskarsson http://www.2ndquadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services --+--