public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] lto: Always quote path to touch
@ 2022-10-21 12:24 Torbjörn SVENSSON
  2022-10-24  8:07 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Torbjörn SVENSSON @ 2022-10-21 12:24 UTC (permalink / raw)
  To: gcc-patches; +Cc: rguenther, yvan.roux, Torbjörn SVENSSON

When generating the makefile, make sure that the paths are quoted so
that a native Windows path works within Cygwin.

Without this patch, this error is reported by the DejaGNU test suite:

make: [T:\ccMf0kI3.mk:3: T:\ccGEvdDp.ltrans0.ltrans.o] Error 1 (ignored)

The generated makefile fragment without the patch:

T:\ccGEvdDp.ltrans0.ltrans.o:
  @T:\build\bin\arm-none-eabi-g++.exe '-xlto' ... '-o' 'T:\ccGEvdDp.ltrans0.ltrans.o' 'T:\ccGEvdDp.ltrans0.o'
  @-touch -r T:\ccGEvdDp.ltrans0.o T:\ccGEvdDp.ltrans0.o.tem > /dev/null 2>&1 && mv T:\ccGEvdDp.ltrans0.o.tem T:\ccGEvdDp.ltrans0.o
.PHONY: all
all: \
  T:\ccGEvdDp.ltrans0.ltrans.o

With the patch, the touch line would be replace with:

  @-touch -r "T:\ccGEvdDp.ltrans0.o" "T:\ccGEvdDp.ltrans0.o.tem" > /dev/null 2>&1 && mv "T:\ccGEvdDp.ltrans0.o.tem" "T:\ccGEvdDp.ltrans0.o"

gcc/ChangeLog:

	* lto-wrapper.cc: Quote paths in makefile.

Co-Authored-By: Yvan ROUX <yvan.roux@foss.st.com>
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
---
 gcc/lto-wrapper.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc
index 9a764702ffc..b12bcc1ad27 100644
--- a/gcc/lto-wrapper.cc
+++ b/gcc/lto-wrapper.cc
@@ -2010,8 +2010,8 @@ cont:
 	         truncate them as soon as we have processed it.  This
 		 reduces temporary disk-space usage.  */
 	      if (! save_temps)
-		fprintf (mstream, "\t@-touch -r %s %s.tem > /dev/null 2>&1 "
-			 "&& mv %s.tem %s\n",
+		fprintf (mstream, "\t@-touch -r \"%s\" \"%s.tem\" > /dev/null "
+			 "2>&1 && mv \"%s.tem\" \"%s\"\n",
 			 input_name, input_name, input_name, input_name); 
 	    }
 	  else
-- 
2.25.1


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

* Re: [PATCH] lto: Always quote path to touch
  2022-10-21 12:24 [PATCH] lto: Always quote path to touch Torbjörn SVENSSON
@ 2022-10-24  8:07 ` Richard Biener
  2022-10-24  8:47   ` Torbjorn SVENSSON
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2022-10-24  8:07 UTC (permalink / raw)
  To: Torbjörn SVENSSON; +Cc: gcc-patches, yvan.roux

On Fri, 21 Oct 2022, Torbj?rn SVENSSON wrote:

> When generating the makefile, make sure that the paths are quoted so
> that a native Windows path works within Cygwin.
> 
> Without this patch, this error is reported by the DejaGNU test suite:
> 
> make: [T:\ccMf0kI3.mk:3: T:\ccGEvdDp.ltrans0.ltrans.o] Error 1 (ignored)
> 
> The generated makefile fragment without the patch:
> 
> T:\ccGEvdDp.ltrans0.ltrans.o:
>   @T:\build\bin\arm-none-eabi-g++.exe '-xlto' ... '-o' 'T:\ccGEvdDp.ltrans0.ltrans.o' 'T:\ccGEvdDp.ltrans0.o'
>   @-touch -r T:\ccGEvdDp.ltrans0.o T:\ccGEvdDp.ltrans0.o.tem > /dev/null 2>&1 && mv T:\ccGEvdDp.ltrans0.o.tem T:\ccGEvdDp.ltrans0.o
> .PHONY: all
> all: \
>   T:\ccGEvdDp.ltrans0.ltrans.o
> 
> With the patch, the touch line would be replace with:
> 
>   @-touch -r "T:\ccGEvdDp.ltrans0.o" "T:\ccGEvdDp.ltrans0.o.tem" > /dev/null 2>&1 && mv "T:\ccGEvdDp.ltrans0.o.tem" "T:\ccGEvdDp.ltrans0.o"
> 
> gcc/ChangeLog:

OK.

Thanks,
Richard.

