From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 32E723858439 for ; Mon, 24 Oct 2022 08:07:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 32E723858439 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 154B221B6D; Mon, 24 Oct 2022 08:07:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1666598850; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2rOzZBF7H5jizToJLjIXKsDkhByUxSn9OO0ARGTGcZc=; b=DvvdFQjBwmf9ad4b9sMYZGtk3al6NPxeMvHahuT0u52Tjr2xU3e2XYvX/xhSp87YC1JBWH z5ZaIC6gUuYszYd8LqsoJoE76HX6abxL+YHgxJNhhfXYXRVLWw9TkYu8AOZfhZ+nTY2/yF MGti7DJVW0YFDvwth3QS5XouJ0XIivs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1666598850; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2rOzZBF7H5jizToJLjIXKsDkhByUxSn9OO0ARGTGcZc=; b=oyuXvRDqN1IZ6yyeZ5BHgdWM5+twGLLrWIk8TQG2n0GtBvqZfcUnm/UkV9L7ynFpaTDfp8 VZiNjHF2wInQhSBw== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 0DF642C141; Mon, 24 Oct 2022 08:07:29 +0000 (UTC) Date: Mon, 24 Oct 2022 08:07:29 +0000 (UTC) From: Richard Biener To: =?ISO-8859-15?Q?Torbj=F6rn_SVENSSON?= cc: gcc-patches@gcc.gnu.org, yvan.roux@foss.st.com Subject: Re: [PATCH] lto: Always quote path to touch In-Reply-To: <20221021122414.3375395-1-torbjorn.svensson@foss.st.com> Message-ID: References: <20221021122414.3375395-1-torbjorn.svensson@foss.st.com> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 > Signed-off-by: Torbj?rn SVENSSON > --- > 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 SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)