Kbuild updates for v4.17

- add a shell script to get Clang version

- improve portability of build scripts

- drop always-enabled CONFIG_THIN_ARCHIVE and remove unused code

- rename built-in.o which is now thin archive to built-in.a

- process clean/build targets one by one to get along with -j option

- simplify ld-option

- improve building with CONFIG_TRIM_UNUSED_KSYMS

- define KBUILD_MODNAME even for objects shared among multiple modules

- avoid linking multiple instances of same objects from composite objects

- move <linux/compiler_types.h> to c_flags to include it only for C files

- clean-up various Makefiles
kbuild: get <linux/compiler_types.h> out of <linux/kconfig.h>

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

Commit 0f9da844d877 ("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: Masahiro Yamada <yamada.masahiro@socionext.com>
2 files changed