[v2] gcov: Respect triplet when looking for gcov

Message ID 20220909125624.2561867-1-torbjorn.svensson@foss.st.com
State New, archived
Headers
Series [v2] gcov: Respect triplet when looking for gcov |

Commit Message

Torbjorn SVENSSON Sept. 9, 2022, 12:56 p.m. UTC
  When testing a cross toolchain outside the build tree, the binary name
for gcov is prefixed with the triplet.

gcc/testsuite/ChangeLog:

        * g++.dg/gcov/gcov.exp: Respect triplet when looking for gcov.
        * gcc.misc-tests/gcov.exp: Likewise.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
---
 gcc/testsuite/g++.dg/gcov/gcov.exp    | 4 ++--
 gcc/testsuite/gcc.misc-tests/gcov.exp | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
  

Comments

Mikael Morin Sept. 11, 2022, 2:34 p.m. UTC | #1
Hello,

> diff --git a/gcc/testsuite/gcc.misc-tests/gcov.exp b/gcc/testsuite/gcc.misc-tests/gcov.exp
> index 82376d90ac2..a55ce234f6e 100644
> --- a/gcc/testsuite/gcc.misc-tests/gcov.exp
> +++ b/gcc/testsuite/gcc.misc-tests/gcov.exp
> @@ -24,9 +24,9 @@ global GCC_UNDER_TEST
  (...)
