From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5016 Path: news.gmane.org!not-for-mail From: "writeonce@midipix.org" Newsgroups: gmane.linux.lib.musl.general Subject: Re: for the wiki: a __MUSL__ alternative Date: Thu, 01 May 2014 09:07:08 -0400 Message-ID: <536246FC.3000901@midipix.org> References: <5361FA9F.2090207@midipix.org> <20140501125117.GU26358@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1398949653 7887 80.91.229.3 (1 May 2014 13:07:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 May 2014 13:07:33 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5020-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 01 15:07:28 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 1Wfqhz-0001Jl-Lp for gllmg-musl@plane.gmane.org; Thu, 01 May 2014 15:07:27 +0200 Original-Received: (qmail 14329 invoked by uid 550); 1 May 2014 13:07:27 -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 14321 invoked from network); 1 May 2014 13:07:26 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <20140501125117.GU26358@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:5016 Archived-At: On 05/01/2014 08:51 AM, Rich Felker wrote: > 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 > > You are absolutely right, and my thought was to provide a _temporary_ solution until everyone get convinced... but I certainly see your point. It later occurred to me that this won't work with cross-compilation, and while there is an even more deviant trick for that scenario as well, this time I'm keeping it to myself;-) zg