LTO support for static libraries

xunxun xunxun1982@gmail.com
Fri Dec 16 20:36:00 GMT 2011


于 2011/12/17 2:15, Paul Dovydaitis 写道:
> I’m trying out the LTO feature on some of my existing code and it’s
> unclear from the documentation how this will interact with linking
> against static libraries also built with LTO.
>
> Our build process currently is basically 1) build various internal
> libraries and package them with ar 2) build the application and link
> against libraries from (1).  If everything is built with LTO will it
> attempt to optimize it all?  I know that the IR is embedded in the
> object files, so it should be available through the archive, but it's
> unclear if it will actually be pulled out.
You can add "-flto -fuse-linker-plugin" to your linker option, then 
linker can use the LTO information.

-- 
Best Regards,
xunxun



More information about the Gcc-help mailing list