From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6461 Path: news.gmane.org!not-for-mail From: Wermut Newsgroups: gmane.linux.lib.musl.general Subject: Re: What does dir in arch/ mean in musl? Date: Thu, 6 Nov 2014 18:34:00 +0100 Message-ID: References: <545B6BDD.2030200@opensource.dyc.edu> <20141106153859.GA22465@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1415295258 1437 80.91.229.3 (6 Nov 2014 17:34:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Nov 2014 17:34:18 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-6474-gllmg-musl=m.gmane.org@lists.openwall.com Thu Nov 06 18:34:14 2014 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 1XmQwo-00051q-3y for gllmg-musl@m.gmane.org; Thu, 06 Nov 2014 18:34:14 +0100 Original-Received: (qmail 26495 invoked by uid 550); 6 Nov 2014 17:34:12 -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 26473 invoked from network); 6 Nov 2014 17:34:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bortis.ch; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=l4rvJ/fB275KOlLFIl6uMjtgIaNHGKrsnPkvNo2MYPg=; b=PFuyJ9a53P1HayidDdd/j/Ono3FkJSTMoeAm+wUi1ghZX0o2EyXD6yx0N1g4qVPSGE LAMYyprO5qZFK1m9jTbujJozH6PCP4vewzku8rrXIcanCPTaDiaJ6iveoWiYA8oDjwq7 aJYDUh5bO0BxntOz7wBLQZm0TkHi6kJiFXsfc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=l4rvJ/fB275KOlLFIl6uMjtgIaNHGKrsnPkvNo2MYPg=; b=P2VnJeS14CB+WG6NRdIcV8Ax8mQyWuoZC0skQNBd2XMoAJXWMLGzF3HFHEokjTKFcX X/JzHHcaRAXZfEUqOXSrEp45zB/Wrk4WsYDJ56qLUina41FJC+lCVDfj+vffJKuKyr8Q tMFMsBNmJJLhw7auEEEqOMTqNgB1+1hZcW8dC4htOgavU63JH/+5MIMIvj8tsLlGEthi Oq6LL70sbSzTTWTTECitXcZ56o/X7m83gmFR88FfksPZ+zkLn6wAH+6TwmyAGi8wxDFG qq9JBUg7m7g7D7zlq41bfrTRM7juLrZMHk6A5pnYbKEtPk3DdjNlUY7bps8HLmFoIyV5 AmOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=l4rvJ/fB275KOlLFIl6uMjtgIaNHGKrsnPkvNo2MYPg=; b=bm0g/NfGFjchIOtwuRf/RhIlZUE9EhwPsRalnVg1VuEgWA8lpvSE6uYdI4u+cPsgAy U474wOww4D364ur/M1usLZgkaWcOgO8NESlSgL6OqeLH4HU5JD/tmhGf6VsLFjojj0gS /pvOo/0fMPSizgCU++IfRDE3vfEqNLsJparCR9TRP/tISBqOBJR0vRX4ZxVf5aYtDtJl hY83sc4C141sYYUj4wB5quAjzktyi2P/Qz9oBcNA9SkZbTmFkhfnpYTkjHC5JuLhoJrW THo37xYL8Nr+U3gATz18cy+0ZOtSslfNON+pKcsIwfORCRHDzbAU2d1UnB2dCBIxXBSk SHag== X-Gm-Message-State: ALoCoQkFsLxrbJnKldL5n/R2LBUY9ai7hQVI4cL+Pqtm/xvHg1Dytrxl9GrtYqXCnhODpTyVyyEB X-Received: by 10.170.87.7 with SMTP id e7mr3696692yka.126.1415295240422; Thu, 06 Nov 2014 09:34:00 -0800 (PST) Original-Sender: kevin@bortis.ch In-Reply-To: <20141106153859.GA22465@brightrain.aerifal.cx> X-Google-Sender-Auth: nTqd0DlhrlKeuyadpAiT0ECHpMk Xref: news.gmane.org gmane.linux.lib.musl.general:6461 Archived-At: There are at least two different ldconfig like scripts for musl found in Alpine Linux and Debian that you can possibly take for reference. Alpine Linux: http://git.alpinelinux.org/cgit/aports/tree/main/musl/ldconfig Debian: https://github.com/wermut/musl/blob/master/debian/scripts/ld-musl-config On Thu, Nov 6, 2014 at 4:38 PM, Rich Felker wrote: > On Thu, Nov 06, 2014 at 07:38:53AM -0500, Anthony G. Basile wrote: >> Hi everyone, >> >> In the context of integrating musl with gentoo, we have to deal with >> how we construct the link path file. So far we've been doing a >> variation of >> >> LDSO_ARCH=$(basename /lib/ld-musl-*.so.1) >> cat << EOF > /etc/${LDSO_ARCH%so.1}path >> >> EOF >> >> >> where LDSO_ARCH is defined in arch//reloc.h. But what does >> mean in this case? I know it *says* arch but it doesn't >> appear to be arches but rather an inconsistent combination of ISA + >> ABI. Eg. x32 is an ABI which runs on 64-bit intel ISA, while x86_64 >> is a different ABI on the same. On the other hand all mips >> isas/abis/endians/floats are under arch/mips. > > This is an area where existing practice differs a lot. For the kernel > folks, even 32- and 64-bit versions of a particular ISA are considered > the same arch. musl is on the opposite end of the spectrum, where > basic arch divisions cover both the ISA and how it's being used (you > can think of this as ABI). Here, x32 and x86_64 are separate archs, as > are powerpc/powerpc64, mips/mipsn32/mips64, etc. (the latter are not > yet supported though). musl also has subarchs for minor variants; > these should be considered an implementation detail. Examples are > armhf, mips-sf, mipsel, and so on. From your perspective, they're > distinct archs; the distinction between archs and subarchs is really > purely an implementation detail of musl's headers and build system. > > If you don't want to hard-code a list of arch names, the easiest way > to get the right one would be to compile a dynamic linked program and > use readelf or objdump to read the PT_INTERP (dynamic linker) header. > The method you showed above will fail if more than one dynamic linker > is installed, which could easily be the case if the user is running > binaries for multiple ABI variants on a given piece of hardware or > using qemu to run foreign binaries. The method I described necessarily > tells you the one connected to the compiler you're using. > > Rich