From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5015 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: for the wiki: a __MUSL__ alternative Date: Thu, 1 May 2014 08:51:17 -0400 Message-ID: <20140501125117.GU26358@brightrain.aerifal.cx> References: <5361FA9F.2090207@midipix.org> 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 1398948698 23523 80.91.229.3 (1 May 2014 12:51:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 May 2014 12:51:38 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5019-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 01 14:51:33 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WfqSa-00059v-DG for gllmg-musl@plane.gmane.org; Thu, 01 May 2014 14:51:32 +0200 Original-Received: (qmail 7413 invoked by uid 550); 1 May 2014 12:51:30 -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 7405 invoked from network); 1 May 2014 12:51:29 -0000 Content-Disposition: inline In-Reply-To: <5361FA9F.2090207@midipix.org> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5015 Archived-At: On Thu, May 01, 2014 at 03:41:19AM -0400, writeonce@midipix.org wrote: > Greetings, > > Since requests for a __MUSL__ macro still come in every now and > then, I thought it might be useful to add to the wiki the following > text at the end of the section "why is there no __MUSL__ macro?" > > If you have a situation that (temporarily) requires that you can > identify the libc being used, consider the following trick: as part > of your configuration script, locate libc.so, then create a symlink > from libc.so to /some/temporary/folder/ldd, and finally execute > /some/temporary/folder/ldd 2>&1 | grep 'musl libc'; Based on the > outcome, you could then add -D__MUSL__ to the relevant environment > variable. The whole point of the wiki answer is that doing this is wrong. Adding a "here's a way to do it anyway" rather defeats the purpose and is just going to get us more trouble in the long term. In any case, this only works when dynamic linking is available, and it requires the ability to run programs for the target which breaks cross compiling and therefore violates one of the biggest rules for built scripts. Rich