This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]