This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[LTO][PATCH] Small patch to retain lto1 temporary files with collect2 -debug
- From: simonb at google dot com (Simon Baldwin)
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 9 Feb 2009 11:56:35 +0000 (GMT)
- Subject: [LTO][PATCH] Small patch to retain lto1 temporary files with collect2 -debug
Collect2's -debug flag controls retention of collect2 temporary files. This
patch allows -debug to also tell lto1 to retain temporary WPA files.
It's a temporary patch, pending a decent overhaul of the entire area of LTO
WPA temporary file control.
2009-02-09 Simon Baldwin <simonb@google.com>
* collect2.c (maybe_run_lto_and_relink): Set environment variable
WPA_SAVE_LTRANS=1 if debug.
Index: gcc/collect2.c
===================================================================
--- gcc/collect2.c (revision 143984)
+++ gcc/collect2.c (working copy)
@@ -938,6 +938,10 @@ maybe_run_lto_and_relink (char **lto_ld_
*lto_c_ptr = NULL;
+ /* Save intermediate WPA files in lto1 if debug. */
+ if (debug)
+ putenv (xstrdup ("WPA_SAVE_LTRANS=1"));
+
/* Run the LTO back end. */
pex = collect_execute (prog, lto_c_argv, NULL, NULL, PEX_SEARCH);
{