]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/entry/vdso32: Omit '.cfi_offset eflags' for LLVM < 16
authorNathan Chancellor <nathan@kernel.org>
Fri, 23 Jan 2026 23:20:28 +0000 (16:20 -0700)
committerIngo Molnar <mingo@kernel.org>
Sat, 24 Jan 2026 09:18:28 +0000 (10:18 +0100)
After commit:

  884961618ee5 ("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:

    https://github.com/llvm/llvm-project/commit/67bd3c58c0c7389e39c5a2f4d3b1a30459ccf5b7 [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: 884961618ee5 ("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
arch/x86/entry/vdso/vdso32/sigreturn.S

index 25b0ac4b4bfe244e38ed9c3ce3734046fcbecc4b..b433353bc8e39b0d784b5d4b4959d2886e62e85a 100644 (file)
        CFI_OFFSET      cs,     IA32_SIGCONTEXT_cs
        CFI_OFFSET      ss,     IA32_SIGCONTEXT_ss
        CFI_OFFSET      ds,     IA32_SIGCONTEXT_ds
+/*
+ * .cfi_offset eflags requires LLVM 16 or newer:
+ *
+ *   https://github.com/llvm/llvm-project/commit/67bd3c58c0c7389e39c5a2f4d3b1a30459ccf5b7
+ *
+ * Check for 16.0.1 to ensure the support is present, as 16.0.0 may be a
+ * prerelease version.
+ */
+#if defined(CONFIG_AS_IS_GNU) || (defined(CONFIG_AS_IS_LLVM) && CONFIG_AS_VERSION >= 160001)
        CFI_OFFSET      eflags, IA32_SIGCONTEXT_flags
+#endif
 .endm
 
        .text