Skip to content

Commit 3e30278

Browse files
nathanchanceingomolnar
authored andcommitted
x86/entry/vdso32: Omit '.cfi_offset eflags' for LLVM < 16
After commit: 8849616 ("x86/entry/vdso32: Remove open-coded DWARF in sigreturn.S") building arch/x86/entry/vdso/vdso32/sigreturn.S with LLVM 15 fails with: <instantiation>:18:20: error: invalid register name .cfi_offset eflags, 64 ^ arch/x86/entry/vdso/vdso32/sigreturn.S:33:2: note: while in macro instantiation STARTPROC_SIGNAL_FRAME 8 ^ Support for eflags as an argument to .cfi_offset was added in the LLVM 16 development cycle: llvm/llvm-project@67bd3c5 [1] Only add this .cfi_offset directive if it is supported by the assembler to clear up the error. [ mingo: Tidied up the changelog and the comment a bit ] Fixes: 8849616 ("x86/entry/vdso32: Remove open-coded DWARF in sigreturn.S") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: H. Peter Anvin (Intel) <hpa@zytor.com> Link: https://patch.msgid.link/20260123-x86-vdso32-wa-llvm-15-cfi-offset-eflags-v1-1-0f412e3516a4@kernel.org
1 parent 436ee60 commit 3e30278

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

arch/x86/entry/vdso/vdso32/sigreturn.S

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,17 @@
2222
CFI_OFFSET cs, IA32_SIGCONTEXT_cs
2323
CFI_OFFSET ss, IA32_SIGCONTEXT_ss
2424
CFI_OFFSET ds, IA32_SIGCONTEXT_ds
25+
/*
26+
* .cfi_offset eflags requires LLVM 16 or newer:
27+
*
28+
* https://github.com/llvm/llvm-project/commit/67bd3c58c0c7389e39c5a2f4d3b1a30459ccf5b7
29+
*
30+
* Check for 16.0.1 to ensure the support is present, as 16.0.0 may be a
31+
* prerelease version.
32+
*/
33+
#if defined(CONFIG_AS_IS_GNU) || (defined(CONFIG_AS_IS_LLVM) && CONFIG_AS_VERSION >= 160001)
2534
CFI_OFFSET eflags, IA32_SIGCONTEXT_flags
35+
#endif
2636
.endm
2737

2838
.text

0 commit comments

Comments
 (0)