public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Andrew Stubbs <ams@codesourcery.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [Patch] gcn/mkoffload.cc: Pass -save-temps on for the hsaco step
Date: Mon, 13 Mar 2023 13:25:04 +0100	[thread overview]
Message-ID: <41a0d8cc-f505-7ffd-ccbb-da39e2cb38e0@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 425 bytes --]

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

[-- Attachment #2: save-temps-mkoffload-gcn.diff --]
[-- Type: text/x-patch, Size: 926 bytes --]

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")

             reply	other threads:[~2023-03-13 12:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 12:25 Tobias Burnus [this message]
2023-03-13 12:59 ` Andrew Stubbs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41a0d8cc-f505-7ffd-ccbb-da39e2cb38e0@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=ams@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).