From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kbuild@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Matthias Klose <doko@debian.org>,
Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nicolas.schier@linux.dev>
Subject: [RFC] Don't create sframes during build
Date: Thu, 4 Sep 2025 15:18:35 +0200 [thread overview]
Message-ID: <20250904131835.sfcG19NV@linutronix.de> (raw)
Hi,
gcc in Debian, starting with 15.2.0-2, 14.3.0-6 enables sframe
generation. Unless options like -ffreestanding are passed. Since this
isn't done, there are a few warnings during compile
| crypto/chacha.o: warning: objtool: .sframe+0x30: data relocation to !ENDBR: chacha_stream_xor+0x0
| crypto/chacha.o: warning: objtool: .sframe+0x94: data relocation to !ENDBR: crypto_xchacha_crypt+0x0
followed by warnings at the end
| AR vmlinux.a
| LD vmlinux.o
| vmlinux.o: warning: objtool: .sframe+0x15c: data relocation to !ENDBR: repair_env_string+0x0
| vmlinux.o: warning: objtool: .sframe+0x1c0: data relocation to !ENDBR: run_init_process+0x0
| vmlinux.o: warning: objtool: .sframe+0x1d4: data relocation to !ENDBR: try_to_run_init_process+0x0
| vmlinux.o: warning: objtool: .sframe+0x1e8: data relocation to !ENDBR: rcu_read_unlock+0x0
…
| vmlinux.o: warning: objtool: .sframe+0x12765c: data relocation to !ENDBR: get_eff_addr_reg+0x0
| vmlinux.o: warning: objtool: .sframe+0x1276ac: data relocation to !ENDBR: get_seg_base_limit+0x0
| OBJCOPY modules.builtin.modinfo
followed by a boom
| LD .tmp_vmlinux1
| ld: error: unplaced orphan section `.sframe' from `vmlinux.o'
We could drop the sframe during the final link but this does not get rid
of the objtool warnings so we would have to ignore them. But we don't
need it. So what about the following:
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -886,6 +886,8 @@ ifdef CONFIG_CC_IS_GCC
KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
endif
+# No sframe generation for kernel if enabled by default
+KBUILD_CFLAGS += $(call cc-option,-Xassembler --gsframe=no)
ifdef CONFIG_READABLE_ASM
# Disable optimizations that make assembler listings hard to read.
--
2.51.0
next reply other threads:[~2025-09-04 13:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 13:18 Sebastian Andrzej Siewior [this message]
2025-09-04 14:02 ` [RFC] Don't create sframes during build Matthias Klose
2025-09-04 16:26 ` Matthias Klose
2025-09-04 16:34 ` Sebastian Andrzej Siewior
2025-09-04 17:14 ` Josh Poimboeuf
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=20250904131835.sfcG19NV@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=arnd@arndb.de \
--cc=doko@debian.org \
--cc=jpoimboe@kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nicolas.schier@linux.dev \
--cc=peterz@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;
as well as URLs for NNTP newsgroup(s).