Re: [PATCH v5 0/8] unwind, arm64: add sframe unwinder for kernel

Brian Norris <[email protected]> Mon, 13 Jul 2026 17:28:40 -0700
Newsgroups org.kernel.vger.linux-toolchains,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.live-patching
Message-ID <[email protected]>
Hi Jens,

On Tue, May 19, 2026 at 01:05:23PM +0200, Jens Remus wrote:
> Hi Dylan and Mostafa!

I also work at the same company as Dylan and Mostafa, and am therefore
probably using the same company-maintained Linux distribution.

> On 5/18/2026 7:55 PM, Dylan Hatch wrote:
> > On Fri, May 15, 2026 at 4:32=E2=80=AFAM Mostafa Saleh <smostafa@google.=
com> wrote:
> >> Not sure if related, but after updating my toolchain
> >> (aarch64-linux-gnu-gcc (Debian 15.2.0-4) 15.2.0), I hit link errors:
> >> ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.sframe) is bei=
ng placed in '.sframe'
> >> ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.sframe) is being =
placed in '.sframe`

I've also been hitting this for some time, and I'd like to see if I can
figure out what's going wrong. My current workaround is:

--- a/Makefile
+++ b/Makefile
@@ -946,6 +946,8 @@ ifdef CONFIG_CC_IS_GCC
 KBUILD_CFLAGS	+=3D $(call cc-option,--param=3Dallow-store-data-races=3D0)
 KBUILD_CFLAGS	+=3D $(call cc-option,-fno-allow-store-data-races)
 endif
+# No sframe generation for kernel if enabled by default
+KBUILD_CFLAGS	+=3D $(call cc-option,-Xassembler --gsframe=3Dno)
=20
 ifdef CONFIG_READABLE_ASM
 # Disable optimizations that make assembler listings hard to read.

> > Previously when developing against the SFrame V2 format, I had fixed
> > these warnings with the VDSO Makefile change currently in this series:
> >=20
> > diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/M=
akefile
> > index 7dec05dd33b7..c60ef921956f 100644
> > --- a/arch/arm64/kernel/vdso/Makefile
> > +++ b/arch/arm64/kernel/vdso/Makefile
> > @@ -38,7 +38,7 @@ ccflags-y +=3D -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
> >  CC_FLAGS_REMOVE_VDSO :=3D $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) \
> >                         $(RANDSTRUCT_CFLAGS) $(KSTACK_ERASE_CFLAGS) \
> >                         $(GCC_PLUGINS_CFLAGS) \
> > -                       $(CC_FLAGS_LTO) $(CC_FLAGS_CFI) \
> > +                       $(CC_FLAGS_LTO) $(CC_FLAGS_CFI) $(CC_FLAGS_SFRA=
ME) \
> >                         -Wmissing-prototypes -Wmissing-declarations
> >=20
> >  CC_FLAGS_ADD_VDSO :=3D -O2 -mcmodel=3Dtiny -fasynchronous-unwind-tables
> >=20
> > But the warnings seem to have returned after upgrading my toolchain,
> > possibly due to SFrame V3 or some confounding change in GCC. The
> > --gsframe in the assembler should be set to 'no' by default, so
> > perhaps GCC is providing an override --gsframe internally?
>=20
> Could it be that your build of binutils was configured with
> --enable-default-sframe, so that the GNU assembler defaults to generate
> .sframe?  AFAIK this configure option was meant for distributors and
> package maintainers.
>=20
> You can check as follows whether --gsframe defaults to "no" or "yes":
>=20
> $ as --help | grep -A1 gsframe
>   --gsframe[=3D{no|yes}]    whether to generate SFrame stack trace inform=
ation
>                           (default: no)
> ...

$ aarch64-linux-gnu-as --help | grep -A1 gsframe
  --gsframe[=3D{no|yes}]    whether to generate SFrame stack trace informat=
ion
                          (default: no)
--
  --gsframe-<N>           generate SFrame version <N> information. 3 =3D=3D=
 <N>
  --scfi=3Dexperimental     Synthesize DWARF CFI for hand-written asm

> Maybe build the VDSO separately with V=3D1 to see what assembler/compiler
> options are effectively used (e.g. for vgettimeofday.o and vgetrandom.o
> mentioned in the linker error message above)?

