From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10357 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: relative link between libc.so and the dynamic linker Date: Thu, 4 Aug 2016 12:47:12 -0400 Message-ID: <20160804164712.GI15995@brightrain.aerifal.cx> References: <020b01d1edc9$00bbc490$02334db0$@codeaurora.org> <7193C5A6-EAE6-4EBE-958D-58D90D4409A0@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1470329266 21083 195.159.176.226 (4 Aug 2016 16:47:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 4 Aug 2016 16:47:46 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-10370-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 04 18:47:36 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1bVLnt-0003ZM-0e for gllmg-musl@m.gmane.org; Thu, 04 Aug 2016 18:47:29 +0200 Original-Received: (qmail 14084 invoked by uid 550); 4 Aug 2016 16:47:26 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 14048 invoked from network); 4 Aug 2016 16:47:26 -0000 Content-Disposition: inline In-Reply-To: <7193C5A6-EAE6-4EBE-958D-58D90D4409A0@gmail.com> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10357 Archived-At: On Thu, Aug 04, 2016 at 12:49:57AM -0700, Khem Raj wrote: > > > On Aug 3, 2016, at 1:52 PM, Sidney Manning wrote: > > > > I'd like to suggest making the symbolic link between libc.so and > > ld-musl-.so.1 relative rather than absolute. A relative path makes > > movement between systems easier, in particular when one is copying cross > > binaries to into a runtime environment. > > > > diff --git a/tools/install.sh b/tools/install.sh > > index d913b60..1c102f5 100755 > > --- a/tools/install.sh > > +++ b/tools/install.sh > > @@ -48,7 +48,7 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP > > umask 077 > > > > if test "$symlink" ; then > > -ln -s "$1" "$tmp" > > +ln -s -r "$1" "$tmp" > > else > > cat < "$1" > "$tmp" > > chmod "$mode" "$tmp" > > > > > > > > The final result would look something like this: > > ld-musl-x86_64.so.1 -> ../usr/lib/libc.so > > > > Rather than: > > ld-musl-x86_64.so.1 -> /tmp/musl/install/usr/lib/libc.so > > Does something like this help you > > https://github.com/kraj/musl/commit/c0b1bd4e6bb60b8167e1f4a40beccff7f8871691 This assumes that one level of .. gets you from $(libdir) to /. For a normal setup with libdir=/usr/lib that's not going to be the case, though of course lots of people these days like omitting /usr or making it a symlink to /, in which case it will work. Rich