From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id 951863857738 for ; Wed, 5 Jul 2023 21:30:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 951863857738 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1b8baa836a5so1638365ad.1 for ; Wed, 05 Jul 2023 14:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688592616; x=1691184616; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Z1SsBxVXyNHD6WmqvFISdKITj5LVyp36mtRO8caj+7w=; b=E+uoWSr/aIlh9AUAj7xwKMHlbZgp03sJVUrarMniug1bhvirNr+074PZAohlLK/H4P Vp7FBQ1olRiEh56dktdjlPaQeCRHdrO2ZQtIHshd8r8KWLV6NwoZMDznmSOQPm1l99a9 EujdjdwfiHEKcnpaVsk7USQTpMjK4Vm29Bqb4ymGLrQjN7hFZ8/AW3yaiXAHLByC3m7R S+WKAwbrPAhzdFsJIR3u7Z46x8wNZsInLU4pV723eN6Np6AC1RyrjVVtq8iBz6eFssb/ xy2L8pSseifDMfr31RXeViu55lrlKV3C8XY/t6bZ7oWYFgl1+i+Okl0yTeXAa4QQmmMp OPgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688592616; x=1691184616; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Z1SsBxVXyNHD6WmqvFISdKITj5LVyp36mtRO8caj+7w=; b=BXuUiljtOEQfTfPaMLCKLDBjH7utYPYx4C+IaPpy4gc3pWka7Z0JhvcTw9CzZAvJh1 QZ4WyQWvJ7K70oEZSu9fCazR81cgX+tElCCB5f9HM94ibcM4QGUHGvldFr0SbVYAsAvT BZiPbT/gMkJ5fJqE6KkbECDWP96QCprpC/0YyUoUi2NmTXp3NhqiFc3lT8e1mex1HnJY JwxPAQZ2pK5HEiQcO8JjHJmnX15ANGJwcGIZUa6jFyYoZz6a2CxEzmt5LJLrL7dMIHNd y6YN1M3rJGn8eOMP+aEOHWAS635KGyo07ib9sxD///389G8ffAWQplskKiEs9lbkTRsP Snbw== X-Gm-Message-State: ABy/qLbJUERDJ7n5NnBLRQMHEzxP/DoKj4aQpaSqBc2Ts/e9xylX/2jd cH2FaWIl8B+FprkzKX4fxP4gRZ8kwqA= X-Google-Smtp-Source: APBJJlEBcIiZDlJHio/5/HT8E9DzyTgxZuz8bvwIbMnIwv3+AZXhqDnbZUMGyVysXCLHqqa1Yd0V3A== X-Received: by 2002:a17:902:db10:b0:1b8:a39a:2833 with SMTP id m16-20020a170902db1000b001b8a39a2833mr211322plx.15.1688592616506; Wed, 05 Jul 2023 14:30:16 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id ix9-20020a170902f80900b001b895336435sm6179864plb.21.2023.07.05.14.30.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jul 2023 14:30:15 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 328E41140BD6; Thu, 6 Jul 2023 07:00:13 +0930 (ACST) Date: Thu, 6 Jul 2023 07:00:13 +0930 From: Alan Modra To: YunQiang Su Cc: binutils@sourceware.org, nickc@redhat.com Subject: Re: [PATCH] ld: Use run_host_cmd_yesno in indirect.exp instead of catch exec Message-ID: References: <20230630060757.2006878-1-yunqiang.su@cipunited.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230630060757.2006878-1-yunqiang.su@cipunited.com> X-Spam-Status: No, score=-3034.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Jun 30, 2023 at 02:07:57PM +0800, YunQiang Su wrote: > Catch "exec $CC_FOR_TARGET" won't use the gas/ld that we just build, > and in fact run_host_cmd_yesno is a better choice for it. > > ld/ChangeLog: > > * testsuite/ld-elf/indirect.exp: use run_host_cmd_yesno > instead of handwrite catch exec $CC_FOR_TARGET. OK, yes, we should be using run_host_cmd everywhere we invoke a compiler in the ld testsuite. One reason being that run_host_cmd properly inserts $gcc_B_opt in cases where a user wants to test binutils with a newly built compiler, ie. when $CC specifies -B. I'm going to apply this one too. * testsuite/ld-elf/no-section-header.exp (binutils_run_test): Use run_host_cmd to invoke $CC. diff --git a/ld/testsuite/ld-elf/no-section-header.exp b/ld/testsuite/ld-elf/no-section-header.exp index c010e572a32..2d8c687dc0a 100644 --- a/ld/testsuite/ld-elf/no-section-header.exp +++ b/ld/testsuite/ld-elf/no-section-header.exp @@ -136,7 +136,6 @@ if { ![isnative] || ![check_shared_lib_support] } { proc binutils_run_test { prog } { global CC - global gcc_B_opt global READELF global NM global objcopy @@ -354,8 +353,7 @@ proc binutils_run_test { prog } { return } - send_log "$CC $gcc_B_opt -o tmpdir/pr25617-1 tmpdir/pr25617-1b.o tmpdir/pr25617-1a-now-no-sec-hdr.so\n" - catch "exec $CC $gcc_B_opt -o tmpdir/pr25617-1 tmpdir/pr25617-1b.o tmpdir/pr25617-1a-now-no-sec-hdr.so" got + set got [run_host_cmd $CC "-o tmpdir/pr25617-1 tmpdir/pr25617-1b.o tmpdir/pr25617-1a-now-no-sec-hdr.so"] if ![string match "*pr25617-1a-now-no-sec-hdr.so*file in wrong format*" $got] then { send_log "$got\n" fail "Update pr25617-1a-now-no-sec-hdr.so ($prog_name)" -- Alan Modra Australia Development Lab, IBM