linktimeoptimization

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linktimeoptimization [2018/04/07 21:42] – Initial list PaulWebsterlinktimeoptimization [2021/10/07 00:25] (current) – Link to build kernel instructions KubilayKocak
Line 1: Line 1:
-A project to build a fully working LTO(lite) %%FreeBSD%% Kernel+===== Introduction =====
  
-This is more a log page for progress!+Link-Time Optimization (LTO) is a compiler toolchain feature that enables additional program optimizations by deferring optimization passes to link time.
  
-Starting out: +===== Kernel ===== 
-* Build and attempt to link a kernel with: + 
-%%**%% WITHOUT_CTF=yes +[[https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-building|Build and link a kernel]] with: 
-%%**%% WITHOUT_DTRACE=yes + 
-%%**%% sys/conf/kern.mk -flto=thin (for all clang invocations) +  * WITHOUT_CTF=yes  
-%%**%% Try to get it running :)+  * WITHOUT_DTRACE=yes 
 +  * sys/conf/kern.mk -flto=thin (for all clang invocations)  
 + 
 +===== Ports ===== 
 + 
 +LTO is enabled on LLVM 3.7, but it needs the Gold binutils ld(1) plugin. 
 + 
 +To build with LTO, change your make.conf this way: 
 + 
 +<code> 
 +CC=/usr/local/bin/clang37 
 +CXX=/usr/local/bin/clang++37 
 +CPP=/usr/local/bin/clang-cpp37 
 +CFLAGS.clang+=-flto 
 + 
 +NM=/usr/local/bin/nm 
 +NMFLAGS+=--plugin /usr/local/llvm37/lib/LLVMgold.so 
 + 
 +LD=/usr/local/bin/ld.gold 
 +LDFLAGS+=-fuse-ld=gold -Wl,--plugin /usr/local/llvm37/lib/LLVMgold.so 
 + 
 +</code> 
 + 
 +---- 
 + 
 +{{tag>Stale Performance}}
  
  • linktimeoptimization.1523137328.txt.gz
  • Last modified: 2018/04/07 21:42
  • by PaulWebster