From patchwork Mon Mar 13 12:25:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 66293 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 73ECB3857B8E for ; Mon, 13 Mar 2023 12:25:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 90E443858D32 for ; Mon, 13 Mar 2023 12:25:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 90E443858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.98,256,1673942400"; d="diff'?scan'208";a="99807525" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 13 Mar 2023 04:25:11 -0800 IronPort-SDR: PYvYob8i54n3G/j16SzH2ZQpKnKcndHdz4go148GcBf74BRZ/8fOHxUQxzGgYJVf0CbM0mZ93r GOA1W2qBlgKDs+BeAscyyl+KbGgSAM7a7iiAWORJkUetEsKah/+H7/aYIyKl1RY5OyRzKT1zZy GMdmdD4EdmgxTQmiPEgjsnxYxH+9EL84BZvWkQd+8znpx8TekBI7i5r8JZOj0mBMWCsP0/IgHo FJSyVTy8yFIc+rv6E7CdBu5q8C+UIEpXAZVjCtslMvj3VxbWj27wiiiZg3UKlF3TN0B/afSQit hdQ= Message-ID: <41a0d8cc-f505-7ffd-ccbb-da39e2cb38e0@codesourcery.com> Date: Mon, 13 Mar 2023 13:25:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: Andrew Stubbs , gcc-patches From: Tobias Burnus Subject: [Patch] gcn/mkoffload.cc: Pass -save-temps on for the hsaco step X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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.29 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 Sender: "Gcc-patches" Found when comparing '-v -Wl,-v' output as despite -save-temps multiple runs yielded differed results. Fixed as attached. OK for mainline? Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 gcn/mkoffload.cc: Pass -save-temps on for the hsaco step For the assembly/linking step of the device code, the "-save-temps" was not passed on, such that amdgcn-amdhsa/bin/as and amdgcn-amdhsa's collect2 were invoked with '-o /tmp/cc...' and '@/tmp/cc...', respectively. The -dump... prefix (...mkoffload.hsaco) was already properly set. gcc/ChangeLog: * config/gcn/mkoffload.cc (main): Pass -save-temps on for the hsaco assemble/link. diff --git a/gcc/config/gcn/mkoffload.cc b/gcc/config/gcn/mkoffload.cc index 9493f89fec3..61bc9273077 100644 --- a/gcc/config/gcn/mkoffload.cc +++ b/gcc/config/gcn/mkoffload.cc @@ -1082,6 +1082,9 @@ main (int argc, char **argv) if (verbose) obstack_ptr_grow (&ld_argv_obstack, "-v"); + if (save_temps) + obstack_ptr_grow (&ld_argv_obstack, "-save-temps"); + for (int i = 1; i < argc; i++) if (startswith (argv[i], "-l") || startswith (argv[i], "-Wl")