What is GCC lto wrapper?

Whe‬n You compile an executable, gcc will optimize and merge same constants only for the current file. Normally, it can’t analyse the whole program since the .o file are linked with ld.

‭‫That’s the purpose of Interprocedural optimization: Compile the whole executable as if it was a single source file, allowing to make the code more static.

There’s is a problem to this, LD can’t really recognize the exported GIMPLES.
‫‫For this purpose ld use the lto plugin(liblto_plugin.so.0.0.0) which call make or thelto-wrapper directly which call the lto1 where each lto1 lauch is responsible for producing a ‘partition’ (see the -flto-partition option and the lto-partitions parameter in gcc’s documentation)

原文地址:
https://stackoverflow.com/questions/19807107/what-is-gcc-lto-wrapper

你可能感兴趣的:(工具使用)