public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: "Clément Chigot" <chigot@adacore.com>
Cc: binutils@sourceware.org
Subject: Re: [PATCH 2/4] ld/testsuite: don't output to /dev/null on mingw hosts
Date: Mon, 20 Feb 2023 21:29:52 +1030	[thread overview]
Message-ID: <Y/NSqGmZWszNfy4M@squeak.grove.modra.org> (raw)
In-Reply-To: <20230220082224.415968-2-chigot@adacore.com>

On Mon, Feb 20, 2023 at 09:22:22AM +0100, Clément Chigot via Binutils wrote:
> Mingw doesn't have /dev/null and thus "-o /dev/null" will fail.
> Currently, all the options are checked using this "-o /dev/null",
> resulting in them being disabled on mingw hosts. Fix that by
> outputting to a real .exe file.
> 
> ld/ChangeLog:
> 
> 	* testsuite/config/default.exp: Replace "-o /dev/null" by a file
> 	on mingw hosts.

I think I'd prefer this to always output to a file, which you should
delete afterwards.

> ---
>  ld/testsuite/config/default.exp | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp
> index 257fd4ba985..776b33842c2 100644
> --- a/ld/testsuite/config/default.exp
> +++ b/ld/testsuite/config/default.exp
> @@ -383,6 +383,9 @@ proc compiler_supports { flag args } {
>  	    append flags " [board_info [target_info name] ldflags]"
>  	}
>  	set fn "cs[pid].c"
> +	if [ishost "*-*-mingw*"] {
> +	    set fno "cs[pid].exe"
> +	}
>  	set f [open $fn "w"]
>  	if { [llength $args] > 0 } {
>  	    puts $f [lindex $args 0]
> @@ -391,7 +394,12 @@ proc compiler_supports { flag args } {
>  	}
>  	close $f
>  	set rfn [remote_download host $fn]
> -	set avail [run_host_cmd_yesno "$CC_FOR_TARGET" "$flags $flag $rfn -o /dev/null"]
> +	if [ishost "*-*-mingw*"] {
> +	    set avail [run_host_cmd_yesno "$CC_FOR_TARGET" "$flags $flag $rfn -o $fno"]
> +	    file delete $fno
> +	} else {
> +	    set avail [run_host_cmd_yesno "$CC_FOR_TARGET" "$flags $flag $rfn -o /dev/null"]
> +	}
>  	remote_file host delete $rfn
>  	file delete $fn
>  	return $avail
> -- 
> 2.25.1

-- 
Alan Modra
Australia Development Lab, IBM

  reply	other threads:[~2023-02-20 10:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20  8:22 [PATCH 1/4] gas/testsuite: adjust a test for case insensitive file systems Clément Chigot
2023-02-20  8:22 ` [PATCH 2/4] ld/testsuite: don't output to /dev/null on mingw hosts Clément Chigot
2023-02-20 10:59   ` Alan Modra [this message]
2023-02-20  8:22 ` [PATCH 3/4] ld/testsuite: adjust to Windows path separator Clément Chigot
2023-02-20 11:00   ` Alan Modra
2023-02-20  8:22 ` [PATCH 4/4] ld/testsuite: handle Windows drive letter in a noinit test Clément Chigot
2023-02-20 11:02   ` Alan Modra
2023-02-20 10:52 ` [PATCH 1/4] gas/testsuite: adjust a test for case insensitive file systems Alan Modra
2023-02-21  8:30   ` Jan Beulich
2023-02-21  8:40 ` Jan Beulich
2023-02-21  9:02   ` Clément Chigot
2023-02-21  9:28     ` Jan Beulich

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=Y/NSqGmZWszNfy4M@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=chigot@adacore.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).