Locietta / xanmod-kernel-WSL2

Xanmod kernel for WSL2, built by clang with ThinLTO enabled. Build & Release are automated by Github Action.
GNU General Public License v2.0
83 stars 17 forks source link

[Need Investigation] LTO is gone in 5.19? #18

Closed Locietta closed 2 years ago

Locietta commented 2 years ago

Just found that LTO disappears in the build log since 5.19

But still not sure if it's just change in log print, or LTO is indeed not enabled in build.

5.19

...
GEN     .version
CHK     include/generated/compile.h
GEN     .tmp_initcalls.lds
LD      vmlinux.o
MODPOST vmlinux.symvers
MODINFO modules.builtin.modinfo
GEN     modules.builtin
CC      .vmlinux.export.o
LD      .tmp_vmlinux.kallsyms1
KSYMS   .tmp_vmlinux.kallsyms1.S
AS      .tmp_vmlinux.kallsyms1.S
LD      .tmp_vmlinux.kallsyms2
KSYMS   .tmp_vmlinux.kallsyms2.S
AS      .tmp_vmlinux.kallsyms2.S
LD      vmlinux
...

5.18

...
GEN     .version
CHK     include/generated/compile.h
GEN     .tmp_initcalls.lds
GEN     .tmp_symversions.lds
LTO     vmlinux.o
OBJTOOL vmlinux.o
MODPOST vmlinux.symvers
MODINFO modules.builtin.modinfo
GEN     modules.builtin
LD      .tmp_vmlinux.kallsyms1
KSYMS   .tmp_vmlinux.kallsyms1.S
AS      .tmp_vmlinux.kallsyms1.S
LD      .tmp_vmlinux.kallsyms2
KSYMS   .tmp_vmlinux.kallsyms2.S
AS      .tmp_vmlinux.kallsyms2.S
LD      vmlinux
...
Locietta commented 2 years ago

Found related patch: https://lore.kernel.org/linux-kbuild/20220528224745.GA2501857@roeck-us.net/T/

It's a KBuild update to simplify the build process. Previously it will generate a LLVM IR archive from multiple LLVM IR files and then link it into ELF archive (the LTO & OBJTOOL steps in 5.18). Now in 5.19, however, it directly link LLVM IRs into ELF archive, so the "LTO" disappear in the log.

Conclusion: No actual change for the build result, LTO is still on. The log change is quite misleading though😕