public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Avoid invalid LTO mode errors
@ 2010-12-05 13:30 Jan Hubicka
  2010-12-08 14:32 ` Diego Novillo
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Hubicka @ 2010-12-05 13:30 UTC (permalink / raw)
  To: gcc-patches, rguenther

Hi,
compiling object produced with -flto with -fuse-linker-plugin only currently leads to 
invalid LTO mode fatal error. This is because linker claims the files, but no LTO mode
is specified.
While for fat objects (i.e. all we support at the moment) we probably should modify linker
plugin to not claim anything (I will do that incrementally), we really want to default
to WHOPR in lto-wraper: it is executed only when LTO is needed. This will be needed once we
support slim files.

Bootstrapped/regtested x86_64, linux, OK?

	* lto-wrapper.c (run_gcc): Default to WHOPR mode when none is specified
	at the command line.
Index: lto-wrapper.c
===================================================================
--- lto-wrapper.c	(revision 167472)
+++ lto-wrapper.c	(working copy)
@@ -422,7 +422,7 @@ run_gcc (unsigned argc, char *argv[])
       argv_ptr[1] = "-o";
       argv_ptr[2] = flto_out;
     }
-  else if (lto_mode == LTO_MODE_WHOPR)
+  else 
     {
       const char *list_option = "-fltrans-output-list=";
       size_t list_option_len = strlen (list_option);
@@ -457,8 +457,6 @@ run_gcc (unsigned argc, char *argv[])
 
       argv_ptr[2] = "-fwpa";
     }
-  else
-    fatal ("invalid LTO mode");
 
   /* Append the input objects and possible preceeding arguments.  */
   for (i = 1; i < argc; ++i)
@@ -473,7 +471,7 @@ run_gcc (unsigned argc, char *argv[])
       free (flto_out);
       flto_out = NULL;
     }
-  else if (lto_mode == LTO_MODE_WHOPR)
+  else
     {
       FILE *stream = fopen (ltrans_output_file, "r");
       FILE *mstream = NULL;
@@ -615,8 +613,6 @@ cont:
       free (input_names);
       free (list_option_full);
     }
-  else
-    fatal ("invalid LTO mode");
 
   obstack_free (&env_obstack, NULL);
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Avoid invalid LTO mode errors
  2010-12-05 13:30 Avoid invalid LTO mode errors Jan Hubicka
@ 2010-12-08 14:32 ` Diego Novillo
  0 siblings, 0 replies; 2+ messages in thread
From: Diego Novillo @ 2010-12-08 14:32 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: gcc-patches, rguenther

On Sun, Dec 5, 2010 at 08:30, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> compiling object produced with -flto with -fuse-linker-plugin only currently leads to
> invalid LTO mode fatal error. This is because linker claims the files, but no LTO mode
> is specified.
> While for fat objects (i.e. all we support at the moment) we probably should modify linker
> plugin to not claim anything (I will do that incrementally), we really want to default
> to WHOPR in lto-wraper: it is executed only when LTO is needed. This will be needed once we
> support slim files.
>
> Bootstrapped/regtested x86_64, linux, OK?
>
>        * lto-wrapper.c (run_gcc): Default to WHOPR mode when none is specified
>        at the command line.

OK.


Diego.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-08 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-05 13:30 Avoid invalid LTO mode errors Jan Hubicka
2010-12-08 14:32 ` Diego Novillo

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).