linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [tip: objtool/core] objtool: Allow nested externs to enable BUILD_BUG()
@ 2020-10-07 16:20 tip-bot2 for Vasily Gorbik
  0 siblings, 0 replies; only message in thread
From: tip-bot2 for Vasily Gorbik @ 2020-10-07 16:20 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Vasily Gorbik, Josh Poimboeuf, x86, LKML

The following commit has been merged into the objtool/core branch of tip:

Commit-ID:     2486baae2cf6df73554144d0a4e40ae8809b54d4
Gitweb:        https://git.kernel.org/tip/2486baae2cf6df73554144d0a4e40ae8809b54d4
Author:        Vasily Gorbik <gor@linux.ibm.com>
AuthorDate:    Mon, 05 Oct 2020 17:50:28 +02:00
Committer:     Josh Poimboeuf <jpoimboe@redhat.com>
CommitterDate: Tue, 06 Oct 2020 09:32:13 -05:00

objtool: Allow nested externs to enable BUILD_BUG()

Currently BUILD_BUG() macro is expanded to smth like the following:
   do {
           extern void __compiletime_assert_0(void)
                   __attribute__((error("BUILD_BUG failed")));
           if (!(!(1)))
                   __compiletime_assert_0();
   } while (0);

If used in a function body this obviously would produce build errors
with -Wnested-externs and -Werror.

Build objtool with -Wno-nested-externs to enable BUILD_BUG() usage.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 tools/objtool/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 33d1e3c..4ea9a83 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -37,7 +37,7 @@ INCLUDES := -I$(srctree)/tools/include \
 	    -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \
 	    -I$(srctree)/tools/arch/$(SRCARCH)/include	\
 	    -I$(srctree)/tools/objtool/arch/$(SRCARCH)/include
-WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed
+WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed -Wno-nested-externs
 CFLAGS   := -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBELF_FLAGS)
 LDFLAGS  += $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-07 16:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07 16:20 [tip: objtool/core] objtool: Allow nested externs to enable BUILD_BUG() tip-bot2 for Vasily Gorbik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).