xref: /linux/arch/arm/kernel/Makefile (revision 497e6b37b0099dc415578488287fd84fb74433eb)
1# SPDX-License-Identifier: GPL-2.0
2#
3# Makefile for the linux kernel.
4#
5
6CPPFLAGS_vmlinux.lds := -DTEXT_OFFSET=$(TEXT_OFFSET)
7AFLAGS_head.o        := -DTEXT_OFFSET=$(TEXT_OFFSET)
8
9ifdef CONFIG_FUNCTION_TRACER
10CFLAGS_REMOVE_ftrace.o = -pg
11CFLAGS_REMOVE_insn.o = -pg
12CFLAGS_REMOVE_patch.o = -pg
13CFLAGS_REMOVE_unwind.o = -pg
14endif
15
16CFLAGS_REMOVE_return_address.o = -pg
17
18# Object file lists.
19
20obj-y		:= elf.o entry-common.o irq.o opcodes.o \
21		   process.o ptrace.o reboot.o io.o \
22		   setup.o signal.o sigreturn_codes.o \
23		   stacktrace.o sys_arm.o time.o traps.o
24
25KASAN_SANITIZE_stacktrace.o := n
26KASAN_SANITIZE_traps.o := n
27
28ifneq ($(CONFIG_ARM_UNWIND),y)
29obj-$(CONFIG_FRAME_POINTER)	+= return_address.o
30endif
31
32obj-$(CONFIG_ATAGS)		+= atags_parse.o
33obj-$(CONFIG_ATAGS_PROC)	+= atags_proc.o
34obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o
35
36ifeq ($(CONFIG_CPU_V7M),y)
37obj-y		+= entry-v7m.o v7m.o
38else
39obj-y		+= entry-armv.o
40endif
41
42obj-$(CONFIG_MMU)		+= bugs.o
43obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
44obj-$(CONFIG_ISA_DMA_API)	+= dma.o
45obj-$(CONFIG_FIQ)		+= fiq.o fiqasm.o
46obj-$(CONFIG_MODULES)		+= armksyms.o module.o
47obj-$(CONFIG_ARM_MODULE_PLTS)	+= module-plts.o
48obj-$(CONFIG_PCI)		+= bios32.o isa.o
49obj-$(CONFIG_ARM_CPU_SUSPEND)	+= sleep.o suspend.o
50obj-$(CONFIG_HIBERNATION)	+= hibernate.o
51obj-$(CONFIG_SMP)		+= smp.o
52ifdef CONFIG_MMU
53obj-$(CONFIG_SMP)		+= smp_tlb.o
54endif
55obj-$(CONFIG_HAVE_ARM_SCU)	+= smp_scu.o
56obj-$(CONFIG_HAVE_ARM_TWD)	+= smp_twd.o
57obj-$(CONFIG_ARM_ARCH_TIMER)	+= arch_timer.o
58obj-$(CONFIG_FUNCTION_TRACER)	+= entry-ftrace.o
59obj-$(CONFIG_DYNAMIC_FTRACE)	+= ftrace.o insn.o patch.o
60obj-$(CONFIG_FUNCTION_GRAPH_TRACER)	+= ftrace.o insn.o patch.o
61obj-$(CONFIG_JUMP_LABEL)	+= jump_label.o insn.o patch.o
62obj-$(CONFIG_KEXEC)		+= machine_kexec.o relocate_kernel.o
63# Main staffs in KPROBES are in arch/arm/probes/ .
64obj-$(CONFIG_KPROBES)		+= patch.o insn.o
65obj-$(CONFIG_OABI_COMPAT)	+= sys_oabi-compat.o
66obj-$(CONFIG_ARM_THUMBEE)	+= thumbee.o
67obj-$(CONFIG_KGDB)		+= kgdb.o patch.o
68obj-$(CONFIG_ARM_UNWIND)	+= unwind.o
69obj-$(CONFIG_HAVE_TCM)		+= tcm.o
70obj-$(CONFIG_OF)		+= devtree.o
71obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
72obj-$(CONFIG_SWP_EMULATE)	+= swp_emulate.o
73obj-$(CONFIG_HAVE_HW_BREAKPOINT)	+= hw_breakpoint.o
74
75obj-$(CONFIG_CPU_XSCALE)	+= xscale-cp0.o
76obj-$(CONFIG_CPU_XSC3)		+= xscale-cp0.o
77obj-$(CONFIG_CPU_MOHAWK)	+= xscale-cp0.o
78obj-$(CONFIG_CPU_PJ4)		+= pj4-cp0.o
79obj-$(CONFIG_CPU_PJ4B)		+= pj4-cp0.o
80obj-$(CONFIG_IWMMXT)		+= iwmmxt.o
81obj-$(CONFIG_PERF_EVENTS)	+= perf_regs.o perf_callchain.o
82obj-$(CONFIG_HW_PERF_EVENTS)	+= perf_event_xscale.o perf_event_v6.o \
83				   perf_event_v7.o
84AFLAGS_iwmmxt.o			:= -Wa,-mcpu=iwmmxt
85obj-$(CONFIG_ARM_CPU_TOPOLOGY)  += topology.o
86obj-$(CONFIG_VDSO)		+= vdso.o
87obj-$(CONFIG_EFI)		+= efi.o
88obj-$(CONFIG_PARAVIRT)	+= paravirt.o
89
90obj-y			+= head$(MMUEXT).o
91obj-$(CONFIG_DEBUG_LL)	+= debug.o
92obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
93obj-$(CONFIG_ARM_PATCH_PHYS_VIRT)	+= phys2virt.o
94
95# This is executed very early using a temporary stack when no memory allocator
96# nor global data is available. Everything has to be allocated on the stack.
97CFLAGS_head-inflate-data.o := $(call cc-option,-Wframe-larger-than=10240)
98obj-$(CONFIG_XIP_DEFLATED_DATA) += head-inflate-data.o
99
100obj-$(CONFIG_ARM_VIRT_EXT)	+= hyp-stub.o
101ifeq ($(CONFIG_ARM_PSCI),y)
102obj-$(CONFIG_SMP)		+= psci_smp.o
103endif
104
105obj-$(CONFIG_HAVE_ARM_SMCCC)	+= smccc-call.o
106
107obj-$(CONFIG_GENERIC_CPU_VULNERABILITIES) += spectre.o
108
109extra-y := vmlinux.lds
110