public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marc Glisse <marc.glisse@inria.fr>
To: Florian Weimer <fweimer@redhat.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Triggering -save-temps from the front-end code
Date: Mon, 28 Nov 2022 18:18:40 +0100 (CET)	[thread overview]
Message-ID: <bf20a3eb-531e-1295-f1ef-7f086c9a6089@inria.fr> (raw)
In-Reply-To: <87pmd7rzkd.fsf@oldenburg.str.redhat.com>

On Mon, 28 Nov 2022, Florian Weimer via Gcc wrote:

> * Arsen Arsenović:
>
>> Hi,
>>
>> Florian Weimer via Gcc <gcc@gcc.gnu.org> writes:
>>
>>> Unfortunately, some build systems immediately delete the input source
>>> files.  Is there some easy way I can dump the pre-processed and
>>> non-preprocessed sources to my log file?  I tried to understand how
>>> -save-temps for crash recovery works, but it seems that this runs
>>> outside of the frontend, in the driver.
>>
>> Would dumping unconditionally into some "side channel" -dumpdir be a
>> sufficient workaround?
>
> Of the file names overlap, and it seems in this case, the dump files are
> just overwritten.  I don't see a way to make the file names unique.
>
> I guess for the tough cases, I can just keep running the build under
> strace.

You could override unlink with LD_PRELOAD. Use a special purpose 
filesystem (gitfs? I haven't tried it yet). Wrap gcc with a command that 
calls the true gcc with a different TMPDIR / -dumpdir each time.

-- 
Marc Glisse

      reply	other threads:[~2022-11-28 17:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 11:28 Florian Weimer
2022-11-28 11:44 ` Richard Biener
2022-11-28 13:02 ` Arsen Arsenović
2022-11-28 13:14   ` Florian Weimer
2022-11-28 17:18     ` Marc Glisse [this message]

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=bf20a3eb-531e-1295-f1ef-7f086c9a6089@inria.fr \
    --to=marc.glisse@inria.fr \
    --cc=fweimer@redhat.com \
    --cc=gcc@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).