From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6138 Path: news.gmane.org!not-for-mail From: Laurent Bercot Newsgroups: gmane.linux.lib.musl.general Subject: Re: why is there no __MUSL__ macro? Date: Thu, 11 Sep 2014 12:09:07 +0100 Message-ID: <541182D3.5010104@skarnet.org> References: <541180B9.5070604@posteo.de> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1410433741 13215 80.91.229.3 (11 Sep 2014 11:09:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Sep 2014 11:09:01 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6151-gllmg-musl=m.gmane.org@lists.openwall.com Thu Sep 11 13:08:54 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 1XS2FC-0007Gz-3r for gllmg-musl@plane.gmane.org; Thu, 11 Sep 2014 13:08:54 +0200 Original-Received: (qmail 15432 invoked by uid 550); 11 Sep 2014 11:08:53 -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 15424 invoked from network); 11 Sep 2014 11:08:53 -0000 X-SourceIP: 80.111.163.198 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <541180B9.5070604@posteo.de> Xref: news.gmane.org gmane.linux.lib.musl.general:6138 Archived-At: > FFmpeg needs support for library features defined in POSIX.1-2001 with XSI extension and the standards below. Currently configure probes the host and target libc by checking for defined macros like __GLIBC__ and __UCLIBC__. In case of glibc and uclibc it sets -D_XOPEN_SOURCE=600 properly. Why not set this macro unconditionally ? All standards-compliant libcs will make the correct symbols visible if you define _XOPEN_SOURCE to a certain value. This include glibc, uClibc, musl, and most other modern libcs. Some systems are notoriously broken (I'm thinking of FreeBSD, which makes a few standard symbols *not* visible when you define the correct macro), but they should be the ones with specialcasing if you need to support them. > What could be a solution which supports musl? My answer as a musl user, which may be different from answers from musl developers, is to use -D_XOPEN_SOURCE=600 without testing for the libc name, and only use system-specific macros to work around bugs in non-compliant systems. -- Laurent