public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: YunQiang Su <yunqiang.su@cipunited.com>
To: binutils@sourceware.org
Cc: nickc@redhat.com, amodra@gmail.com,
	YunQiang Su <yunqiang.su@cipunited.com>
Subject: [PATCH] ld: Use run_host_cmd_yesno in indirect.exp instead of catch exec
Date: Fri, 30 Jun 2023 14:07:57 +0800	[thread overview]
Message-ID: <20230630060757.2006878-1-yunqiang.su@cipunited.com> (raw)

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.
---
 ld/testsuite/ld-elf/indirect.exp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/ld/testsuite/ld-elf/indirect.exp b/ld/testsuite/ld-elf/indirect.exp
index eda48d30949..de5d9714e19 100644
--- a/ld/testsuite/ld-elf/indirect.exp
+++ b/ld/testsuite/ld-elf/indirect.exp
@@ -226,10 +226,7 @@ foreach t [list indirect5a indirect5b indirect6a indirect6b] {
     }
 }
 
-send_log "$CC_FOR_TARGET -fPIE -pie $srcdir/$subdir/main.c -o tmpdir/pie"
-catch "exec $CC_FOR_TARGET -fPIE -pie $srcdir/$subdir/main.c -o tmpdir/pie" exec_output
-send_log "$exec_output"
-if { ! [string match "" $exec_output] } {
+if { ![run_host_cmd_yesno $CC_FOR_TARGET "-fPIC -pie $srcdir/$subdir/main.c -o tmpdir/pie"] } {
     return
 }
 
-- 
2.30.2


             reply	other threads:[~2023-06-30  6:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30  6:07 YunQiang Su [this message]
2023-07-05 21:30 ` Alan Modra
2023-07-07  8:48 ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230630060757.2006878-1-yunqiang.su@cipunited.com \
    --to=yunqiang.su@cipunited.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).