Commit a95b37e2 authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: get <linux/compiler_types.h> out of <linux/kconfig.h>

Since commit 28128c61 ("kconfig.h: Include compiler types to avoid
missed struct attributes"), <linux/kconfig.h> pulls in kernel-space
headers to unrelated places.

Commit 0f9da844 ("MIPS: boot: Define __ASSEMBLY__ for its.S build")
suppress the build error by defining __ASSEMBLY__, but ITS (i.e. DTS)
is not assembly, and should not include <linux/compiler_types.h> in the
first place.

Looking at arch/s390/tools/Makefile, host programs gen_facilities and
gen_opcode_table now pull in <linux/compiler_types.h> as well.

The motivation for that commit was to define necessary attributes
before any struct is defined.  Obviously, this happens only in C.

It is enough to include <linux/compiler_types.h> only when compiling
C files, and only when compiling kernel space.  Move the include to
c_flags.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 127668cf
...@@ -70,7 +70,4 @@ ...@@ -70,7 +70,4 @@
*/ */
#define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option)) #define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option))
/* Make sure we always have all types and struct attributes defined. */
#include <linux/compiler_types.h>
#endif /* __LINUX_KCONFIG_H */ #endif /* __LINUX_KCONFIG_H */
...@@ -152,6 +152,7 @@ __cpp_flags = $(call flags,_cpp_flags) ...@@ -152,6 +152,7 @@ __cpp_flags = $(call flags,_cpp_flags)
endif endif
c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
-include $(srctree)/include/linux/compiler_types.h \
$(__c_flags) $(modkern_cflags) \ $(__c_flags) $(modkern_cflags) \
$(basename_flags) $(modname_flags) $(basename_flags) $(modname_flags)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment