From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7897) id 43C3D3856DC0; Mon, 24 Oct 2022 08:21:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43C3D3856DC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666599677; bh=YP0ALYCd36PRqChq6IjqyiVT3AlN0T8Ta+g5AYtBRGE=; h=From:To:Subject:Date:From; b=OvxxS5z2VXfUI4uf719/FEIRZZAtANPAxEF9IYLrjo8JtCFoIzWYmtN7DxxMJ4J5I qi6Z07VxbwiMJC36KNT9NFoNei6c1m4/R82H7vFMw8THPxs/BPcEuDhDhfpxfHHz8f 72mkmevBv3W0V1XaDzTb2bOXSPMgZ8I4ism4rS4Y= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Torbjorn Svensson To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3452] lto: Always quote path to touch X-Act-Checkin: gcc X-Git-Author: =?utf-8?q?Torbj=C3=B6rn_SVENSSON?= X-Git-Refname: refs/heads/master X-Git-Oldrev: 6bfea64164c3f1989d34656ab96d03a7cda2143e X-Git-Newrev: 47db37ed477f29ac52c4484c260138d15e44a36b Message-Id: <20221024082117.43C3D3856DC0@sourceware.org> Date: Mon, 24 Oct 2022 08:21:17 +0000 (GMT) List-Id: https://gcc.gnu.org/g:47db37ed477f29ac52c4484c260138d15e44a36b commit r13-3452-g47db37ed477f29ac52c4484c260138d15e44a36b Author: Torbjörn SVENSSON 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 Signed-off-by: Torbjörn SVENSSON 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