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.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 17625 invoked from network); 20 Sep 2020 11:19:34 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 20 Sep 2020 11:19:34 -0000 Received: (qmail 25714 invoked by uid 550); 20 Sep 2020 11:19:27 -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 25684 invoked from network); 20 Sep 2020 11:19:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1600600755; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=ixuvZnDDzH20WxjSXO8BMs4XU7Kw7KY+6qifjAaakag=; b=BWcXTfG4y2wr03xrIkGbq4ONKZOF9uNAdMBmjfqoGHT0x2SIMy+IOe/n8oFNG1I3EX gwLnwgKnPa0R9KEXp0CUbYvZmftxpaxynrqQspeDmSwrNyf8mH+JYmT7UpY1JI6bmSmT 1GW0q5jU9Bim/lFvxEJeue9uCZmzJVh+XlzVa0v03fhYjUvtfjPseHI9rZ3HEtXIxBCm z2ZLSdaOF2yLzK1iMY5kxhT7JpQQ/raZCFxfwxC8CryrR0LTAPL+W/TyLyJMXlNSfpYW xCGQGKW5PC1Z2uoI19xbQwxEgKVTZCIQ2ntl642CyoFrt8n/MHX5mLlT6MoquCmdMm7G MlZA== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOHqfyyPs=" X-RZG-CLASS-ID: mo00 From: Bruno Haible To: "Dmitry V. Levin" Cc: config-patches@gnu.org, musl@lists.openwall.com Date: Sun, 20 Sep 2020 13:19:13 +0200 Message-ID: <1721942.iyVTE8TspN@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-189-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20200920101249.GA29409@altlinux.org> References: <4768019.hHWyC0TzgU@omega> <20200920101249.GA29409@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart2224533.7fODc4YWer" Content-Transfer-Encoding: 7Bit Subject: [musl] Re: OS detection wrong on Alpine Linux 3.10 This is a multi-part message in MIME format. --nextPart2224533.7fODc4YWer Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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. > It looks very fragile to me. Indeed, config.guess would be less fragile if we combined both heuristics. Patch attached. It's a trade-off between code size and robustness. Bruno [1] https://wiki.musl-libc.org/faq.html [2] https://lists.gnu.org/archive/html/bug-gnulib/2018-02/msg00079.html [3] https://lists.gnu.org/archive/html/config-patches/2020-09/msg00002.html --nextPart2224533.7fODc4YWer Content-Disposition: attachment; filename="0001-config.guess-Combine-two-heuristics-to-detect-musl-l.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="0001-config.guess-Combine-two-heuristics-to-detect-musl-l.patch" >From 78ceae822bde047eea1db841a5feeba94f57fe7d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 20 Sep 2020 13:17:12 +0200 Subject: [PATCH] * config.guess: Combine two heuristics to detect musl libc. Reported by Dmitry V. Levin. --- ChangeLog | 5 +++++ config.guess | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 834f4e5..63101b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-09-20 Bruno Haible + + * config.guess: Combine two heuristics to detect musl libc. + Reported by Dmitry V. Levin. + 2020-09-19 Bruno Haible * config.guess: Don't use 'ldd --version' to determine the presence of diff --git a/config.guess b/config.guess index 8d70ec2..cd8a0a3 100755 --- a/config.guess +++ b/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2020-09-19' +timestamp='2020-09-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -151,6 +151,7 @@ Linux|GNU|GNU/*) LIBC=dietlibc #else #include + /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #else @@ -159,6 +160,13 @@ Linux|GNU|GNU/*) #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # Second heuristic to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac -- 2.7.4 --nextPart2224533.7fODc4YWer--