From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sourceware.org (Postfix) with ESMTPS id AA97E3858C62 for ; Mon, 28 Nov 2022 17:18:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AA97E3858C62 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:reply-to:to:cc:subject:in-reply-to:message-id: references:mime-version:content-transfer-encoding; bh=O60tRDMDXjRvWlllF7ihNppCRgnW8IaMCQHPEiwoSKs=; b=bBmGBmfkAR3Ba9kUpRw4yLx7nyP2mcPADYr+9/Z6n1nISGB5d1ZgVBal /EmJ9ZN9vvasUD2pMOUDOj12C3chF1kc7F6m8VoAv/VbJfGaf3jMIQcAM NmJmmJwpST8rk6vf0sQjIGBE9FXSrsFT+n1FPD1hebZ81pvq0v5Neryij 0=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=marc.glisse@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.96,200,1665439200"; d="scan'208";a="41129316" Received: from roam-nat-fw-prg-194-254-61-41.net.univ-paris-diderot.fr (HELO eduroam-prg-sg-1-47-130.net.univ-paris-diderot.fr) ([194.254.61.41]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2022 18:18:41 +0100 Date: Mon, 28 Nov 2022 18:18:40 +0100 (CET) From: Marc Glisse Reply-To: gcc@gcc.gnu.org To: Florian Weimer cc: gcc@gcc.gnu.org Subject: Re: Triggering -save-temps from the front-end code In-Reply-To: <87pmd7rzkd.fsf@oldenburg.str.redhat.com> Message-ID: References: <87y1rvs4gd.fsf@oldenburg.str.redhat.com> <86edtnjkln.fsf@aarsen.me> <87pmd7rzkd.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 List-Id: On Mon, 28 Nov 2022, Florian Weimer via Gcc wrote: > * Arsen Arsenović: > >> Hi, >> >> Florian Weimer via Gcc 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