Skip to content

Commit

Permalink
kernel/configs: Disable LTO on kernel/configs.o
Browse files Browse the repository at this point in the history
This solves an incremental
build issue that, when a config changes, config_data
and config_data.gz is rebuilt, but because the
thinlto-cache cannot be updated, the config is not
reflected in the final vmlinux binary.

The issue is described in
ClangBuiltLinux#2021.

Signed-off-by: Yifan Hong <[email protected]>
  • Loading branch information
Yifan Hong authored and intel-lab-lkp committed Apr 30, 2024
1 parent 98369dc commit fc42137
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ obj-$(CONFIG_SCF_TORTURE_TEST) += scftorture.o

$(obj)/configs.o: $(obj)/config_data.gz

# Disable LTO on configs.o so changes in .config is reflected in vmlinux. See
# https://github.com/ClangBuiltLinux/linux/issues/2021
CFLAGS_REMOVE_configs.o += $(CC_FLAGS_LTO)

targets += config_data config_data.gz
$(obj)/config_data.gz: $(obj)/config_data FORCE
$(call if_changed,gzip)
Expand Down

0 comments on commit fc42137

Please sign in to comment.