mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 01:13:11 +00:00
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/[email protected]/ Signed-off-by: Masahiro Yamada <[email protected]> Tested-by: Nick Desaulniers <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
34 lines
855 B
Makefile
34 lines
855 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for the linux kernel.
|
|
#
|
|
|
|
extra-y += vmlinux.lds
|
|
|
|
obj-$(CONFIG_AMIGA) := head.o
|
|
obj-$(CONFIG_ATARI) := head.o
|
|
obj-$(CONFIG_MAC) := head.o
|
|
obj-$(CONFIG_APOLLO) := head.o
|
|
obj-$(CONFIG_VME) := head.o
|
|
obj-$(CONFIG_HP300) := head.o
|
|
obj-$(CONFIG_Q40) := head.o
|
|
obj-$(CONFIG_SUN3X) := head.o
|
|
obj-$(CONFIG_VIRT) := head.o
|
|
obj-$(CONFIG_SUN3) := sun3-head.o
|
|
|
|
obj-y += entry.o irq.o module.o process.o ptrace.o
|
|
obj-y += setup.o signal.o sys_m68k.o syscalltable.o time.o traps.o
|
|
|
|
obj-$(CONFIG_MMU_MOTOROLA) += ints.o vectors.o
|
|
obj-$(CONFIG_MMU_SUN3) += ints.o vectors.o
|
|
obj-$(CONFIG_PCI) += pcibios.o
|
|
|
|
obj-$(CONFIG_HAS_DMA) += dma.o
|
|
|
|
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
|
|
obj-$(CONFIG_BOOTINFO_PROC) += bootinfo_proc.o
|
|
obj-$(CONFIG_UBOOT) += uboot.o
|
|
|
|
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
|
|