Repository navigation
Commit 2987c36
committed
build: add opt-in link-time optimization for release builds
Add a BUILD_LTO option that enables CMake's interprocedural optimization for
the Release and MinSizeRel configurations only, leaving Debug and
RelWithDebInfo (and every default/OpenWrt build) unchanged. IPO performs
cross translation-unit dead code elimination and folds identical functions,
trimming a further ~2.4% from libucode (172 KB -> 168 KB stripped on top of
the unwind-tables change).
Off by default because it lengthens builds and assumes a matching LTO
toolchain. Guarded by check_ipo_supported() with a warning if unavailable.1 parent b706d7a commit 2987c36
1 file changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
67 | 85 | | |
68 | 86 | | |
69 | 87 | | |
| |||
0 commit comments