]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
kbuild: fix Clang LTO with CONFIG_OBJTOOL=n
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 31 Jan 2025 14:04:01 +0000 (23:04 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Feb 2025 09:02:18 +0000 (10:02 +0100)
commit3c51227c637fa96faa82f133e9560d19256c602f
treea2a4f9a4cb8d3b24a2b80a47d6153d7d1d95c295
parente94e4826721364a60691e4d4605138f4b2d06787
kbuild: fix Clang LTO with CONFIG_OBJTOOL=n

[ Upstream commit 695ed93bb30e03e9f826ee70abdd83f970741a37 ]

Since commit bede169618c6 ("kbuild: enable objtool for *.mod.o and
additional kernel objects"), Clang LTO builds do not perform any
optimizations when CONFIG_OBJTOOL is disabled (e.g., for ARCH=arm64).
This is because every LLVM bitcode file is immediately converted to
ELF format before the object files are linked together.

This commit fixes the breakage.

Fixes: bede169618c6 ("kbuild: enable objtool for *.mod.o and additional kernel objects")
Reported-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/Makefile.build
scripts/Makefile.lib