Skip to content

objtool: Add option to fail build on vmlinux warnings

Brendan Jackman linux-kbuild lkml 3 versions – In review

Get series with b4
b4 am [email protected] change-id 20241213-objtool-strict-cb9a0a75139e

Versions newest first

  1. v3 Latest2 patches 12 repliesIn review
  2. v22 patches 9 repliesSuperseded
  3. v12 patches 5 repliesSuperseded

Changes in v3 from the cover letter

- Added --verbose to objtool args (equivalent to OBJTOOL_VERBOSE=1, which Josh Poimboeuf suggested).
- Link to v2: https://lore.kernel.org/r/[email protected]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2objtool: Add --Werrortools/objtool/builtin-check.c tools/objtool/check.c tools/objtool/include/objtool/builtin.h+9 -52 replies
2/2kbuild: Add option to fail build on vmlinux objtool issueslib/Kconfig.debug scripts/Makefile.lib+11 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] objtool: Add option to fail build on vmlinux warnings

This adds an option to objtool to exit with an error when it enounters warnings.

Then, it adds a config to enable that flag. This enables you to fail the build e.g. when noinstr is violated.

When that happens, you also get a more verbose log, for example when failing noisntr validation it dumps disassembly of the offending code.

---
Changes in v3:
- Added --verbose to objtool args (equivalent to OBJTOOL_VERBOSE=1, which Josh Poimboeuf suggested).
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Renamed flag/config to -Werror/CONFIG_*_WERROR
- Applied to all objool runs instead of just vmlinux.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Brendan Jackman (2):
objtool: Add --Werror
kbuild: Add option to fail build on vmlinux objtool issues

 lib/Kconfig.debug                       | 10 ++++++++++
 scripts/Makefile.lib                    |  1 +
 tools/objtool/builtin-check.c           |  6 ++++++
 tools/objtool/check.c                   |  7 ++-----
 tools/objtool/include/objtool/builtin.h |  1 +
 5 files changed, 20 insertions(+), 5 deletions(-)

---
base-commit: 5bc55a333a2f7316b58edc7573e8e893f7acb532
change-id: 20241213-objtool-strict-cb9a0a75139e

Best regards,

Signature · 1 line
Brendan Jackman <[email protected]>