Why doesn't kernel use flto=thin to accelerate link speed?

Skip to first unread message

Hici Lo

Feb 22, 2022, 9:15:09 PMFeb 22
to Android Building
Hi all,

It takes 15mins+ to link vmlinux.o with 'CONFIG_LTO_CLANG_FULL=y' ('-flto'),
while only takes less than 2mins to link vmlinux.o with 'CONFIG_LTO_CLANG_THIN=y' ('-flto=thin)'.

I compared the code size of ThinLTO and FullLTO(tested with Android ACK kernel).
vmlinux.o with FullLTO ~= 1.2GB
vmlinux.o with ThinLTO ~=1.1GB

The ThinLTO paper(https://research.google/pubs/pub47584/) says the runtime performance of FullLTO and ThinLTO are almost the same, based on applications.

Summarize the above, ThinLTO has smaller code size, matching performance with FullLTO. 

Why doesn't ACK kernel use '-flto=thin'? 
Reply all
Reply to author
0 new messages