[M3devel] rpath woes
Jay K
jay.krell at cornell.edu
Wed Jun 10 23:51:57 CEST 2015
It appears FreeBSD system ld gained -z origin support in 4.7.
This probably maps back to a particular GNU ld change/version.
This issue bugs me. I want something simple and portable. There seems to be no perfect solution.
Options include:
1 drop support for old systems
2 relink or chrpath/patchelf upon install (Apple and I think Solaris have similar utilities)
3 better predict the install path at build time
I think this is what we do by default actually, just not for building "distributions" (at least make-dist.py)
4 wrapper scripts that set LD_LIBRARY_PATH; seems a popular suggestion I find
anything involving wrapper scripts inelegant
5 use libtool and whatever it does, which is probably I'd guess is relink-upon-install
6 use autoconf to detect -z origin and fallback to ?
$ORIGIN has the downside of possibly not working with setuid/setgid.
yes:
http://www.freebsd.org/cgi/man.cgi?query=ld&apropos=0&sektion=0&manpath=FreeBSD+10.1-RELEASE&arch=default&format=html
http://www.freebsd.org/cgi/man.cgi?query=ld&apropos=0&sektion=0&manpath=FreeBSD+10.0-RELEASE&arch=default&format=html
http://www.freebsd.org/cgi/man.cgi?query=ld&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&arch=default&format=html
http://www.freebsd.org/cgi/man.cgi?query=ld&apropos=0&sektion=0&manpath=FreeBSD+7.0-RELEASE&arch=default&format=html
http://www.freebsd.org/cgi/man.cgi?query=ld&apropos=0&sektion=0&manpath=FreeBSD+6.0-RELEASE&arch=default&format=html
http://www.freebsd.org/cgi/man.cgi?query=ld&apropos=0&sektion=0&manpath=FreeBSD+5.0-RELEASE&arch=default&format=html
http://www.freebsd.org/cgi/man.cgi?query=ld&apropos=0&sektion=0&manpath=FreeBSD+4.7-RELEASE&arch=default&format=html
no:
http://www.freebsd.org/cgi/man.cgi?query=ld&apropos=0&sektion=0&manpath=FreeBSD+4.0-RELEASE&arch=default&format=html
- Jay
> Date: Fri, 5 Jun 2015 07:50:33 +0200
> From: adacore at marino.st
> To: jay.krell at cornell.edu; m3devel at elegosoft.com
> Subject: Re: [M3devel] rpath woes
>
> On 6/5/2015 06:16, Jay K wrote:
> > The FreeBSD4 users were surprisingly vocal surprisingly recently.
> > So I put some work into it.
> > I agree it is an old system.
>
> It's completely unsupported (for 7 years now) and they don't need the
> latest M3 right? Old release still work fine, that should be enough
> justification to change this on trunk.
>
>
>
> > Linux.common and FreeBSD.common look very similar but I agree different
> > and if it is working for you, good, I can ignore it?
> > I guess the main thing was "-Wl,-z,origin"? Needed to make $ORIGIN work?
> > Was this right for FreeBSD 5 or 6 or 7 or 8?
>
> yes. I am using the latest binutils (thus latest ld) with M3. The base
> ld is ancient and hand maintained (a GPLv3 issue) so I don't know,
> Actually, the linux way is opposite: It explicitly defines SYSTEM_LD
> rather than use flags for SYSTEM_CC. So rather than flags, we are
> talking about the approach.
>
> Really nobody with a supported FreeBSD release needs to build from
> scratch because it exists in ports. If anybody absolutely wants to,
> just say "emulates what the port is doing". This is actually easier
> said than done because in addition to using the latest binutils, there
> are a number of inline substitutions that are done, see post-patch
> target here, starting line 78:
>
> https://svnweb.freebsd.org/ports/head/lang/modula3/Makefile?revision=388555&view=markup
>
> line 85 is where newer gcc and newer as is set for m3.
>
> John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20150610/c7261760/attachment-0002.html>
More information about the M3devel
mailing list