linux 7.0.4 + clang 22.1.5 with thin or full lto still fails with objtool error

From: Klaus Kusche

Date: Thu May 07 2026 - 15:34:37 EST



The error I reported for linux 7.0.3 and clang 22.1.4 (see below)
still occurs with 7.0.4 and 22.1.5:
Compiling the kernel fails in the "LD vmlinux.o" step with
"vmlinux.o: error: objtool: bad .discard.annotate_insn entry:
599 of type 8"

This time, I reproduced it with the vanilla kernel,
not the gentoo kernel, so there is no gentoo involved in the build.

It happens with both full LTO and thin LTO, only no LTO works.

My kernel config reproducing the error with vanilla 7.0.4 is in
https://bugzilla.kernel.org/show_bug.cgi?id=221460

--
Klaus Kusche

-------- Forwarded Message --------
Subject: 7.0.3 with clang 22.1.4 and full lto: objtool error
Date: Mon, 4 May 2026 20:46:50 +0200
From: Klaus Kusche <klaus.kusche@xxxxxxxxxxxxxxx>
To: linux-kernel@xxxxxxxxxxxxxxx, Josh Poimboeuf <jpoimboe@xxxxxxxxxx>, peterz@xxxxxxxxxxxxx, Nathan Chancellor <nathan@xxxxxxxxxx>

Hello,

with clang 22.1.4, I get an error in the "LD vmlinux.o" step
(full lto):
"objtool: bad .discard.annotate_insn entry: 609 of type 8"

Same kernel & same config compiles and runs nicely with clang 21.1.8.

I've attached the kernel config to
https://bugzilla.kernel.org/show_bug.cgi?id=221460