This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -flto with -fwhole-program or -fuse-linker-plugin
- From: Hei Chan <structurechart at yahoo dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Fri, 22 Mar 2013 16:26:37 -0700 (PDT)
- Subject: Re: -flto with -fwhole-program or -fuse-linker-plugin
- References: <1363753671 dot 72865 dot YahooMailNeo at web165005 dot mail dot bf1 dot yahoo dot com>
- Reply-to: Hei Chan <structurechart at yahoo dot com>
Sorry, one additional question:
If I want to compile and then link a library (not linking the library to any executable yet), do I need to specify -flto and -fuse-linker-plugin?
Thanks in advance.
________________________________
From: Hei Chan <structurechart@yahoo.com>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Sent: Tuesday, March 19, 2013 9:27 PM
Subject: -flto with -fwhole-program or -fuse-linker-plugin
Hi,
I am reading:
http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
It first suggests:
In combination with -flto using this option(-fwhole-program) should not be used. Instead relying on a linker plugin should provide **safer and more precise information.**
And then, it suggests:
If the program does not require any symbols to be exported, it is possible to combine -flto and -fwhole-program to allow the interprocedural optimizers to use more aggressive assumptions which may lead to improved optimization opportunities. Use of -fwhole-program is not needed when linker plugin is active (see -fuse-linker-plugin).
Does it mean that in theory, using -fuse-linker-plugin with -flto always gets a better optimized executable than using -fwhole-program with -flto?
Thanks in advance.
Cheers,
Hei