Re: [PATCH] objtool/klp: Build x86 test fixtures with -fcf-protection=none
From: Josh Poimboeuf
Date: Tue Dec 01 2026 - 17:34:42 EST
On Tue, Dec 01, 2026 at 05:17:38PM +0200, Seke Kazuru wrote:
> x86 kernels always choose -fcf-protection themselves: =branch with
> CONFIG_X86_KERNEL_IBT, =none without (arch/x86/Makefile). The test
> fixtures pass neither, so they get the compiler's default, and Ubuntu's
> gcc defaults to =full. That puts an ENDBR at the start of a global
> function but not of a static one, so a patch which only changes a
> function's linkage changes its code.
>
> test-local-to-global-flip makes exactly that change and fails with
> Ubuntu's gcc 11 to 14: flipped_up gains an ENDBR, klp diff rightly
> reports it as changed and clones it, and the test, which expects it to
> be correlated, fails.
>
> Build the fixtures for the kernel without IBT, as the kernel would. A
> test about IBT can still override it.
>
> Verified with Ubuntu gcc 11, 13 and 14, Debian gcc 16 and Clang 18 and
> 23: test-local-to-global-flip fails on the three Ubuntu compilers before
> this change and passes after it, and no other test changes on any of
> the six.
>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Seke Kazuru <kazuruuni@xxxxxxxxx>
Queued, thanks!
--
Josh