public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Avoid illegal argument to verbose in dg-test callback
@ 2020-04-16 13:21 Matthias Kretz
  2020-04-20 14:30 ` Jonathan Wakely
  2021-08-17 19:14 ` Thomas Schwinge
  0 siblings, 2 replies; 4+ messages in thread
From: Matthias Kretz @ 2020-04-16 13:21 UTC (permalink / raw)
  To: gcc-patches, libstdc++

From: Matthias Kretz <kretz@kde.org>

If extra_tool_flags starts with a dash, an error like 'ERROR: verbose:
illegal argument: -march=native -O2 -std=c++17' is printed. This is
easily fixed by inserting a double dash before the variable.

        * testsuite/lib/libstdc++.exp: Avoid illegal argument to
        verbose.
---
 libstdc++-v3/testsuite/lib/libstdc++.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/
testsuite/lib/libstdc++.exp
index 10a7e748464..7f4532c55b2 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -408,7 +408,7 @@ proc libstdc++-dg-test { prog do_what extra_tool_flags } {
     set options ""
     if { $extra_tool_flags != "" } {
 	verbose -log "extra_tool_flags are:"
-	verbose -log $extra_tool_flags
+	verbose -log -- $extra_tool_flags
 	if { [string first "-x c" $extra_tool_flags ] != -1 } {
 	    verbose -log "compiling and executing as C, not C++"
 	    set edit_tool_flags $extra_tool_flags
-- 
──────────────────────────────────────────────────────────────────────────
 Dr. Matthias Kretz                           https://mattkretz.github.io
 GSI Helmholtz Centre for Heavy Ion Research               https://gsi.de
 std::experimental::simd              https://github.com/VcDevel/std-simd
──────────────────────────────────────────────────────────────────────────


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Avoid illegal argument to verbose in dg-test callback
  2020-04-16 13:21 [PATCH] Avoid illegal argument to verbose in dg-test callback Matthias Kretz
@ 2020-04-20 14:30 ` Jonathan Wakely
  2021-08-17 19:14 ` Thomas Schwinge
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Wakely @ 2020-04-20 14:30 UTC (permalink / raw)
  To: Matthias Kretz; +Cc: gcc-patches, libstdc++

On 16/04/20 15:21 +0200, Matthias Kretz wrote:
>From: Matthias Kretz <kretz@kde.org>
>
>If extra_tool_flags starts with a dash, an error like 'ERROR: verbose:
>illegal argument: -march=native -O2 -std=c++17' is printed. This is
>easily fixed by inserting a double dash before the variable.
>
>        * testsuite/lib/libstdc++.exp: Avoid illegal argument to
>        verbose.

Committed, thanks.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Avoid illegal argument to verbose in dg-test callback
  2020-04-16 13:21 [PATCH] Avoid illegal argument to verbose in dg-test callback Matthias Kretz
  2020-04-20 14:30 ` Jonathan Wakely
@ 2021-08-17 19:14 ` Thomas Schwinge
  2021-08-17 19:23   ` Jonathan Wakely
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Schwinge @ 2021-08-17 19:14 UTC (permalink / raw)
  To: Matthias Kretz, gcc-patches, libstdc++; +Cc: Jonathan Wakely

[-- Attachment #1: Type: text/plain, Size: 2269 bytes --]

Hi!

On 2020-04-16T15:21:44+0200, Matthias Kretz <m.kretz@gsi.de> wrote:
> If extra_tool_flags starts with a dash, an error like 'ERROR: verbose:
> illegal argument: -march=native -O2 -std=c++17' is printed. This is
> easily fixed by inserting a double dash before the variable.

> --- a/libstdc++-v3/testsuite/lib/libstdc++.exp
> +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
> @@ -408,7 +408,7 @@ proc libstdc++-dg-test { prog do_what extra_tool_flags } {
>      set options ""
>      if { $extra_tool_flags != "" } {
>       verbose -log "extra_tool_flags are:"
> -     verbose -log $extra_tool_flags
> +     verbose -log -- $extra_tool_flags

I'm confirming the original problem, but on one system, it's not
resolved by this change, because instead we get:

    extra_tool_flags are:
    ERROR: tcl error sourcing [...]/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp.
    ERROR: usage: send [args] string
        while executing
    "send_log "$message\n""
        (procedure "verbose" line 48)
        invoked from within
    "verbose -log -- $extra_tool_flags"
        (procedure "libstdc++-dg-test" line 45)
        invoked from within
    "${tool}-dg-test $prog [lindex ${dg-do-what} 0] "$tool_flags ${dg-extra-tool-flags}""
        (procedure "saved-dg-test" line 115)
        invoked from within
    [...]

That's Ubuntu's dejagnu 1.5-3ubuntu1 being so old that it doesn't include
DejaGnu commit 57c22601afe43d2c2b8819df4f2ecacb034516fd "Protect from leading
dash in message".  (I suppose that's what'd make this work, but have not
verified.)

Thus, as obvious, pushed "libstdc++: Avoid illegal argument to verbose in
dg-test callback, continued" to master branch in commit
60b94d8bd2280837e980a53cf81bdf902d726e61, and cherry-picked into
releases/gcc-11 branch in commit
112bbc8d1d81c1b6375ea3cfb083cdeb0a06ea3a, and into releases/gcc-10 branch
in commit 6e64bbec7dead374628abe525b6f56e20f9507c3, see attached.


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-libstdc-Avoid-illegal-argument-to-verbose-in-dg-test.patch --]
[-- Type: text/x-diff, Size: 2215 bytes --]

From 60b94d8bd2280837e980a53cf81bdf902d726e61 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Tue, 17 Aug 2021 17:58:30 +0200
Subject: [PATCH] libstdc++: Avoid illegal argument to verbose in dg-test
 callback, continued

This is a follow-up to commit 697b94cfaef4a958132faf0cf4b35b15dfb29acc
"libstdc++: Avoid illegal argument to verbose in dg-test callback".
I'm confirming the original problem, but on one system, it's not
resolved by this change, because instead we get:

    extra_tool_flags are:
    ERROR: tcl error sourcing [...]/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp.
    ERROR: usage: send [args] string
        while executing
    "send_log "$message\n""
        (procedure "verbose" line 48)
        invoked from within
    "verbose -log -- $extra_tool_flags"
        (procedure "libstdc++-dg-test" line 45)
        invoked from within
    "${tool}-dg-test $prog [lindex ${dg-do-what} 0] "$tool_flags ${dg-extra-tool-flags}""
        (procedure "saved-dg-test" line 115)
        invoked from within
    [...]

That's Ubuntu's dejagnu 1.5-3ubuntu1 being so old that it doesn't include
DejaGnu commit 57c22601afe43d2c2b8819df4f2ecacb034516fd "Protect from leading
dash in message".  (I suppose that's what'd make this work, but have not
verified.)

	libstdc++-v3/
	* testsuite/lib/libstdc++.exp: Avoid illegal argument to verbose,
	continued.
---
 libstdc++-v3/testsuite/lib/libstdc++.exp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 73b202ce212..35ccbe47c39 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -410,8 +410,7 @@ proc libstdc++-dg-test { prog do_what extra_tool_flags } {
     set select_compile "v3_target_compile"
     set options ""
     if { $extra_tool_flags != "" } {
-	verbose -log "extra_tool_flags are:"
-	verbose -log -- $extra_tool_flags
+	verbose -log "extra_tool_flags are: $extra_tool_flags"
 	if { [string first "-x c" $extra_tool_flags ] != -1 } {
 	    verbose -log "compiling and executing as C, not C++"
 	    set edit_tool_flags $extra_tool_flags
-- 
2.30.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0001-libstdc-Avoid-illegal-argument-to-verbose-in-dg-.g11.patch --]
[-- Type: text/x-diff, Size: 2285 bytes --]

From 112bbc8d1d81c1b6375ea3cfb083cdeb0a06ea3a Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Tue, 17 Aug 2021 17:58:30 +0200
Subject: [PATCH] libstdc++: Avoid illegal argument to verbose in dg-test
 callback, continued

This is a follow-up to commit 697b94cfaef4a958132faf0cf4b35b15dfb29acc
"libstdc++: Avoid illegal argument to verbose in dg-test callback".
I'm confirming the original problem, but on one system, it's not
resolved by this change, because instead we get:

    extra_tool_flags are:
    ERROR: tcl error sourcing [...]/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp.
    ERROR: usage: send [args] string
        while executing
    "send_log "$message\n""
        (procedure "verbose" line 48)
        invoked from within
    "verbose -log -- $extra_tool_flags"
        (procedure "libstdc++-dg-test" line 45)
        invoked from within
    "${tool}-dg-test $prog [lindex ${dg-do-what} 0] "$tool_flags ${dg-extra-tool-flags}""
        (procedure "saved-dg-test" line 115)
        invoked from within
    [...]

That's Ubuntu's dejagnu 1.5-3ubuntu1 being so old that it doesn't include
DejaGnu commit 57c22601afe43d2c2b8819df4f2ecacb034516fd "Protect from leading
dash in message".  (I suppose that's what'd make this work, but have not
verified.)

	libstdc++-v3/
	* testsuite/lib/libstdc++.exp: Avoid illegal argument to verbose,
	continued.

(cherry picked from commit 60b94d8bd2280837e980a53cf81bdf902d726e61)
---
 libstdc++-v3/testsuite/lib/libstdc++.exp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 7f9580db8ed..27fac23500c 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -410,8 +410,7 @@ proc libstdc++-dg-test { prog do_what extra_tool_flags } {
     set select_compile "v3_target_compile"
     set options ""
     if { $extra_tool_flags != "" } {
-	verbose -log "extra_tool_flags are:"
-	verbose -log -- $extra_tool_flags
+	verbose -log "extra_tool_flags are: $extra_tool_flags"
 	if { [string first "-x c" $extra_tool_flags ] != -1 } {
 	    verbose -log "compiling and executing as C, not C++"
 	    set edit_tool_flags $extra_tool_flags
-- 
2.30.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0001-libstdc-Avoid-illegal-argument-to-verbose-in-dg-.g10.patch --]
[-- Type: text/x-diff, Size: 2285 bytes --]

From 6e64bbec7dead374628abe525b6f56e20f9507c3 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Tue, 17 Aug 2021 17:58:30 +0200
Subject: [PATCH] libstdc++: Avoid illegal argument to verbose in dg-test
 callback, continued

This is a follow-up to commit 697b94cfaef4a958132faf0cf4b35b15dfb29acc
"libstdc++: Avoid illegal argument to verbose in dg-test callback".
I'm confirming the original problem, but on one system, it's not
resolved by this change, because instead we get:

    extra_tool_flags are:
    ERROR: tcl error sourcing [...]/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp.
    ERROR: usage: send [args] string
        while executing
    "send_log "$message\n""
        (procedure "verbose" line 48)
        invoked from within
    "verbose -log -- $extra_tool_flags"
        (procedure "libstdc++-dg-test" line 45)
        invoked from within
    "${tool}-dg-test $prog [lindex ${dg-do-what} 0] "$tool_flags ${dg-extra-tool-flags}""
        (procedure "saved-dg-test" line 115)
        invoked from within
    [...]

That's Ubuntu's dejagnu 1.5-3ubuntu1 being so old that it doesn't include
DejaGnu commit 57c22601afe43d2c2b8819df4f2ecacb034516fd "Protect from leading
dash in message".  (I suppose that's what'd make this work, but have not
verified.)

	libstdc++-v3/
	* testsuite/lib/libstdc++.exp: Avoid illegal argument to verbose,
	continued.

(cherry picked from commit 60b94d8bd2280837e980a53cf81bdf902d726e61)
---
 libstdc++-v3/testsuite/lib/libstdc++.exp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 3b8587cd01d..45dd2c8c02e 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -410,8 +410,7 @@ proc libstdc++-dg-test { prog do_what extra_tool_flags } {
     set select_compile "v3_target_compile"
     set options ""
     if { $extra_tool_flags != "" } {
-	verbose -log "extra_tool_flags are:"
-	verbose -log -- $extra_tool_flags
+	verbose -log "extra_tool_flags are: $extra_tool_flags"
 	if { [string first "-x c" $extra_tool_flags ] != -1 } {
 	    verbose -log "compiling and executing as C, not C++"
 	    set edit_tool_flags $extra_tool_flags
-- 
2.30.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Avoid illegal argument to verbose in dg-test callback
  2021-08-17 19:14 ` Thomas Schwinge
@ 2021-08-17 19:23   ` Jonathan Wakely
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Wakely @ 2021-08-17 19:23 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: Matthias Kretz, gcc Patches, libstdc++

On Tue, 17 Aug 2021 at 20:15, Thomas Schwinge <thomas@codesourcery.com> wrote:
>
> Hi!
>
> On 2020-04-16T15:21:44+0200, Matthias Kretz <m.kretz@gsi.de> wrote:
> > If extra_tool_flags starts with a dash, an error like 'ERROR: verbose:
> > illegal argument: -march=native -O2 -std=c++17' is printed. This is
> > easily fixed by inserting a double dash before the variable.
>
> > --- a/libstdc++-v3/testsuite/lib/libstdc++.exp
> > +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
> > @@ -408,7 +408,7 @@ proc libstdc++-dg-test { prog do_what extra_tool_flags } {
> >      set options ""
> >      if { $extra_tool_flags != "" } {
> >       verbose -log "extra_tool_flags are:"
> > -     verbose -log $extra_tool_flags
> > +     verbose -log -- $extra_tool_flags
>
> I'm confirming the original problem, but on one system, it's not
> resolved by this change, because instead we get:
>
>     extra_tool_flags are:
>     ERROR: tcl error sourcing [...]/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp.
>     ERROR: usage: send [args] string
>         while executing
>     "send_log "$message\n""
>         (procedure "verbose" line 48)
>         invoked from within
>     "verbose -log -- $extra_tool_flags"
>         (procedure "libstdc++-dg-test" line 45)
>         invoked from within
>     "${tool}-dg-test $prog [lindex ${dg-do-what} 0] "$tool_flags ${dg-extra-tool-flags}""
>         (procedure "saved-dg-test" line 115)
>         invoked from within
>     [...]
>
> That's Ubuntu's dejagnu 1.5-3ubuntu1 being so old that it doesn't include
> DejaGnu commit 57c22601afe43d2c2b8819df4f2ecacb034516fd "Protect from leading
> dash in message".  (I suppose that's what'd make this work, but have not
> verified.)
>
> Thus, as obvious, pushed "libstdc++: Avoid illegal argument to verbose in
> dg-test callback, continued" to master branch in commit
> 60b94d8bd2280837e980a53cf81bdf902d726e61, and cherry-picked into
> releases/gcc-11 branch in commit
> 112bbc8d1d81c1b6375ea3cfb083cdeb0a06ea3a, and into releases/gcc-10 branch
> in commit 6e64bbec7dead374628abe525b6f56e20f9507c3, see attached.

Thanks. This makes the logs "denser", as there isn't the extra line
break between each test. I think I can live with it ;-) but if anybody
objects we can add a \n into that string.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-17 19:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 13:21 [PATCH] Avoid illegal argument to verbose in dg-test callback Matthias Kretz
2020-04-20 14:30 ` Jonathan Wakely
2021-08-17 19:14 ` Thomas Schwinge
2021-08-17 19:23   ` Jonathan Wakely

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).