From patchwork Sun Apr 28 23:16:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Damianov X-Patchwork-Id: 89114 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 95A31385841F for ; Sun, 28 Apr 2024 23:16:55 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id D3DA73858D37 for ; Sun, 28 Apr 2024 23:16:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D3DA73858D37 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D3DA73858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714346189; cv=none; b=hEqT9dxaA2HVv6yDslHqwZkbj80RHHyIdfngLvv+gqLDvfhr+4V7MwhPZygnrJHRjNPBzVkcjgpR7GLYixMfey1nnlKny8gGWmx3uI+0mVP6twEbTDvi8ZhUvLp8mQa+CkBYthS1OKKwnFrtSNSu82im4hDoStjsHZhI2wg6gjU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714346189; c=relaxed/simple; bh=yCZjTaJH2SmJH5GKd9bKE8+PdPlJDwz06NSdT0PomN0=; h=From:DKIM-Signature:To:Subject:Date:Message-Id:MIME-Version; b=t2OHZVcmopuAZV0/2x8H5fbUsWfd8My1wPRTST0LiSTpsBJDtEMfWOMXdqekDud80pH73u7+LMmyEruXBNepElNnOWI3bdwE8kqZy5YQcIAhZaIg5/OQzphNx999eW9moV8ACQn7hE754VZFRdIV0Z8qppdMSFZbAk+LfXjAtD8= ARC-Authentication-Results: i=1; server2.sourceware.org X-Virus-Scanned: SPAM Filter at disroot.org From: Peter Damianov DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1714346185; bh=yCZjTaJH2SmJH5GKd9bKE8+PdPlJDwz06NSdT0PomN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ilRVLFIv4Ti7Kdo1JNninYRa0p//1WHcJjTLTpDGJ+nix7PjwRBF7tXNl+cBzl1JP MxS1x8SlmjGgNiqGRMxqs8zy/nKkAa5tdO95L0N1NZ80EnHs+gQIJvutufkgItq/F+ uZXM7IKTexw3jXneRT0GP2CVxq5xpOeNE78JBApgILp0KRBPwFgu3tkpzhAmTJITqB N4pIBxdMjj0/EGbHsA3MQjROwLUAqfb8Va49pRr9fiw0cq1xYj8jL88W2aqprvaQiW nV3ygsWjjbldHH5T4ITkWtOpTci8XUfLC77Exh3cNZVY+hC2Z5ev1eCx14whCY8Pll 9s6v/LclOEDVA== To: gcc-patches@gcc.gnu.org Cc: Peter Damianov Subject: [PATCH v3 2/2] lto-wrapper: Truncate files using -truncate driver option [PR110710] Date: Sun, 28 Apr 2024 16:16:12 -0700 Message-Id: <20240428231612.25802-2-peter0x44@disroot.org> In-Reply-To: <20240428231612.25802-1-peter0x44@disroot.org> References: <20240428231612.25802-1-peter0x44@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org This commit changes the Makefiles generated by lto-wrapper to no longer use the "mv" and "touch" shell commands. These don't exist on Windows, so when the Makefile attempts to call them, it results in errors like: The system cannot find the file specified. This problem only manifested when calling gcc from cmd.exe, and having no sh.exe present on the PATH. The Windows port of GNU Make searches the PATH for an sh.exe, and uses it if present. I have tested this in environments with and without sh.exe on the PATH and confirmed it works as expected. Signed-off-by: Peter Damianov --- gcc/lto-wrapper.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc index 02579951569..cfded757f26 100644 --- a/gcc/lto-wrapper.cc +++ b/gcc/lto-wrapper.cc @@ -2023,14 +2023,12 @@ cont: fprintf (mstream, "%s:\n\t@%s ", output_name, new_argv[0]); for (j = 1; new_argv[j] != NULL; ++j) fprintf (mstream, " '%s'", new_argv[j]); - fprintf (mstream, "\n"); /* If we are not preserving the ltrans input files then 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", - input_name, input_name, input_name, input_name); + fprintf (mstream, " -truncate '%s'", input_name); + fprintf (mstream, "\n"); } else {