Hello, Joseph, Andrew,

Thanks for your feedback.

On Feb 28, 2020, Joseph Myers <jos...@codesourcery.com> wrote:

> On Fri, 28 Feb 2020, Alexandre Oliva wrote:

>> I'm not sure it's appropriate for the error to not omit the host
>> platform's executable suffix, just as it omits directory components from
>> argv[0], so I'm undecided between fixing collect2.c's initialization of
>> progname or extending the regexp, as in the (untested) patchlet below.

> I don't think the error should mention .exe, but I also don't think the 
> error should mention collect2 (see what I said in 
> <https://gcc.gnu.org/ml/gcc-patches/2019-11/msg01772.html>, the existence 
> of collect2 is an implementation detail).

I'm not changing collect2, at least not in this patch, but I wouldn't
mind making the match for the internal executable name optional.  WDYT?
Untested patch follows.


match .exe when prunning collect2 errors

From: Alexandre Oliva <ol...@adacore.com>

When collect* programs have an executable suffix, they may include it
in their outputs.  Match them when pruning gcc output, but prepare to
have the name of internal program names removed from the messages.


for  gcc/testsuite/ChangeLog

        * lib/prune.exp (prune_gcc_output): Optionally match executable
        suffix in collect messages, or no collect name whatsoever.
---
 gcc/testsuite/lib/prune.exp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp
index eea4bf3..6fc07d0 100644
--- a/gcc/testsuite/lib/prune.exp
+++ b/gcc/testsuite/lib/prune.exp
@@ -38,8 +38,8 @@ proc prune_gcc_output { text } {
     regsub -all "(^|\n)\[^\n\]*:   in .constexpr. expansion \[^\n\]*" $text "" 
text
     regsub -all "(^|\n)\[^\n\]*:   in requirements \[^\n\]*" $text "" text
     regsub -all "(^|\n)    inlined from \[^\n\]*" $text "" text
-    regsub -all "(^|\n)collect2: error: ld returned \[^\n\]*" $text "" text
-    regsub -all "(^|\n)collect: re(compiling|linking)\[^\n\]*" $text "" text
+    regsub -all "(^|\n)(collect2(\.exe)?)?: error: ld returned \[^\n\]*" $text 
"" text
+    regsub -all "(^|\n)(collect(\.exe)?)?: re(compiling|linking)\[^\n\]*" 
$text "" text
     regsub -all "(^|\n)Please submit.*instructions\[^\n\]*" $text "" text
     regsub -all "(^|\n)\[0-9\]\[0-9\]* errors\." $text "" text
     regsub -all "(^|\n)(In file included|\[ \]+from)\[^\n\]*" $text "" text


On Feb 28, 2020, Andrew Pinski <pins...@gmail.com> wrote:

> On Thu, Feb 27, 2020 at 9:17 PM Alexandre Oliva <ol...@adacore.com> wrote:
>> -    regsub -all "(^|\n)collect2: error: ld returned \[^\n\]*" $text "" text
>> +    regsub -all "(^|\n)collect2(\.exe)?: error: ld returned \[^\n\]*" $text 
>> "" text

> If you touch that line
> You may as well also touch this line too:

>> regsub -all "(^|\n)collect: re(compiling|linking)\[^\n\]*" $text "" text

Is collect, particularly the C++ template repo messages, still ever used?
Well, I guess it doesn't hurt to add the suffix to the match regardless...


match .exe when prunning collect2 errors

From: Alexandre Oliva <ol...@adacore.com>

When collect* programs have an executable suffix, they may include it
in their outputs.  Match them when pruning gcc output.

This was regstrapped on x86_64-linux-gnu.  Ok to install?


for  gcc/testsuite/ChangeLog

        * lib/prune.exp (prune_gcc_output): Optionally match executable
        suffix in collect messages.
---
 gcc/testsuite/lib/prune.exp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp
index eea4bf3..6fc07d0 100644
--- a/gcc/testsuite/lib/prune.exp
+++ b/gcc/testsuite/lib/prune.exp
@@ -38,8 +38,8 @@ proc prune_gcc_output { text } {
     regsub -all "(^|\n)\[^\n\]*:   in .constexpr. expansion \[^\n\]*" $text "" 
text
     regsub -all "(^|\n)\[^\n\]*:   in requirements \[^\n\]*" $text "" text
     regsub -all "(^|\n)    inlined from \[^\n\]*" $text "" text
-    regsub -all "(^|\n)collect2: error: ld returned \[^\n\]*" $text "" text
-    regsub -all "(^|\n)collect: re(compiling|linking)\[^\n\]*" $text "" text
+    regsub -all "(^|\n)collect2(\.exe)?: error: ld returned \[^\n\]*" $text "" 
text
+    regsub -all "(^|\n)collect(\.exe)?: re(compiling|linking)\[^\n\]*" $text 
"" text
     regsub -all "(^|\n)Please submit.*instructions\[^\n\]*" $text "" text
     regsub -all "(^|\n)\[0-9\]\[0-9\]* errors\." $text "" text
     regsub -all "(^|\n)(In file included|\[ \]+from)\[^\n\]*" $text "" text



-- 
Alexandre Oliva, freedom fighter    he/him    https://FSFLA.org/blogs/lxo/
Free Software Evangelist              Stallman was right, but he's left :(
GNU Toolchain Engineer           Live long and free, and prosper ethically

Reply via email to