From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23654 invoked from network); 20 Sep 2020 17:15:02 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 20 Sep 2020 17:15:02 -0000 Received: (qmail 32489 invoked by uid 550); 20 Sep 2020 17:15:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 32466 invoked from network); 20 Sep 2020 17:14:59 -0000 Date: Sun, 20 Sep 2020 13:14:46 -0400 From: Rich Felker To: Bruno Haible , "Dmitry V. Levin" , config-patches@gnu.org, musl@lists.openwall.com Message-ID: <20200920171446.GB3265@brightrain.aerifal.cx> References: <4768019.hHWyC0TzgU@omega> <20200920101249.GA29409@altlinux.org> <1721942.iyVTE8TspN@omega> <20200920135629.GI2947641@port70.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200920135629.GI2947641@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Re: OS detection wrong on Alpine Linux 3.10 On Sun, Sep 20, 2020 at 03:56:29PM +0200, Szabolcs Nagy wrote: > * Bruno Haible [2020-09-20 13:19:13 +0200]: > > Dmitry V. Levin wrote: > > > Is this __DEFINED_va_list macro the official way of detecting musl? > > > > No, but in a world where the musl people don't want to provide an official > > way [1][2] and the Alpine Linux people break their previously working way of > > detecting musl [3], we (GNU) need to use our own heuristics to fulfil the > > practical need of programs (especially test suites) to distinguish musl > > systems from glibc systems. > > we have not seen a "practical need of programs > to distinguish musl systems from glibc systems". > > instead we have seen a practical need to detect > specific c runtime behaviours and extensions. > > even in the glibc world using __GLIBC__ to detect > features is not reliable since there are heavily > patched glibcs out there. (though the way glibc > handles api and abi stability means it mostly > works, but this is unreasonable to expect across > different implementations) There is one kinda legitimate purpose for detecting specifically musl: when setting $target to match $host for the purpose of a host-targeting compiler toolchain. That does not seem to be the topic at hand here, though. Please note that __DEFINED_* are bits/alltypes.h-internal macros, and are not public interfaces for detecting musl or definition status of any particular type. They are not even "public within musl" -- i.e. musl source files or public headers outside bits/alltypes.h are not allowed to use or poke at them. Their naming or the entire mechanism is subject to change at any time. Rich