A slightly tweaked version of my vgetrandom.o build line:

# CC      arch/arm64/kernel/vdso/vgetrandom.o
  aarch64-linux-gnu-gcc -Wp,-MMD,arch/arm64/kernel/vdso/.vgetrandom.o.d -no=
stdinc -I./arch/arm64/include -I./arch/arm64/include/generated -I./include =
-I./include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/ua=
pi -I./include/uapi -I./include/generated/uapi -include ./include/linux/com=
piler-version.h -include ./include/linux/kconfig.h -include ./include/linux=
/compiler_types.h -D__KERNEL__ -mlittle-endian -DCC_USING_PATCHABLE_FUNCTIO=
N_ENTRY -DKASAN_SHADOW_SCALE_SHIFT=3D -Werror -fshort-wchar -funsigned-char=
 -fno-common -fno-PIE -fno-strict-aliasing -std=3Dgnu11 -fms-extensions -mg=
eneral-regs-only -DCONFIG_CC_HAS_K_CONSTRAINT=3D1 -Wno-psabi -mabi=3Dlp64 -=
fno-asynchronous-unwind-tables -fno-unwind-tables -mbranch-protection=3Dpac=
-ret -Wa,-march=3Darmv8.5-a -DARM64_ASM_ARCH=3D'"armv8.5-a"' -DKASAN_SHADOW=
_SCALE_SHIFT=3D -fno-delete-null-pointer-checks -O2 -fno-allow-store-data-r=
aces -fstack-protector-strong -fno-omit-frame-pointer -fno-optimize-sibling=
-calls -ftrivial-auto-var-init=3Dzero -fzero-init-padding-bits=3Dall -fno-s=
tack-clash-protection -fno-inline-functions-called-once -fmin-function-alig=
nment=3D8 -fstrict-flex-arrays=3D3 -fno-strict-overflow -fno-stack-check -f=
conserve-stack -fno-builtin-wcslen -Wall -Wextra -Wundef -Werror=3Dimplicit=
-function-declaration -Werror=3Dimplicit-int -Werror=3Dreturn-type -Werror=
=3Dstrict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address=
 -Wno-address-of-packed-member -Wframe-larger-than=3D2048 -Wno-main -Wno-ty=
pe-limits -Wno-dangling-pointer -Wvla-larger-than=3D1 -Wno-pointer-sign -Wc=
ast-function-type -Wno-unterminated-string-initialization -Wno-array-bounds=
 -Wno-stringop-overflow -Wno-alloc-size-larger-than -Wimplicit-fallthrough=
=3D5 -Werror=3Ddate-time -Werror=3Dincompatible-pointer-types -Werror=3Ddes=
ignated-init -Wenum-conversion -Wunused -Wno-unused-but-set-variable -Wno-u=
nused-const-variable -Wno-packed-not-aligned -Wno-format-overflow -Wno-form=
at-truncation -Wno-stringop-truncation -Wno-override-init -Wno-missing-fiel=
d-initializers -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign=
-compare -Wno-unused-parameter -g -mstack-protector-guard=3Dsysreg -mstack-=
protector-guard-reg=3Dsp_el0 -mstack-protector-guard-offset=3D1344 -fno-com=
mon -fno-builtin -fno-stack-protector -ffixed-x18 -DDISABLE_BRANCH_PROFILIN=
G -DBUILD_VDSO -O2 -mcmodel=3Dtiny -fasynchronous-unwind-tables -include ./=
lib/vdso/getrandom.c   -I./arch/arm64/kernel/vdso -Iarch/arm64/kernel/vdso =
   -DKBUILD_MODFILE=3D'"arch/arm64/kernel/vdso/vgetrandom"' -DKBUILD_BASENA=
ME=3D'"vgetrandom"' -DKBUILD_MODNAME=3D'"vgetrandom"' -D__KBUILD_MODNAME=3D=
vgetrandom -c -o arch/arm64/kernel/vdso/vgetrandom.o ./arch/arm64/kernel/vd=
so/vgetrandom.c

I mostly don't know what I'm looking for w.r.t. gsframe features, but
I'm willing to poke at my compiler/assembler/build-process.

Brian