This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: LTO for shared libs?
- From: David Brown <david at westcontrol dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 07 Feb 2012 15:35:06 +0100
- Subject: Re: LTO for shared libs?
- References: <jgr6ng$3vu$1@dough.gmane.org>
On 07/02/2012 13:50, Neal Becker wrote:
Can LTO be used to build shared libs?
Would it be useful?
I expect you can use LTO when building shared libs, just like building
anything else. It could well be useful, as the library typically will
have lots of internal functions that can be optimised with LTO.
Obviously functions exported from the shared lib will not be optimised
into the caller code, since that linking is done at link-load time. So
there is no point in having LTO information within the shared lib.
With static libraries, I believe you can have LTO information in the
libraries, and that will be used at link time for programs using the
static libraries.