From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7848 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Allow different paths for static and shared libraries Date: Mon, 1 Jun 2015 14:58:28 -0400 Message-ID: <20150601185828.GA17573@brightrain.aerifal.cx> References: <1433057065-9167-1-git-send-email-ismael@iodev.co.uk> <20150531073157.GR17573@brightrain.aerifal.cx> <20150531061054.75f86040@pirotess> <20150531163034.GT17573@brightrain.aerifal.cx> <20150531185142.7cf46c31@pirotess> <20150601012725.GU17573@brightrain.aerifal.cx> <20150601154128.20e75e1e@pirotess> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1433185125 11214 80.91.229.3 (1 Jun 2015 18:58:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Jun 2015 18:58:45 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7861-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jun 01 20:58:44 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YzUv6-0007u2-0c for gllmg-musl@m.gmane.org; Mon, 01 Jun 2015 20:58:44 +0200 Original-Received: (qmail 20161 invoked by uid 550); 1 Jun 2015 18:58:42 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 20143 invoked from network); 1 Jun 2015 18:58:41 -0000 Content-Disposition: inline In-Reply-To: <20150601154128.20e75e1e@pirotess> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7848 Archived-At: On Mon, Jun 01, 2015 at 03:41:28PM -0300, Ismael Luceno wrote: > On Sun, 31 May 2015 21:27:25 -0400 > Rich Felker wrote: > > On Sun, May 31, 2015 at 06:51:42PM -0300, Ismael Luceno wrote: > > > On Sun, 31 May 2015 12:30:34 -0400 > > > Rich Felker wrote: > > > > On Sun, May 31, 2015 at 06:10:54AM -0300, Ismael Luceno wrote: > > > > > On Sun, 31 May 2015 03:31:57 -0400 > > > > > Rich Felker wrote: > > > > > > On Sun, May 31, 2015 at 04:24:25AM -0300, Ismael Luceno wrote: > > > > > > > Signed-off-by: Ismael Luceno > > > > > > > --- > > > > > > > Makefile | 5 ++++- > > > > > > > configure | 3 +++ > > > > > > > 2 files changed, 7 insertions(+), 1 deletion(-) > > > > > > > [...] > > > > > > > > > > > > Is there a motivation/intended-usage-case for this patch? > > > > > > > > > > libc.so must be available at boot, while the static libraries > > > > > don't need to, so installing to different paths comes useful. > > > > > > > > In that case I think you're not looking for the semantics of > > > > slibdir but rather using it as a mechanism to make ldso available > > > > before libdir is mounted. > > > > > > > > Note that having libc.so and libc.a in different dirs is very > > > > problematic/dangerous at linking time. If the dir containing > > > > libc.a is searched first, then it will get linked into > > > > dynamic-linked binaries and very bad things will happen. > > > > > > > > I think this is probably yet another case of wanting ldso to be > > > > the canonical file and libc.so to be a symlink to it (reversing > > > > symlink direction). This issue has come up many times before but > > > > I always forget how it was resolved (or not) and why nothing > > > > changed... > > > > > > A ld script in place of libc.so, containing "GROUP ( /lib/libc.so > > > )", would workaround that. > > > > Are you sure? I think that would result in a dependency for > > "/lib/libc.so" getting put in the binary rather than one for > > "libc.so", and that's also a serious bug. > > That's what glibc does. Hmm... Indeed. I suppose the path part of the pathname there is ignored when producing DT_NEEDED records, then, or else something else weird is going on with glibc -- perhaps the SONAME in glibc forces the path to be removed and the whole pathname replaced with the SONAME? In any case I don't think this is the right solution for the problem at hand. Rich