Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Indu <indu.bhagat@oracle.com>
To: Sven Joachim <svenjoac@gmx.de>, Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Matthias Klose <doko@debian.org>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kbuild@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nicolas.schier@linux.dev>,
	Binutils <binutils@sourceware.org>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [RFC] Don't create sframes during build
Date: Sat, 24 Jan 2026 11:08:59 -0800	[thread overview]
Message-ID: <4f62add4-85af-46c2-ac33-d68368c5bdb6@oracle.com> (raw)
In-Reply-To: <87343vdxnb.fsf@turtle.gmx.de>

On 2026-01-24 4:04 a.m., Sven Joachim wrote:
> On 2025-09-04 10:14 -0700, Josh Poimboeuf wrote:
> 
>> On Thu, Sep 04, 2025 at 06:34:04PM +0200, Sebastian Andrzej Siewior wrote:
>>> On 2025-09-04 16:02:42 [+0200], Matthias Klose wrote:
>>>> [ CCing binutils@sourceware.org ]
>>>>
>>>> On 9/4/25 15:18, Sebastian Andrzej Siewior wrote:
>>>>> 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
>>>>
>>>> If there are other options when sframe shouldn't be enabled, please tell.
>>>
>>> No, I think this is okay.
>>>
>>> …
>>>>> 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.
>>>> This is what I chose for package builds that need disablement of sframe.
>>>
>>> I think this would work for now. Longterm we would have to allow sframe
>>> creation and keep section if an architecture decides to use it for its
>>> backtracing. While orc seems fine on x86, there are arm64 patches to use
>>> for as a stack unwinder.
>>
>> This is probably fine, but... how does this interact with other kernel
>> makefiles enabling sframe?  For example, x86 will soon have a patch to
>> enable sframe generation for vdso.  And as you mentioned, arm64 will
>> enable it kernel-wide.
>>
>> Removing the objtool !ENDBR warnings would be trivial (and is a good
>> thing to do regardless).
> 
> What is the status of sframe support in the kernel?  With current
> binutils (version 2.45.50.20260119-1) from Debian I could not build
> Linux 6.18.7:
> 
> ,----
> | # LD      arch/x86/boot/compressed/vmlinux
> |   ld -m elf_x86_64 --no-ld-generated-unwind-info  -pie  --no-dynamic-linker --orphan-handling=error -z noexecstack --no-warn-rwx-segments -T arch/x86/boot/compressed/vmlinux.lds arch/x86/boot/compressed/kernel_info.o arch/x86/boot/compressed/head_64.o arch/x86/boot/compressed/misc.o arch/x86/boot/compressed/string.o arch/x86/boot/compressed/cmdline.o arch/x86/boot/compressed/error.o arch/x86/boot/compressed/piggy.o arch/x86/boot/compressed/cpuflags.o arch/x86/boot/compressed/early_serial_console.o arch/x86/boot/compressed/kaslr.o arch/x86/boot/compressed/ident_map_64.o arch/x86/boot/compressed/idt_64.o arch/x86/boot/compressed/idt_handlers_64.o arch/x86/boot/compressed/pgtable_64.o arch/x86/boot/compressed/acpi.o arch/x86/boot/startup/lib.a -o arch/x86/boot/compressed/vmlinux
> | /usr/bin/x86_64-linux-gnu-ld.bfd: error: unplaced orphan section `.sframe' from `arch/x86/boot/compressed/kernel_info.o'
> | /usr/bin/x86_64-linux-gnu-ld.bfd: error: unplaced orphan section `.sframe' from `arch/x86/boot/compressed/kernel_info.o'
> | make[6]: *** [arch/x86/boot/compressed/Makefile:116: arch/x86/boot/compressed/vmlinux] Error 1
> | make[5]: *** [arch/x86/boot/Makefile:96: arch/x86/boot/compressed/vmlinux] Error 2
> `----
> 

Sorry for the breakage.

There is a patch that needs to make it upstream
https://sourceware.org/pipermail/binutils/2026-January/147664.html
(Its a part of a series under review..)

I will work on getting this patch committed.

For immediate relief, please use the new ld option --discard-sframe 
meanwhile.

> Did not test mainline yet, but "git log --grep=sframe master" does not
> show anything interesting.
> 
> Cheers,
>         Sven



  reply	other threads:[~2026-01-24 19:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 13:18 [RFC] Don't create sframes during build Sebastian Andrzej Siewior
2025-09-04 14:02 ` Matthias Klose
2025-09-04 16:26   ` Matthias Klose
2025-09-04 16:34   ` Sebastian Andrzej Siewior
2025-09-04 17:14     ` Josh Poimboeuf
2026-01-24 12:04       ` Sven Joachim
2026-01-24 19:08         ` Indu [this message]
2026-01-27 18:22           ` Indu Bhagat
2026-01-29  9:13   ` Jens Remus
2026-01-29 22:23     ` Nathan Chancellor
2026-01-30  0:58       ` Indu Bhagat

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=4f62add4-85af-46c2-ac33-d68368c5bdb6@oracle.com \
    --to=indu.bhagat@oracle.com \
    --cc=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=binutils@sourceware.org \
    --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 \
    --cc=rostedt@goodmis.org \
    --cc=svenjoac@gmx.de \
    /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