public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Torbjorn Svensson <azoff@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-3452] lto: Always quote path to touch
Date: Mon, 24 Oct 2022 08:21:17 +0000 (GMT)	[thread overview]
Message-ID: <20221024082117.43C3D3856DC0@sourceware.org> (raw)

https://gcc.gnu.org/g:47db37ed477f29ac52c4484c260138d15e44a36b

commit r13-3452-g47db37ed477f29ac52c4484c260138d15e44a36b
Author: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Date:   Fri Oct 21 12:29:13 2022 +0200

    lto: Always quote path to touch
    
    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>

Diff:
---
 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

                 reply	other threads:[~2022-10-24  8:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221024082117.43C3D3856DC0@sourceware.org \
    --to=azoff@gcc.gnu.org \
    --cc=gcc-cvs@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).