|
|
Log in / Subscribe / Register

Fail the build on objtool warnings

From:  Josh Poimboeuf <jpoimboe-AT-kernel.org>
To:  x86-AT-kernel.org
Subject:  [PATCH 00/13] Fail the build on objtool warnings
Date:  Fri, 14 Mar 2025 12:28:58 -0700
Message-ID:  <cover.1741975349.git.jpoimboe@kernel.org>
Cc:  linux-kernel-AT-vger.kernel.org, Peter Zijlstra <peterz-AT-infradead.org>, Brendan Jackman <jackmanb-AT-google.com>, Nathan Chancellor <nathan-AT-kernel.org>
Archive-link:  Article

Add an option to fail the build on objtool warnings, and enable it by
default except for CONFIG_COMPILE_TEST.

This is long overdue, probably the only reason we didn't do it before
(other than lack of time) was because there are still some obscure
warnings out there, especially once KCOV and sanitizers get added to the
mix.

But those are mostly bot issues, the main concern for objtool warnings
is actual real live kernels.  Hopefully the !COMPILE_TEST guard will
avoid too much wreckage for now.


Josh Poimboeuf (13):
  x86/traps: Make exc_double_fault() consistently noreturn
  objtool: Fix error handling inconsistencies in check()
  objtool: Improve __noreturn annotation warning
  objtool: Update documentation
  objtool: Increase per-function WARN_FUNC() rate limit
  objtool: Remove --unret dependency on --rethunk
  objtool: Consolidate option validation
  objtool: Upgrade "Linked object detected" warning to error
  objtool: Add --output option
  objtool: Add --Werror option
  objtool: Change "warning:" to "error:" for --Werror
  objtool: Create backup on error and print args
  objtool: Add CONFIG_OBJTOOL_WERROR

 arch/x86/kernel/traps.c                 |  18 +-
 lib/Kconfig.debug                       |  12 ++
 scripts/Makefile.lib                    |   1 +
 tools/objtool/Documentation/objtool.txt | 105 ++++++------
 tools/objtool/builtin-check.c           | 212 ++++++++++++++++++------
 tools/objtool/check.c                   |  60 +++----
 tools/objtool/elf.c                     |   3 -
 tools/objtool/include/objtool/builtin.h |   3 +-
 tools/objtool/include/objtool/elf.h     |   2 +-
 tools/objtool/include/objtool/warn.h    |  20 ++-
 tools/objtool/objtool.c                 |  78 +--------
 tools/objtool/orc_dump.c                |   7 +-
 12 files changed, 290 insertions(+), 231 deletions(-)

-- 
2.48.1




Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds