Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 29 Jun 2019 08:27:50 -0500
From: "A. Wilcox" <awilfox@...lielinux.org>
To: musl@...ts.openwall.com
Subject: Re: Detecting musl at compile and/or configure time

On 06/29/19 06:48, Chris Hall wrote:
> 
> Is there a supported way of detecting that one is building against the
> musl libc ?
> 
> At compile time I can, of course, detect glibc because it sets __GLIBC__
> etc.  For macOS I can see _DARWIN_FEATURE_xxx macros.  The BSDs mostly
> give themselves away.  But for musl I have not found anything :-(
> 
> Chris


The musl libc specifically does not have a FTM (feature test macro)
because it aims to be an exact implementation of C11 / POSIX and
therefore it has no "quirks" to detect.

If there are bugs in musl libc, the authors prefer if you report them
and have them fixed, instead of making your software look for __MUSL__
and then assume all musl versions will always have that bug.

See here for more information:

https://wiki.musl-libc.org/faq.html#Q:-Why-is-there-no-%3Ccode%3E__MUSL__%3C/code%3E-macro?

https://www.openwall.com/lists/musl/2013/03/29/13

Is there a reason you wish to detect musl at configure/compile time?
Perhaps if we knew the reason, we could help you make your code more
portable and/or not require such detection.

Best to you and yours,
--arw


-- 
A. Wilcox (awilfox)
Project Lead, Adélie Linux
https://www.adelielinux.org



Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.