Masahiro Yamada 3216484550 kbuild: use obj-y instead extra-y for objects placed at the head
The objects placed at the head of vmlinux need special treatments:

 - arch/$(SRCARCH)/Makefile adds them to head-y in order to place
   them before other archives in the linker command line.

 - arch/$(SRCARCH)/kernel/Makefile adds them to extra-y instead of
   obj-y to avoid them going into built-in.a.

This commit gets rid of the latter.

Create vmlinux.a to collect all the objects that are unconditionally
linked to vmlinux. The objects listed in head-y are moved to the head
of vmlinux.a by using 'ar m'.

With this, arch/$(SRCARCH)/kernel/Makefile can consistently use obj-y
for builtin objects.

There is no *.o that is directly linked to vmlinux. Drop unneeded code
in scripts/clang-tools/gen_compile_commands.py.

$(AR) mPi needs 'T' to workaround the llvm-ar bug. The fix was suggested
by Nathan Chancellor [1].

[1]: https://lore.kernel.org/llvm/YyjjT5gQ2hGMH0ni@dev-arch.thelio-3990X/

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
2022-10-02 18:04:05 +09:00
..
2022-03-15 10:32:40 +01:00
2020-11-24 16:47:49 +01:00
2021-11-02 22:22:13 -07:00
2022-02-25 09:36:05 +01:00
2022-04-19 17:14:09 -07:00
2022-08-05 09:41:12 -07:00
2022-07-01 11:11:34 +02:00
2022-06-27 10:34:00 +02:00
2022-04-07 08:27:51 -07:00
2022-08-02 15:21:18 -07:00
2021-03-18 15:31:53 +01:00
2022-06-20 06:22:04 -04:00
2022-03-15 10:32:36 +01:00
2021-12-01 00:06:43 +01:00
2022-04-14 14:09:43 +02:00
2021-03-18 15:31:53 +01:00
2022-05-19 19:30:31 +02:00
2022-08-25 15:54:03 +02:00
2022-04-14 14:09:43 +02:00
2022-02-25 09:36:05 +01:00
2021-10-25 23:02:36 -04:00
2022-04-14 14:09:43 +02:00