public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>
To: <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] testsuite: /dev/null is not accessible on Windows
Date: Wed, 5 Oct 2022 11:46:50 +0200	[thread overview]
Message-ID: <f0de3cad-3f64-4fff-7f34-13055cbe328f@foss.st.com> (raw)
In-Reply-To: <2bdafbbd-9073-aa4e-30bb-2c7d2c7065c5@gmail.com>

Hi,

On 2022-10-05 11:34, Jonathan Yong via Gcc-patches wrote:
> On 9/29/22 17:38, Torbjörn SVENSSON via Gcc-patches wrote:
>> When running the DejaGNU testsuite on a toolchain built for native
>> Windows, the path /dev/null can't be used to open a stream to void.
>> On native Windows, the resource is instead named "nul".
>>
>> The error would look like this:
>> c:/arm-11.3.rel1/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: cannot find @/dev/null: No such file or directory
>>
>> Patch has been verified on Windows and Linux.
>>
>> gcc/testsuite:
>>
>>     * gcc.misc-tests/outputs.exp: Use "@nul" for Windows,
>>     "@/dev/null" for other environments.
>>
>> Co-Authored-By: Yvan ROUX  <yvan.roux@foss.st.com>
>> Signed-off-by: Torbjörn SVENSSON  <torbjorn.svensson@foss.st.com>
>> ---
>>   gcc/testsuite/gcc.misc-tests/outputs.exp | 17 ++++++++++++-----
>>   1 file changed, 12 insertions(+), 5 deletions(-)
>>
>> diff --git a/gcc/testsuite/gcc.misc-tests/outputs.exp 
>> b/gcc/testsuite/gcc.misc-tests/outputs.exp
>> index ab919db1ccb..3fe7270fa63 100644
>> --- a/gcc/testsuite/gcc.misc-tests/outputs.exp
>> +++ b/gcc/testsuite/gcc.misc-tests/outputs.exp
>> @@ -78,6 +78,13 @@ if {[board_info $dest exists output_format]} {
>>       append link_options " additional_flags=-Wl,-oformat,[board_info 
>> $dest output_format]"
>>   }
>> +
>> +set devnull "/dev/null"
>> +if { [info exists ::env(OS)] && [string match "Windows*" $::env(OS)] } {
>> +    # Windows uses special file named "nul" as a substitute for 
>> /dev/null
>> +    set devnull "nul"
>> +}
>> +
>>   # Avoid possible influence from the make jobserver,
>>   # otherwise ltrans0.ltrans_args files may be missing.
>>   if [info exists env(MAKEFLAGS)] {
>> @@ -353,10 +360,10 @@ outest "$b-21 exe savetmp named2" $mult "-o 
>> $b.exe -save-temps" {} {{--1.i --1.s
>>   # Additional files are created when an @file is used
>>   if !$skip_atsave {
>> -outest "$b-22 exe savetmp namedb-2" $sing "@/dev/null -o $b.exe 
>> -save-temps" {} {{--0.i --0.s --0.o .args.0 !!$gld .ld1_args !0 .exe}}
>> -outest "$b-23 exe savetmp named2-2" $mult "@/dev/null -o $b.exe 
>> -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .args.0 !!$gld 
>> .ld1_args !0 .exe}}
>> -outest "$b-24 exe savetmp named2-3" $mult "@/dev/null -I dummy -o 
>> $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o -args.0 
>> -args.1 .args.2 !!$gld .ld1_args !0 .exe}}
>> -outest "$b-25 exe savetmp named2-4" $mult "@/dev/null -I dummy -L 
>> dummy -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o 
>> -args.0 -args.1 .args.2 .args.3 !!$gld .ld1_args !0 .exe}}
>> +outest "$b-22 exe savetmp namedb-2" $sing "@$devnull -o $b.exe 
>> -save-temps" {} {{--0.i --0.s --0.o .args.0 !!$gld .ld1_args !0 .exe}}
>> +outest "$b-23 exe savetmp named2-2" $mult "@$devnull -o $b.exe 
>> -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .args.0 !!$gld 
>> .ld1_args !0 .exe}}
>> +outest "$b-24 exe savetmp named2-3" $mult "@$devnull -I dummy -o 
>> $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o -args.0 
>> -args.1 .args.2 !!$gld .ld1_args !0 .exe}}
>> +outest "$b-25 exe savetmp named2-4" $mult "@$devnull -I dummy -L 
>> dummy -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o 
>> -args.0 -args.1 .args.2 .args.3 !!$gld .ld1_args !0 .exe}}
>>   }
>>   # Setting the main output to a dir selects it as the default aux&dump
>> @@ -714,7 +721,7 @@ outest "$b-291 lto mult named-2" $mult "-o $b.exe 
>> -O2 -flto -fno-use-linker-plug
>>   outest "$b-292 lto sing nameddir-2" $sing "-o dir/$b.exe -O2 -flto 
>> -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized 
>> -fdump-rtl-final -fstack-usage" {dir/} {{--0.c.???i.icf 
>> --0.c.???r.final .wpa.???i.icf .ltrans0.ltrans.???r.final 
>> .ltrans0.ltrans.su .exe} {}}
>>   outest "$b-293 lto mult nameddir-2" $mult "-o dir/$b.exe -O2 -flto 
>> -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized 
>> -fdump-rtl-final -fstack-usage" {dir/} {{--1.c.???i.icf 
>> --1.c.???r.final --2.c.???i.icf --2.c.???r.final .wpa.???i.icf 
>> .ltrans0.ltrans.???r.final .ltrans0.ltrans.su .exe} {}}
>>   if !$skip_atsave {
>> -outest "$b-294 lto sing unnamed-3" $sing "@/dev/null -O2 -flto 
>> -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized 
>> -fdump-rtl-final -fstack-usage -save-temps $oaout" {} 
>> {{a--0.c.???i.icf a--0.c.???r.final a.wpa.???i.icf 
>> a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a--0.o a--0.s a--0.i 
>> a.ltrans0.o a.ltrans.out a.ltrans0.ltrans.o a.ltrans0.ltrans_args 
>> a.args.0 a.ltrans0.ltrans.s a.wpa.args.0 a.lto_args a.ld1_args 
>> a.ltrans_args a.ltrans0.ltrans.args.0 a.ld_args $aout}}
>> +outest "$b-294 lto sing unnamed-3" $sing "@$devnull -O2 -flto 
>> -fno-use-linker-plugin -flto-partition=one -fdump-ipa-icf-optimized 
>> -fdump-rtl-final -fstack-usage -save-temps $oaout" {} 
>> {{a--0.c.???i.icf a--0.c.???r.final a.wpa.???i.icf 
>> a.ltrans0.ltrans.???r.final a.ltrans0.ltrans.su a--0.o a--0.s a--0.i 
>> a.ltrans0.o a.ltrans.out a.ltrans0.ltrans.o a.ltrans0.ltrans_args 
>> a.args.0 a.ltrans0.ltrans.s a.wpa.args.0 a.lto_args a.ld1_args 
>> a.ltrans_args a.ltrans0.ltrans.args.0 a.ld_args $aout}}
>>   }
>>   }
> 
> Thanks, looks good to me, will push to master soon.
> 
Thanks for the review. I can push myself if that's easier for you.

Kind regards,
Torbjörn

  reply	other threads:[~2022-10-05  9:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29 17:38 Torbjörn SVENSSON
2022-10-05  9:22 ` PING^1 " Torbjorn SVENSSON
2022-10-05  9:34 ` Jonathan Yong
2022-10-05  9:46   ` Torbjorn SVENSSON [this message]
2022-10-05  9:48   ` Jonathan Yong

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=f0de3cad-3f64-4fff-7f34-13055cbe328f@foss.st.com \
    --to=torbjorn.svensson@foss.st.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).