From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 5TlbJPne/F+cKgAAWB0awg (envelope-from ) for ; Mon, 11 Jan 2021 18:27:53 -0500 Received: by simark.ca (Postfix, from userid 112) id 854611EEEF; Mon, 11 Jan 2021 18:27:53 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id BF91A1E940 for ; Mon, 11 Jan 2021 18:27:52 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4E1DC388C01F; Mon, 11 Jan 2021 23:27:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E1DC388C01F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610407672; bh=rq8+OMqTOwHAlAx0squnxxfYdYsRahE6Ryq950eRe6o=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=tFVrq+mGNx87/Qs9g+5WdWF86EudNPfDyituM8+sgNAKAHe20IyghTHt46tprONPj MYfWE2i111d1FEF4PlrCGvA+AIuWizBasohCt5L2zf3cK1OMB1Nim9z4OH67ust3jS kVkqXJigu3GX5+QERjKn2jVeCMNU4O2CGh99obPs= Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by sourceware.org (Postfix) with ESMTPS id ADCFF3857C65; Mon, 11 Jan 2021 23:27:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ADCFF3857C65 Received: by mail-pj1-x1030.google.com with SMTP id b5so503770pjl.0; Mon, 11 Jan 2021 15:27:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rq8+OMqTOwHAlAx0squnxxfYdYsRahE6Ryq950eRe6o=; b=eK0fkpUt4rBmYExQRYXZFKYZHRXKtgKmf2+praFObHdCOasfXm7L4gXVygC5lkRSgX jpa9NK4A0/0JDBasYZAgQDttaLY87F4gV44mJ4bmDM8OM2pot4lfESfAFObmGCe1GmgU 3DM3FywQPlV4WD2+WpF4Bs9sMiwUPO8EhTZpXBSM5C62Tjnf+OmT5FWSqmIvuaXpTPoj cCFHCQ/GEvH6lIJ9PBFFZEhC7auZY5McemVinmYRjOcovaGZorfNHrjbvPWbjMsf3ivg V914zU7fLLb3OwYMebKRVOFTxg9QSkNSiuij57F2AA2IImJ+rTrPfA9l/1Fjf3AyM0I7 545w== X-Gm-Message-State: AOAM532ou4wX73ikX/Bkb7NSva1pQa6Zq+EkOi1R/QIRWd/IYmUjZvdp Kg06LzIvyCIg0NDbA8i2w1k= X-Google-Smtp-Source: ABdhPJy7MzN+YBeXYOUFIKnk/eMqtz/Yhqvje+U2ld1uTgtpFMjg3SWDwE8WIcoh5Dm3VQZ5L2FBvw== X-Received: by 2002:a17:90a:db0d:: with SMTP id g13mr113259pjv.76.1610407667923; Mon, 11 Jan 2021 15:27:47 -0800 (PST) Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:1133:ba08:1525:f04b]) by smtp.gmail.com with ESMTPSA id mr7sm518714pjb.31.2021.01.11.15.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 15:27:47 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 9BFDA47DD8; Tue, 12 Jan 2021 09:57:43 +1030 (ACDT) Date: Tue, 12 Jan 2021 09:57:43 +1030 To: "H.J. Lu" Subject: Re: [PATCH 1/2] GCC: Check if AR works with --plugin and rc Message-ID: <20210111232743.GD5523@bubble.grove.modra.org> References: <20210111165706.92117-1-hjl.tools@gmail.com> <20210111165706.92117-2-hjl.tools@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210111165706.92117-2-hjl.tools@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Alan Modra via Gdb-patches Reply-To: Alan Modra Cc: Joel Brobecker , gcc-patches@gcc.gnu.org, binutils@sourceware.org, gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On Mon, Jan 11, 2021 at 08:57:05AM -0800, H.J. Lu via Binutils wrote: > diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4 > index c5b72e9a13d..798a2054edd 100644 > --- a/config/gcc-plugin.m4 > +++ b/config/gcc-plugin.m4 > @@ -145,6 +145,18 @@ for plugin in $plugin_names; do > break > fi > done > +dnl Check if ${AR} $plugin_option rc works. > +AC_CHECK_TOOL(AR, ar) > +if test "${AR}" = "" ; then > + AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.]) > +fi > +touch conftest.c > +${AR} $plugin_option rc conftest.a conftest.c > +if test "$?" != 0; then > + echo "Failed: ${AR} $plugin_option rc" Use AC_MSG_ERROR rather than echo. > + plugin_option= > +fi > +rm -f conftest.* > if test -n "$plugin_option"; then > $1="$plugin_option" > AC_MSG_RESULT($plugin_option) > diff --git a/libtool.m4 b/libtool.m4 > index 3672e9516e2..150971974c1 100644 > --- a/libtool.m4 > +++ b/libtool.m4 > @@ -1340,7 +1340,14 @@ AC_CHECK_TOOL(AR, ar, false) > test -z "$AR" && AR=ar > if test -n "$plugin_option"; then > if $AR --help 2>&1 | grep -q "\--plugin"; then > - AR="$AR $plugin_option" > + touch conftest.c > + $AR $plugin_option rc conftest.a conftest.c > + if test "$?" != 0; then > + echo "Failed: $AR $plugin_option rc" AC_MSG_ERROR again. > + else > + AR="$AR $plugin_option" > + fi > + rm -f conftest.* > fi > fi > test -z "$AR_FLAGS" && AR_FLAGS=cru -- Alan Modra Australia Development Lab, IBM