Rebuilding world + installed packages with LTO

Hello,
Recently I've tried to build my FreeBSD with LTO enabled by adding -flto (and tried -flto=thin also) to CFLAGS/COPTFLAGS in /etc/make.conf.
I've made lld my default linker by rebuilding world with
Code:
WITH_LLD_IS_LD=YES
WITH_LLD_BOOTSTRAP=YES
in /etc/src.conf but when I try to build something with -flto, ports or world crash with errors every time.
Can someone help me enable LTO the proper way?
Regards.
 
Back
Top