From: Peter Zijlstra <peterz@infradead.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: objtool warning breaks build for fs/dlm/lock.o
Date: Fri, 8 May 2020 11:55:09 +0200 [thread overview]
Message-ID: <20200508095509.GX5298@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAK8P3a0pY+tu=3hvWTZVwD7nbA7UhaaCGWbBVba0eDuNcpt2Sg@mail.gmail.com>
On Fri, May 08, 2020 at 11:27:39AM +0200, Arnd Bergmann wrote:
> Right, makes sense. It would be nice though to have a way of intentionally
> turning all objtool warnings into errors. I do my randconfig tests
> with '-Werror'
> at the moment in order to catch all new warnings, but this does not catch
> objtool errors at the moment. For now, this is probably the right thing to do,
> as there are a couple of warnings that I have no patches for, but at some point
> I would prefer to trap immediately when a new warning pops up.
Completely untested, and I'm 100% unsure of the Makefile change, but
something like so, then?
---
scripts/Makefile.build | 2 ++
tools/objtool/builtin-check.c | 3 ++-
tools/objtool/builtin.h | 2 +-
tools/objtool/check.c | 8 +-------
4 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 9fcbfac15d1d..c656f114ce30 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -201,6 +201,8 @@ objtool_args = $(if $(CONFIG_UNWINDER_ORC),orc generate,check)
objtool_args += $(if $(part-of-module), --module,)
+objtool_args += $(if $(findstring $(KBUILD_CFLAGS), "-Werror "), --error,)
+
ifndef CONFIG_FRAME_POINTER
objtool_args += --no-fp
endif
diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
index be42b716166b..3d10ae8b0b25 100644
--- a/tools/objtool/builtin-check.c
+++ b/tools/objtool/builtin-check.c
@@ -18,7 +18,7 @@
#include "builtin.h"
#include "check.h"
-bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats, validate_dup, vmlinux;
+bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats, validate_dup, vmlinux, error;
static const char * const check_usage[] = {
"objtool check [<options>] file.o",
@@ -35,6 +35,7 @@ const struct option check_options[] = {
OPT_BOOLEAN('s', "stats", &stats, "print statistics"),
OPT_BOOLEAN('d', "duplicate", &validate_dup, "duplicate validation for vmlinux.o"),
OPT_BOOLEAN('l', "vmlinux", &vmlinux, "vmlinux.o validation"),
+ OPT_BOOLEAN('e', "error", &error, "Return error on warnings"),
OPT_END(),
};
diff --git a/tools/objtool/builtin.h b/tools/objtool/builtin.h
index 85c979caa367..90c43c6c1e35 100644
--- a/tools/objtool/builtin.h
+++ b/tools/objtool/builtin.h
@@ -8,7 +8,7 @@
#include <subcmd/parse-options.h>
extern const struct option check_options[];
-extern bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats, validate_dup, vmlinux;
+extern bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats, validate_dup, vmlinux, error;
extern int cmd_check(int argc, const char **argv);
extern int cmd_orc(int argc, const char **argv);
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 831ffa9e68c4..eed24c584d71 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2793,14 +2793,8 @@ int check(const char *_objname, bool orc)
}
out:
- if (ret < 0) {
- /*
- * Fatal error. The binary is corrupt or otherwise broken in
- * some way, or objtool itself is broken. Fail the kernel
- * build.
- */
+ if (error && ret < 0)
return ret;
- }
return 0;
}
next prev parent reply other threads:[~2020-05-08 9:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 14:07 Arnd Bergmann
2020-05-07 23:29 ` Josh Poimboeuf
2020-05-08 9:27 ` Arnd Bergmann
2020-05-08 9:55 ` Peter Zijlstra [this message]
2020-05-08 16:17 ` Josh Poimboeuf
2020-05-08 16:26 ` Peter Zijlstra
2020-05-08 16:29 ` Josh Poimboeuf
2020-05-08 9:45 ` Peter Zijlstra
2020-05-08 16:20 ` Josh Poimboeuf
2020-05-18 19:57 ` Arnd Bergmann
2020-05-18 22:53 ` Josh Poimboeuf
2020-05-18 23:04 ` Josh Poimboeuf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200508095509.GX5298@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=arnd@arndb.de \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®