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]

Re: [lto][patch] Make collect2 aware of -plugin


2008/12/2 Rafael Espindola <espindola@google.com>:
> With this patch, passing -plugin to collect2 will disable any special
> handling of lto files, just pass them to the linker that will pass
> them to the plugin.

Pressed send too early.  The patch is now attached. The ChangeLog is:

2008-12-02  Rafael Avila de Espindola  <espindola@google.com>

	* collect2 (main): Set lto_mode to LTO_MODE_NONE if -plugin is given.

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 00bf889..5bbecb2 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -1142,15 +1142,21 @@ main (int argc, char **argv)
      necessary to do so at this early stage. */
   {
     int i;
+    int use_plugin = 0;
 
     for (i = 1; argv[i] != NULL; i ++)
       {
 	if (! strcmp (argv[i], "-debug"))
 	  debug = 1;
-        else if (! strcmp (argv[i], "-flto"))
+        else if (! strcmp (argv[i], "-flto") && ! use_plugin)
           lto_mode = LTO_MODE_LTO;
-        else if (! strcmp (argv[i], "-fwhopr"))
+        else if (! strcmp (argv[i], "-fwhopr") && ! use_plugin)
           lto_mode = LTO_MODE_WHOPR;
+        else if (! strcmp (argv[i], "-plugin"))
+	  {
+	    use_plugin = 1;
+	    lto_mode = LTO_MODE_NONE;
+	  }
       }
     vflag = debug;
   }

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