From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 15D71385840A; Tue, 26 Mar 2024 20:37:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 15D71385840A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711485446; bh=tYjNlv4oqlN4MvYFs7wr+WweUzCwJG3D2YsWgDfZ0bs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=v8j3mIA9XHlqSnE6Obn+VDWB3mFnYqeADJTZsQKQU/04QGIRVlXvSxwW/Sow0RmnG pZ2RsEOvFRyFPgGIKzY3wnjou1epPPTbEOvA5V2zFClEK81mggDMuyOTYyU+7dXlsE u9oVYEPBkKJ/01KZc0KswZAZg4NVQe5/qDFbIH2w= From: "peter0x44 at disroot dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/110710] LTO linker on Windows creates an invalid Makefile Date: Tue, 26 Mar 2024 20:37:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: peter0x44 at disroot dot org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110710 --- Comment #12 from peter0x44 at disroot dot org --- diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc index 5186d040ce0..7119157d830 100644 --- a/gcc/lto-wrapper.cc +++ b/gcc/lto-wrapper.cc @@ -2024,9 +2024,7 @@ 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/nu= ll " - "2>&1 && mv \"%s.tem\" \"%s\"\n", - input_name, input_name, input_name, input_name); + fprintf (mstream, "\t@-copy /y nul \"%s\"" input_name); } else { This experimental patch works for me, it doesn't seem to matter if the timestamp gets updated. I guess what's left to do is write code that runs "= sh -c "true"" to determine if there is an sh.exe present, and then emit the correct fragment to truncate the file.=