This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lto][patch] Make collect2 aware of -plugin
- From: Rafael Espindola <espindola at google dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: Diego Novillo <dnovillo at google dot com>
- Date: Tue, 2 Dec 2008 11:41:55 +0000
- Subject: Re: [lto][patch] Make collect2 aware of -plugin
- References: <38a0d8450812020339t2901fe2aof5b9cd0f61441d75@mail.gmail.com>
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;
}