mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH] kbuild: drop duplicate CONFIG_LD_DEAD_CODE_DATA_ELIMINATION block
Date: Mon, 24 Aug 2026 09:28:21 +0200	[thread overview]
Message-ID: <20260824072941.3266864-1-a.fatoum@pengutronix.de> (raw)

From: Ahmad Fatoum <a.fatoum@barebox.org>

Commit 48d0d0cc28ed ("kbuild: sync with Linux v6.17") carried over an
upstream hunk that sets up section garbage collection a second time,
so we have the hunk being deleted here in addition to:

  ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
  KBUILD_CPPFLAGS += -fdata-sections -ffunction-sections
  LDFLAGS_barebox += --gc-sections
  LDFLAGS_pbl += --gc-sections
  endif

The upstream hunk is incorrect and incomplete: We have no vmlinux and
KBUILD_CFLAGS_KERNEL doesn't apply to the PBL, unlike KBUILD_CPPFLAGS,
therefore delete the duplicate.

Fixes: 48d0d0cc28ed ("kbuild: sync with Linux v6.17")
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 Makefile | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/Makefile b/Makefile
index 1a10628f101f..69484534bc6c 100644
--- a/Makefile
+++ b/Makefile
@@ -881,11 +881,6 @@ ifdef CONFIG_ZERO_CALL_USED_REGS
 KBUILD_CFLAGS	+= -fzero-call-used-regs=used-gpr
 endif
 
-ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
-KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
-LDFLAGS_vmlinux += --gc-sections
-endif
-
 # arch Makefile may override CC so keep this after arch Makefile is included
 NOSTDINC_FLAGS += -nostdinc
 
-- 
2.47.3




             reply	other threads:[~2026-08-24  7:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24  7:28 Ahmad Fatoum [this message]
2026-08-24 12:14 ` Sascha Hauer

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=20260824072941.3266864-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=a.fatoum@barebox.org \
    --cc=barebox@lists.infradead.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