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: 68806 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1152661wrd; Mon, 13 Mar 2023 05:25:44 -0700 (PDT) X-Google-Smtp-Source: AK7set93ldbHd9ANro861BxyZoZQkIDznwnZMlGGzhriJ8kLlAcAKvI+6sbWZcdwLBecki0hXfLt X-Received: by 2002:a17:907:31ca:b0:88d:f759:15b0 with SMTP id xf10-20020a17090731ca00b0088df75915b0mr40967532ejb.45.1678710343866; Mon, 13 Mar 2023 05:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678710343; cv=none; d=google.com; s=arc-20160816; b=FOGUYLUrFj+VqG/zrNyAEZcLPSQg5m/3cGn6YDe7e8x+TqujZrOrSQcpMv0C5JokJL 8cDu/gvr/4Oq/02haNlW3NTSJwzz60devJgobXCSSdgLtDZHW7Ip3jOI3Mv2uPvn+7Z0 BbPcGiNu0p1HwuXRSlplkD4Y06c5AbO0lI+29TUYjbmUQMnjMLYnMeAoMMY+dzESWA+i GS9jXZnNVoHJFFMiqjcqMJd5MRRo/vgdACf6+pzgXJ2FsC7Rk3dVvCP/JBfc34+gM5GF 6SiLMqd3DIlOVHgEWEpSew/EYbk2Uh/3/JbmiI0VdaXMaMuNspM3QOGBtkWTrbnBxmVt Ikbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:from:to :content-language:user-agent:mime-version:date:message-id :ironport-sdr:dmarc-filter:delivered-to; bh=fAJAJTOBi7NB/VAR8R2U5NWySLcLxwiNsnDhQ87NTGQ=; b=cmDmSMtsiCF6+3BYUWU/xNYwKEKUUgT0F10NZ4kCKDyQzNJQhzzqFMJjwW8Kjxn6cf /fdcCqu5P/Qo0oP23yfJENMhHqHMRY+krg8tx99B+WmhQs76I0QbqiwBblJfWaPR7RUC FVRJE0iZ140MCPgamEioPKF7SCmJD9Zv0hwa7GZVaD6pdbyBbYR5TOzdDBav0qc7orKU bUiGA5iyugvdHjygyZPm7TPfIhtipFNXZcEU4vYcz4TtfEnty0wjVkPg38oATGaX6A0u GNSydL9jle8XuNfxgL72hFb3mr41GQFthhct8OpjGd6/TnhEwEFwoTXV8+DiFYtLnlCs UGRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id jt12-20020a170906ca0c00b008b31e35479csi7276215ejb.639.2023.03.13.05.25.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:25:43 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3CAC938582AC for ; Mon, 13 Mar 2023 12:25:38 +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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760255377713639698?= X-GMAIL-MSGID: =?utf-8?q?1760255377713639698?= 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")