> 	* lto-wrapper.cc: Quote paths in makefile.
> 
> Co-Authored-By: Yvan ROUX <yvan.roux@foss.st.com>
> Signed-off-by: Torbj?rn SVENSSON <torbjorn.svensson@foss.st.com>
> ---
>  gcc/lto-wrapper.cc | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc
> index 9a764702ffc..b12bcc1ad27 100644
> --- a/gcc/lto-wrapper.cc
> +++ b/gcc/lto-wrapper.cc
> @@ -2010,8 +2010,8 @@ cont:
>  	         truncate them as soon as we have processed it.  This
>  		 reduces temporary disk-space usage.  */
>  	      if (! save_temps)
> -		fprintf (mstream, "\t@-touch -r %s %s.tem > /dev/null 2>&1 "
> -			 "&& mv %s.tem %s\n",
> +		fprintf (mstream, "\t@-touch -r \"%s\" \"%s.tem\" > /dev/null "
> +			 "2>&1 && mv \"%s.tem\" \"%s\"\n",
>  			 input_name, input_name, input_name, input_name); 
>  	    }
>  	  else
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg,
Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman;
HRB 36809 (AG Nuernberg)

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

* Re: [PATCH] lto: Always quote path to touch
  2022-10-24  8:07 ` Richard Biener
@ 2022-10-24  8:47   ` Torbjorn SVENSSON
  0 siblings, 0 replies; 3+ messages in thread
From: Torbjorn SVENSSON @ 2022-10-24  8:47 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, yvan.roux



On 2022-10-24 10:07, Richard Biener wrote:
> On Fri, 21 Oct 2022, Torbj?rn SVENSSON wrote:
> 
>> When generating the makefile, make sure that the paths are quoted so
>> that a native Windows path works within Cygwin.
>>
>> Without this patch, this error is reported by the DejaGNU test suite:
>>
>> make: [T:\ccMf0kI3.mk:3: T:\ccGEvdDp.ltrans0.ltrans.o] Error 1 (ignored)
>>
>> The generated makefile fragment without the patch:
>>
>> T:\ccGEvdDp.ltrans0.ltrans.o:
>>    @T:\build\bin\arm-none-eabi-g++.exe '-xlto' ... '-o' 'T:\ccGEvdDp.ltrans0.ltrans.o' 'T:\ccGEvdDp.ltrans0.o'
>>    @-touch -r T:\ccGEvdDp.ltrans0.o T:\ccGEvdDp.ltrans0.o.tem > /dev/null 2>&1 && mv T:\ccGEvdDp.ltrans0.o.tem T:\ccGEvdDp.ltrans0.o
>> .PHONY: all
>> all: \
>>    T:\ccGEvdDp.ltrans0.ltrans.o
>>
>> With the patch, the touch line would be replace with:
>>
>>    @-touch -r "T:\ccGEvdDp.ltrans0.o" "T:\ccGEvdDp.ltrans0.o.tem" > /dev/null 2>&1 && mv "T:\ccGEvdDp.ltrans0.o.tem" "T:\ccGEvdDp.ltrans0.o"
>>
>> gcc/ChangeLog:
> 
> OK.
> 
> Thanks,
> Richard.
> 
>> 	* lto-wrapper.cc: Quote paths in makefile.
>>
>> Co-Authored-By: Yvan ROUX <yvan.roux@foss.st.com>
>> Signed-off-by: Torbj?rn SVENSSON <torbjorn.svensson@foss.st.com>
>> ---
>>   gcc/lto-wrapper.cc | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc
>> index 9a764702ffc..b12bcc1ad27 100644
>> --- a/gcc/lto-wrapper.cc
>> +++ b/gcc/lto-wrapper.cc
>> @@ -2010,8 +2010,8 @@ cont:
>>   	         truncate them as soon as we have processed it.  This
>>   		 reduces temporary disk-space usage.  */
>>   	      if (! save_temps)
>> -		fprintf (mstream, "\t@-touch -r %s %s.tem > /dev/null 2>&1 "
>> -			 "&& mv %s.tem %s\n",
>> +		fprintf (mstream, "\t@-touch -r \"%s\" \"%s.tem\" > /dev/null "
>> +			 "2>&1 && mv \"%s.tem\" \"%s\"\n",
>>   			 input_name, input_name, input_name, input_name);
>>   	    }
>>   	  else
>>
> 


Pushed.

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

end of thread, other threads:[~2022-10-24  8:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21 12:24 [PATCH] lto: Always quote path to touch Torbjörn SVENSSON
2022-10-24  8:07 ` Richard Biener
2022-10-24  8:47   ` Torbjorn SVENSSON

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