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