Re: linux-next: build failure after merge of the origin tree

From: Paul Mundt
Date: Mon Jun 04 2012 - 03:40:01 EST


On Mon, Jun 04, 2012 at 12:57:24PM +1000, Stephen Rothwell wrote:
> Hi Al,
>
> Building the origin tree (v3.5-rc1 sh lboxre2_defconfig and other sh
> configs) failed like this:
>
> arch/sh/include/asm/thread_info.h:172:2: error: 'TAINT_WARN' undeclared (first use in this function)
>
> Caused by commit edd63a2763bd ("set_restore_sigmask() is never called
> without SIGPENDING (and never should be)"). Missing include of kernel.h.
>
Ideally bug.h should be including linux/kernel.h itself due to its
TAINT_WARN dependence, it just seems to be getting lucky on other
platforms who either don't have this combination or pull in kernel.h from
somewhere else.

That commit also introduces a linux/bug.h include for WARN_ON() in
linux/thread_info.h which would be similarly insufficient for any
TIF_RESTORE_SIGMASK && !HAVE_SET_RESTORE_SIGMASK platform that also uses
asm-generic/bug.h.

Given that, I'd prefer stuffing the include in asm-generic directly:

---

bug.h: need linux/kernel.h for TAINT_WARN.

asm-generic/bug.h uses taint flags that are only defined in
linux/kernel.h, resulting in build failures on platforms that
don't include linux/kernel.h some other way:

arch/sh/include/asm/thread_info.h:172:2: error: 'TAINT_WARN' undeclared (first use in this function)

Caused by commit edd63a2763bd ("set_restore_sigmask() is never called
without SIGPENDING (and never should be)").

Reported-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Paul Mundt <lethal@xxxxxxxxxxxx>

---

diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 2520a6e..9f02005 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -2,6 +2,7 @@
#define _ASM_GENERIC_BUG_H

#include <linux/compiler.h>
+#include <linux/kernel.h>

#ifdef CONFIG_BUG

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/