From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by sourceware.org (Postfix) with ESMTPS id C20873857C4A for ; Tue, 22 Mar 2022 12:46:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C20873857C4A Received: by mail-oi1-x22c.google.com with SMTP id k10so7816172oia.0 for ; Tue, 22 Mar 2022 05:46:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=Lje5hAU5MWLGdinRuXmd/WxfX1emczxNTdaGpWNpPP4=; b=bupefvhQoUgRjrZeOEqE+w61mulIBKMnJRobc3umvvLwoIKEL1XhwzbjWgWUlVVLUT NW786nujC6jo7NP1kvq3Xw2NBP1Kj7u6c4JpDlj+6oDggX9NyAycjDGwORxzzAF9Iokq G/ZreETxURXijUGmjVePZS9nU5muDiExP8pi2feHV/lsv2xZwf0grRsQeJqdEYxHZttL tFQzFuuSDeo/YiFvUPFX2uvpVWVpepDScayaUW6/2qKUDkeIRCr9oflGLCM71bRik8aP aGPJeRUT+GsBLTQcDxbcZoB1UUfNQTeorVBM8Lexo7J/oOl8rSAaQmavttlEsrZOM3sE HvAw== X-Gm-Message-State: AOAM531OQupHVuzWBfFF8LxoLYtoAfzcKD9sGAdFL3YdIX5gpF3QY286 ppIgn0ry6HxQFkTCfl36Nr3+yuYrTqr9ow== X-Google-Smtp-Source: ABdhPJyp9krnKsHGBaQiB4md68Z1iZnKvw73BksHNpPunEP4t/h3bwglZ4WP04b5dFq3KBUy+ozoig== X-Received: by 2002:aca:b01:0:b0:2ee:bfb8:7312 with SMTP id 1-20020aca0b01000000b002eebfb87312mr1983943oil.22.1647953176967; Tue, 22 Mar 2022 05:46:16 -0700 (PDT) Received: from ?IPV6:2804:431:c7ca:2d55:3e27:6bd1:b1d4:af84? ([2804:431:c7ca:2d55:3e27:6bd1:b1d4:af84]) by smtp.gmail.com with ESMTPSA id 21-20020a056870115500b000dda3a0cb91sm2629534oag.54.2022.03.22.05.46.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Mar 2022 05:46:16 -0700 (PDT) Message-ID: <6f05f963-9aa5-680e-60b1-7468a487a778@linaro.org> Date: Tue, 22 Mar 2022 09:46:14 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] configure.ac: fix bashism in configure.ac Content-Language: en-US To: Sam James , libc-alpha@sourceware.org References: <20220321230343.2582331-1-sam@gentoo.org> From: Adhemerval Zanella In-Reply-To: <20220321230343.2582331-1-sam@gentoo.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2022 12:46:23 -0000 On 21/03/2022 20:03, Sam James via Libc-alpha wrote: > configure scripts need to be runnable with a POSIX-compliant /bin/sh. > > On many (but not all!) systems, /bin/sh is provided by Bash, so errors > like this aren't spotted. Notably Debian defaults to /bin/sh provided > by dash which doesn't tolerate such bashisms as '=='. > > This retains compatibility with bash. > > Fixes configure warnings/errors like: > ``` > checking if compiler warns about alias for function with incompatible types... yes > /var/tmp/portage/sys-libs/glibc-2.34-r10/work/glibc-2.34/configure: 4209: test: xyes: unexpected operator > ``` > > Signed-off-by: Sam James There are other occurrences of this bashism as on other configure.ac: sysdeps/powerpc/powerpc64/le/configure.ac:66:AS_IF([test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" == "no"], sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure.ac:12:AS_IF([[test "$libc_cv_mcpu_power10" == "yes"]],[ Should we fix it them as well? Beside LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > configure | 2 +- > configure.ac | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/configure b/configure > index 8e5bee775a..2a3cb49b0b 100755 > --- a/configure > +++ b/configure > @@ -4232,7 +4232,7 @@ if test x"$libc_cv_gcc_indirect_function" != xyes; then > # GCC 8+ emits a warning for alias with incompatible types and it might > # fail to build ifunc resolvers aliases to either weak or internal > # symbols. Disables multiarch build in this case. > - if test x"$libc_cv_gcc_incompatible_alias" == xyes; then > + if test x"$libc_cv_gcc_incompatible_alias" = xyes; then > { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gcc emits a warning for alias between functions of incompatible types" >&5 > $as_echo "$as_me: WARNING: gcc emits a warning for alias between functions of incompatible types" >&2;} > if test x"$multi_arch" = xyes; then > diff --git a/configure.ac b/configure.ac > index 87f67d25ec..fa7d3c025b 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -767,7 +767,7 @@ if test x"$libc_cv_gcc_indirect_function" != xyes; then > # GCC 8+ emits a warning for alias with incompatible types and it might > # fail to build ifunc resolvers aliases to either weak or internal > # symbols. Disables multiarch build in this case. > - if test x"$libc_cv_gcc_incompatible_alias" == xyes; then > + if test x"$libc_cv_gcc_incompatible_alias" = xyes; then > AC_MSG_WARN([gcc emits a warning for alias between functions of incompatible types]) > if test x"$multi_arch" = xyes; then > AC_MSG_ERROR([--enable-multi-arch support requires a gcc with gnu-indirect-function support])