public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] linux/init.h: include <linux/build_bug.h> and <linux/stringify.h>
@ 2022-11-13 11:08 Masahiro Yamada
  0 siblings, 0 replies; only message in thread
From: Masahiro Yamada @ 2022-11-13 11:08 UTC (permalink / raw)
  To: linux-kernel, linux-kbuild
  Cc: Masahiro Yamada, Andrew Morton, Jiangshan Yi, Kees Cook,
	Peter Zijlstra (Intel), Randy Dunlap, Sami Tolvanen

With CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y, the following code
fails to build:

  ---------------->8----------------
  #include <linux/init.h>

  int foo(void) { return 0; }
  core_initcall(foo);
  ---------------->8----------------

Include <linux/build_bug.h> for static_assert() and <linux/stringify.h>
for __stringify().

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 include/linux/init.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/init.h b/include/linux/init.h
index 077d7f93b402..29f7157670a5 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -2,7 +2,9 @@
 #ifndef _LINUX_INIT_H
 #define _LINUX_INIT_H
 
+#include <linux/build_bug.h>
 #include <linux/compiler.h>
+#include <linux/stringify.h>
 #include <linux/types.h>
 
 /* Built-in __init functions needn't be compiled with retpoline */
-- 
2.34.1


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

only message in thread, other threads:[~2022-11-13 11:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-13 11:08 [PATCH] linux/init.h: include <linux/build_bug.h> and <linux/stringify.h> Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox