aboutsummaryrefslogtreecommitdiffstats
path: root/arch/loongarch
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2022-09-25 03:19:14 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2022-10-02 18:04:05 +0900
commit3216484550610470013b7ce1c9ed272da0a74589 (patch)
treee24e7df02e90b7e798ae5aa67a5e4468142978c8 /arch/loongarch
parentkbuild: hide error checker logs for V=1 builds (diff)
downloadlinux-dev-3216484550610470013b7ce1c9ed272da0a74589.tar.xz
linux-dev-3216484550610470013b7ce1c9ed272da0a74589.zip
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>
Diffstat (limited to 'arch/loongarch')
-rw-r--r--arch/loongarch/kernel/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/loongarch/kernel/Makefile b/arch/loongarch/kernel/Makefile
index e5be17009fe8..6c33b5c45573 100644
--- a/arch/loongarch/kernel/Makefile
+++ b/arch/loongarch/kernel/Makefile
@@ -3,9 +3,9 @@
# Makefile for the Linux/LoongArch kernel.
#
-extra-y := head.o vmlinux.lds
+extra-y := vmlinux.lds
-obj-y += cpu-probe.o cacheinfo.o env.o setup.o entry.o genex.o \
+obj-y += head.o cpu-probe.o cacheinfo.o env.o setup.o entry.o genex.o \
traps.o irq.o idle.o process.o dma.o mem.o io.o reset.o switch.o \
elf.o syscall.o signal.o time.o topology.o inst.o ptrace.o vdso.o