>   } else {
> -    set GCOV gcov
> +    set GCOV {transform gcov]

Typo: I guess the opening curly bracket '{' should be a square one '['?
  
Torbjorn SVENSSON Sept. 11, 2022, 4:04 p.m. UTC | #2
Hi,

On 2022-09-11 16:34, Mikael Morin wrote:
> Hello,
> 
>> diff --git a/gcc/testsuite/gcc.misc-tests/gcov.exp 
>> b/gcc/testsuite/gcc.misc-tests/gcov.exp
>> index 82376d90ac2..a55ce234f6e 100644
>> --- a/gcc/testsuite/gcc.misc-tests/gcov.exp
>> +++ b/gcc/testsuite/gcc.misc-tests/gcov.exp
>> @@ -24,9 +24,9 @@ global GCC_UNDER_TEST
>   (...)
>>   } else {
>> -    set GCOV gcov
>> +    set GCOV {transform gcov]
> 
> Typo: I guess the opening curly bracket '{' should be a square one '['?

Yes. Apparently I was too stressed when preparing this patch. Can you 
fix it for me and submit it or do you want me to send a v3?
  
Mikael Morin Sept. 11, 2022, 7:38 p.m. UTC | #3
Le 11/09/2022 à 18:04, Torbjorn SVENSSON a écrit :
> Can you fix it for me and submit it or do you want me to send a v3?

For trivial things like this, there is no need for a v3 (nor was there 
for a v2).
Do you miss a git write account and need someone to push for you?
  
Torbjorn SVENSSON Sept. 12, 2022, 7:06 a.m. UTC | #4
On 2022-09-11 21:38, Mikael Morin wrote:
> Le 11/09/2022 à 18:04, Torbjorn SVENSSON a écrit :
>> Can you fix it for me and submit it or do you want me to send a v3?
> 
> For trivial things like this, there is no need for a v3 (nor was there 
> for a v2).
> Do you miss a git write account and need someone to push for you?

Ok!

I do not have any write access, so yes, please push it for me!
  
Mikael Morin Sept. 12, 2022, 7:40 a.m. UTC | #5
Le 12/09/2022 à 09:06, Torbjorn SVENSSON a écrit :
> 
> 
> On 2022-09-11 21:38, Mikael Morin wrote:
>> Le 11/09/2022 à 18:04, Torbjorn SVENSSON a écrit :
>>> Can you fix it for me and submit it or do you want me to send a v3?
>>
>> For trivial things like this, there is no need for a v3 (nor was there 
>> for a v2).
>> Do you miss a git write account and need someone to push for you?
> 
> Ok!
> 
> I do not have any write access, so yes, please push it for me!

No problem, I will do it the next time I synchronize my work tree, but 
it will have to wait a few days until that time.
  
Martin Liška Sept. 12, 2022, 8:40 a.m. UTC | #6
On 9/12/22 09:06, Torbjorn SVENSSON via Gcc-patches wrote:
> 
> 
> On 2022-09-11 21:38, Mikael Morin wrote:
>> Le 11/09/2022 à 18:04, Torbjorn SVENSSON a écrit :
>>> Can you fix it for me and submit it or do you want me to send a v3?
>>
>> For trivial things like this, there is no need for a v3 (nor was there for a v2).
>> Do you miss a git write account and need someone to push for you?
> 
> Ok!
> 
> I do not have any write access, so yes, please push it for me!

Please attach a patch with git format-patch and I'm going to push it now.

Cheers,
Martin
  
Torbjorn SVENSSON Sept. 12, 2022, 9:39 a.m. UTC | #7
On 2022-09-12 10:40, Martin Liška wrote:
> On 9/12/22 09:06, Torbjorn SVENSSON via Gcc-patches wrote:
>>
>>
>> On 2022-09-11 21:38, Mikael Morin wrote:
>>> Le 11/09/2022 à 18:04, Torbjorn SVENSSON a écrit :
>>>> Can you fix it for me and submit it or do you want me to send a v3?
>>>
>>> For trivial things like this, there is no need for a v3 (nor was there for a v2).
>>> Do you miss a git write account and need someone to push for you?
>>
>> Ok!
>>
>> I do not have any write access, so yes, please push it for me!
> 
> Please attach a patch with git format-patch and I'm going to push it now.
> 
> Cheers,
> Martin

Patch attached as requested.
From 0400f4b34a62ad5a54e87c537b4a41bc630fd105 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Torbj=C3=B6rn=20SVENSSON?= <torbjorn.svensson@foss.st.com>
Date: Fri, 9 Sep 2022 12:19:27 +0200
Subject: [PATCH] gcov: Respect triplet when looking for gcov
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When testing a cross toolchain outside the build tree, the binary name
for gcov is prefixed with the triplet.

gcc/testsuite/ChangeLog:

        * g++.dg/gcov/gcov.exp: Respect triplet when looking for gcov.
        * gcc.misc-tests/gcov.exp: Likewise.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
---
 gcc/testsuite/g++.dg/gcov/gcov.exp    | 4 ++--
 gcc/testsuite/gcc.misc-tests/gcov.exp | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/g++.dg/gcov/gcov.exp b/gcc/testsuite/g++.dg/gcov/gcov.exp
index 88acd95c361..04e7a016486 100644
--- a/gcc/testsuite/g++.dg/gcov/gcov.exp
+++ b/gcc/testsuite/g++.dg/gcov/gcov.exp
@@ -24,9 +24,9 @@ global GXX_UNDER_TEST
 
 # Find gcov in the same directory as $GXX_UNDER_TEST.
 if { ![is_remote host] && [string match "*/*" [lindex $GXX_UNDER_TEST 0]] } {
-    set GCOV [file dirname [lindex $GXX_UNDER_TEST 0]]/gcov
+    set GCOV [file dirname [lindex $GXX_UNDER_TEST 0]]/[transform gcov]
 } else {
-    set GCOV gcov
+    set GCOV [transform gcov]
 }
 
 # Initialize harness.
diff --git a/gcc/testsuite/gcc.misc-tests/gcov.exp b/gcc/testsuite/gcc.misc-tests/gcov.exp
index 82376d90ac2..b8e9661aa53 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov.exp
+++ b/gcc/testsuite/gcc.misc-tests/gcov.exp
@@ -24,9 +24,9 @@ global GCC_UNDER_TEST
 
 # For now find gcov in the same directory as $GCC_UNDER_TEST.
 if { ![is_remote host] && [string match "*/*" [lindex $GCC_UNDER_TEST 0]] } {
-    set GCOV [file dirname [lindex $GCC_UNDER_TEST 0]]/gcov
+    set GCOV [file dirname [lindex $GCC_UNDER_TEST 0]]/[transform gcov]
 } else {
-    set GCOV gcov
+    set GCOV [transform gcov]
 }
 
 # Initialize harness.
  
Martin Liška Sept. 12, 2022, 9:42 a.m. UTC | #8
On 9/12/22 11:39, Torbjorn SVENSSON wrote:
> On 2022-09-12 10:40, Martin Liška wrote:
>> On 9/12/22 09:06, Torbjorn SVENSSON via Gcc-patches wrote:
>>>
>>>
>>> On 2022-09-11 21:38, Mikael Morin wrote:
>>>> Le 11/09/2022 à 18:04, Torbjorn SVENSSON a écrit :
>>>>> Can you fix it for me and submit it or do you want me to send a v3?
>>>>
>>>> For trivial things like this, there is no need for a v3 (nor was there for a v2).
>>>> Do you miss a git write account and need someone to push for you?
>>>
>>> Ok!
>>>
>>> I do not have any write access, so yes, please push it for me!
>>
>> Please attach a patch with git format-patch and I'm going to push it now.
>>
>> Cheers,
>> Martin
> 
> Patch attached as requested.

Thanks.

Pushed with a small correction of the commit message:
remote: *** ChangeLog format failed:
remote: *** ERR: line should start with a tab: "        * g++.dg/gcov/gcov.exp: Respect triplet when looking for gcov."
remote: *** ERR: line should start with a tab: "        * gcc.misc-tests/gcov.exp: Likewise."

as 34b9a03353d3fdc5c57f2708469d0df78c6d6508.

Cheers,
Martin
  

Patch

diff --git a/gcc/testsuite/g++.dg/gcov/gcov.exp b/gcc/testsuite/g++.dg/gcov/gcov.exp
index 88acd95c361..04e7a016486 100644
--- a/gcc/testsuite/g++.dg/gcov/gcov.exp
+++ b/gcc/testsuite/g++.dg/gcov/gcov.exp
@@ -24,9 +24,9 @@  global GXX_UNDER_TEST
 
 # Find gcov in the same directory as $GXX_UNDER_TEST.
 if { ![is_remote host] && [string match "*/*" [lindex $GXX_UNDER_TEST 0]] } {
-    set GCOV [file dirname [lindex $GXX_UNDER_TEST 0]]/gcov
+    set GCOV [file dirname [lindex $GXX_UNDER_TEST 0]]/[transform gcov]
 } else {
-    set GCOV gcov
+    set GCOV [transform gcov]
 }
 
 # Initialize harness.
diff --git a/gcc/testsuite/gcc.misc-tests/gcov.exp b/gcc/testsuite/gcc.misc-tests/gcov.exp
index 82376d90ac2..a55ce234f6e 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov.exp
+++ b/gcc/testsuite/gcc.misc-tests/gcov.exp
@@ -24,9 +24,9 @@  global GCC_UNDER_TEST
 
 # For now find gcov in the same directory as $GCC_UNDER_TEST.
 if { ![is_remote host] && [string match "*/*" [lindex $GCC_UNDER_TEST 0]] } {
-    set GCOV [file dirname [lindex $GCC_UNDER_TEST 0]]/gcov
+    set GCOV [file dirname [lindex $GCC_UNDER_TEST 0]]/[transform gcov]
 } else {
-    set GCOV gcov
+    set GCOV {transform gcov]
 }
 
 # Initialize harness.