[LTO][PATCH] Small patch to retain lto1 temporary files with collect2 -debug

Simon Baldwin simonb@google.com
Mon Feb 9 12:02:00 GMT 2009


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);
       {



More information about the Gcc-patches mailing list