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 9697 invoked from network); 20 Sep 2020 10:13:08 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 20 Sep 2020 10:13:08 -0000 Received: (qmail 3347 invoked by uid 550); 20 Sep 2020 10:13:02 -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 3314 invoked from network); 20 Sep 2020 10:13:01 -0000 Date: Sun, 20 Sep 2020 13:12:49 +0300 From: "Dmitry V. Levin" To: Bruno Haible Cc: config-patches@gnu.org, musl@lists.openwall.com Message-ID: <20200920101249.GA29409@altlinux.org> References: <4768019.hHWyC0TzgU@omega> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4768019.hHWyC0TzgU@omega> Subject: [musl] Re: OS detection wrong on Alpine Linux 3.10 On Sat, Sep 19, 2020 at 03:30:54PM +0200, Bruno Haible wrote: > The value of $host_os, determined by the current config.guess, is: > - On Alpine Linux 3.9: linux-musl > - On Alpine Linux 3.10: linux-gnu > - On Alpine Linux 3.12: linux-musl > > The reason is that config.guess tests 'ldd --version'. However, in > Alpine Linux 3.10, /usr/bin/ldd has been replaced with a shell script > that does not understand the --version option: > > $ cat /usr/bin/ldd > #!/bin/sh > exec /lib/ld-musl-x86_64.so.1 --list -- "$@" > $ /usr/bin/ldd --version 2>&1 > /lib/ld-musl-x86_64.so.1: cannot load --version: No such file or directory > > Find attached a proposed fix. More details in > . > > Bruno > >From 6e8da56c68ad94175d67acfc6257e614fe74e01d Mon Sep 17 00:00:00 2001 > From: Bruno Haible > Date: Sat, 19 Sep 2020 15:24:59 +0200 > Subject: [PATCH] * config.guess: Fix determination of musl libc on Alpine > Linux 3.10. > > --- > ChangeLog | 5 +++++ > config.guess | 14 ++++++-------- > 2 files changed, 11 insertions(+), 8 deletions(-) > > diff --git a/ChangeLog b/ChangeLog > index 4f106db..834f4e5 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,8 @@ > +2020-09-19 Bruno Haible > + > + * config.guess: Don't use 'ldd --version' to determine the presence of > + musl libc, as this fails on Alpine Linux 3.10. > + > 2020-09-08 Elad Lahav > Ben Elliston > > diff --git a/config.guess b/config.guess > index 9aff91c..8d70ec2 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-08-17' > +timestamp='2020-09-19' > > # 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 > @@ -150,17 +150,15 @@ Linux|GNU|GNU/*) > #elif defined(__dietlibc__) > LIBC=dietlibc > #else > + #include > + #ifdef __DEFINED_va_list > + LIBC=musl > + #else > LIBC=gnu > #endif > + #endif > EOF > eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" > - > - # If ldd exists, use it to detect musl libc. > - if command -v ldd >/dev/null && \ > - ldd --version 2>&1 | grep -q ^musl > - then > - LIBC=musl > - fi > ;; > esac > Is this __DEFINED_va_list macro the official way of detecting musl? It looks very fragile to me. -- ldv