Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| linktimeoptimization [2021/10/06 23:54] – Add CategoryStale KubilayKocak | linktimeoptimization [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)((Link Time Optimization)) %%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. |
| + | |||
| + | ===== Kernel ===== | ||
| + | |||
| + | [[https:// | ||
| - | Starting out: | ||
| - | Build and attempt to link a kernel with: | ||
| * WITHOUT_CTF=yes | * WITHOUT_CTF=yes | ||
| * WITHOUT_DTRACE=yes | * WITHOUT_DTRACE=yes | ||
| * sys/ | * sys/ | ||
| - | * Try to get it running :) | + | |
| + | ===== 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: | ||
| + | |||
| + | < | ||
| + | CC=/ | ||
| + | CXX=/ | ||
| + | CPP=/ | ||
| + | CFLAGS.clang+=-flto | ||
| + | |||
| + | NM=/ | ||
| + | NMFLAGS+=--plugin / | ||
| + | |||
| + | LD=/ | ||
| + | LDFLAGS+=-fuse-ld=gold -Wl, | ||
| + | |||
| + | </ | ||
| ---- | ---- | ||
| - | {{tag> | + | {{tag> |