public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yifan Hong <elsk@google.com>
To: Yifan Hong <elsk@google.com>
Cc: kernel-team@android.com, linux-kernel@vger.kernel.org
Subject: [PATCH] kernel/configs: Disable LTO on kernel/configs.o
Date: Mon, 29 Apr 2024 22:07:56 +0000	[thread overview]
Message-ID: <20240429220756.979347-2-elsk@google.com> (raw)

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
https://github.com/ClangBuiltLinux/linux/issues/2021.

Signed-off-by: Yifan Hong <elsk@google.com>
---
 kernel/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/Makefile b/kernel/Makefile
index 10ef068f598d..76d9acc49c5f 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -140,6 +140,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)
-- 
2.45.0.rc1.225.g2a3ae87e7f-goog


                 reply	other threads:[~2024-04-29 22:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240429220756.979347-2-elsk@google.com \
    --to=elsk@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox