flto automake

James Feist james.feist at linux.intel.com
Wed Dec 19 05:08:44 AEDT 2018


If you aren't planning on enabling flto in a repo you can ignore this email.


I've created a new class flto-automake 
https://github.com/openbmc/meta-phosphor/blob/master/classes/flto-automake.bbclass 
if you are enabling -flto in an autotools project you might be 
interested in. When using static libraries you may run into undefined 
references when building with Yocto. Yocto by default uses:

export AR = "${HOST_PREFIX}ar"
export RANLIB = "${HOST_PREFIX}ranlib"

for AR and RANLIB. This new class replaces these with the gcc equivalent 
wrappers that can work with the flto object files. This doesn't seem to 
be an issue for the CI build, it only shows up for Yocto builds. 
Reference: 
http://stackoverflow.com/questions/25878407/how-can-i-use-lto-with-static-libraries#comment67660913_25878408

For Cmake I suggest looking at the way bmcweb handles it in CMakesLists:
https://github.com/openbmc/bmcweb/blob/master/CMakeLists.txt#L92

Thanks,

James



More information about the openbmc mailing list