From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.2 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by inbox.vuxu.org (OpenSMTPD) with SMTP id 6e491e19 for ; Sun, 16 Feb 2020 16:06:34 +0000 (UTC) Received: (qmail 11825 invoked by uid 550); 16 Feb 2020 16:06:33 -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 11807 invoked from network); 16 Feb 2020 16:06:32 -0000 Date: Sun, 16 Feb 2020 11:06:20 -0500 From: Rich Felker To: musl@lists.openwall.com Message-ID: <20200216160620.GU1663@brightrain.aerifal.cx> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: Rich Felker Subject: Re: [musl] getauxval availability On Sun, Feb 16, 2020 at 08:43:54AM -0500, Jeffrey Walton wrote: > Hi Everyone, > > We use getauxval on Linux when available to determine cpu caps. For > Glibc the code looks like (http://lwn.net/Articles/519085/): > > #if (((__GLIBC__ * 100) + __GLIBC_MINOR__) >= 216) > # define GETAUXV_AVAILABLE 1 > #endif > > I need a similar test for musl. It looks like the function was added > at https://git.musl-libc.org/cgit/musl/commit/?id=21ada94c4b8c. I > don't see how to map a commit to a release for the web front-end musl > uses. > > The release page indicates it should be available with musl-1.0.1, > which was released April 16 2014 > (https://www.musl-libc.org/releases/). But I am not sure about the > musl release process, and what is included in a release tarball. > > What is the first release of musl that contains 21ada94c4b8c ? The right way to do this is probing for the existence via a configure check or equivalent, not hard-coding specific library versions believed to have the interface. On both glibc and musl (and other software ppl try to do hardcode-the-version hacks with, like Linu kernel), distros and individual users backport important things so that there is no reliable answer. I realize this is something of a pain for programmers who don't make use of any configure-like system at build time, and there is a long term plan to have a cross-libc system for macros announcing the availability of nonstandard functionality so that you can just do #ifdef at the source level rather than needing to do something at configure time, analogous to how the POSIX macros in unistd.h work. Rich