xref: /openbmc/linux/arch/x86/kernel/Makefile (revision 0d345996)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
26b0c3d44SSam Ravnborg#
36b0c3d44SSam Ravnborg# Makefile for the linux kernel.
46b0c3d44SSam Ravnborg#
588e4d250SSam Ravnborg
68d152e7aSLuis R. Rodriguezextra-y	+= vmlinux.lds
76b0c3d44SSam Ravnborg
86b0c3d44SSam RavnborgCPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
9e43eb7baSIngo Molnar
10606576ceSSteven Rostedtifdef CONFIG_FUNCTION_TRACER
1134646bcaSIngo Molnar# Do not profile debug and lowlevel utilities
1289e1be50SSteven RostedtCFLAGS_REMOVE_tsc.o = -pg
13d5de8841SJeremy FitzhardingeCFLAGS_REMOVE_paravirt-spinlocks.o = -pg
149ecd4e16SJeremy FitzhardingeCFLAGS_REMOVE_pvclock.o = -pg
15258af474SSteven RostedtCFLAGS_REMOVE_kvmclock.o = -pg
1615adc048SSteven RostedtCFLAGS_REMOVE_ftrace.o = -pg
176cf87efbSIngo MolnarCFLAGS_REMOVE_early_printk.o = -pg
18bb43dbc5SKirill A. ShutemovCFLAGS_REMOVE_head64.o = -pg
19e759959fSBrijesh SinghCFLAGS_REMOVE_sev.o = -pg
20571a2a50SZe GaoCFLAGS_REMOVE_rethook.o = -pg
217fa09f24SSteven Rostedtendif
227fa09f24SSteven Rostedt
23ef7f0d6aSAndrey RyabininKASAN_SANITIZE_head$(BITS).o				:= n
24c420f167SAndrey RyabininKASAN_SANITIZE_dumpstack.o				:= n
25c420f167SAndrey RyabininKASAN_SANITIZE_dumpstack_$(BITS).o			:= n
26cd11016eSAlexander PotapenkoKASAN_SANITIZE_stacktrace.o				:= n
2712a8cc7fSAndrey RyabininKASAN_SANITIZE_paravirt.o				:= n
28e759959fSBrijesh SinghKASAN_SANITIZE_sev.o					:= n
29c0dd6716SJosh Poimboeuf
3040d04110SMarco Elver# With some compiler versions the generated code results in boot hangs, caused
3140d04110SMarco Elver# by several compilation units. To be safe, disable all instrumentation.
3240d04110SMarco ElverKCSAN_SANITIZE := n
3393324e68SAlexander PotapenkoKMSAN_SANITIZE_head$(BITS).o				:= n
3493324e68SAlexander PotapenkoKMSAN_SANITIZE_nmi.o					:= n
3540d04110SMarco Elver
36*0d345996SPengfei Xu# If instrumentation of the following files is enabled, boot hangs during
37*0d345996SPengfei Xu# first second.
38*0d345996SPengfei XuKCOV_INSTRUMENT_head$(BITS).o				:= n
39*0d345996SPengfei XuKCOV_INSTRUMENT_sev.o					:= n
405c9a8750SDmitry Vyukov
419cc342f6SMasahiro YamadaCFLAGS_irq.o := -I $(srctree)/$(src)/../include/asm/trace
4283ab8514SSteven Rostedt (Red Hat)
4332164845SMasahiro Yamadaobj-y			+= head_$(BITS).o
4432164845SMasahiro Yamadaobj-y			+= head$(BITS).o
4532164845SMasahiro Yamadaobj-y			+= ebda.o
4632164845SMasahiro Yamadaobj-y			+= platform-quirks.o
47a545b48cSBrian Gerstobj-y			+= process_$(BITS).o signal.o signal_$(BITS).o
48d8ed9d48SThomas Gleixnerobj-y			+= traps.o idt.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
49a5b9e5a2SAndy Lutomirskiobj-y			+= time.o ioport.o dumpstack.o nmi.o
50a5b9e5a2SAndy Lutomirskiobj-$(CONFIG_MODIFY_LDT_SYSCALL)	+= ldt.o
51e9666d10SMasahiro Yamadaobj-$(CONFIG_X86_KERNEL_IBT)		+= ibt_selftest.o
52e9666d10SMasahiro Yamadaobj-y			+= setup.o x86_init.o i8259.o irqinit.o
53e360adbeSPeter Zijlstraobj-$(CONFIG_JUMP_LABEL)	+= jump_label.o
545d94e81fSDan Williamsobj-$(CONFIG_IRQ_WORK)  += irq_work.o
55a545b48cSBrian Gerstobj-y			+= probe_roms.o
5624e6dc35SBrian Gerstobj-$(CONFIG_X86_32)	+= sys_ia32.o
571fa9d67aSSteven Rostedt (VMware)obj-$(CONFIG_IA32_EMULATION)	+= sys_ia32.o signal_32.o
58197725deSH. Peter Anvinobj-$(CONFIG_X86_64)	+= sys_x86_64.o
595039e316SDave Youngobj-$(CONFIG_X86_ESPFIX64)	+= espfix_64.o
60064d25f1SYinghai Luobj-$(CONFIG_SYSFS)	+= ksysfs.o
614061d68eSDavid Rientjesobj-y			+= bootflag.o e820.o
62fec777c3SChristoph Hellwigobj-y			+= pci-dma.o quirks.o topology.o kdebugfs.o
637da7c156SBin Gaoobj-y			+= alternative.o i8253.o hw_breakpoint.o
6430919b0bSBjorn Helgaasobj-y			+= tsc.o tsc_msr.o io_delay.o rtc.o
65d0a8d937SNick Desaulniersobj-y			+= resource.o
66e6d6c071SJosh Poimboeufobj-y			+= irqflags.o
676b0c3d44SSam Ravnborgobj-y			+= static_call.o
6861c4628bSSuresh Siddha
69ce4c4c26SIngo Molnarobj-y				+= process.o
706b0c3d44SSam Ravnborgobj-y				+= fpu/
716b0c3d44SSam Ravnborgobj-y				+= ptrace.o
726b0c3d44SSam Ravnborgobj-$(CONFIG_X86_32)		+= tls.o
736b0c3d44SSam Ravnborgobj-$(CONFIG_IA32_EMULATION)	+= tls.o
7431625340SJoseph Cihulaobj-y				+= step.o
754061d68eSDavid Rientjesobj-$(CONFIG_INTEL_TXT)		+= tboot.o
761614b2b1SPeter Zijlstraobj-$(CONFIG_ISA_DMA_API)	+= i8237.o
776b0c3d44SSam Ravnborgobj-y				+= stacktrace.o
786b0c3d44SSam Ravnborgobj-y				+= cpu/
79f095df0aSIngo Molnarobj-y				+= acpi/
806b0c3d44SSam Ravnborgobj-y				+= reboot.o
816b0c3d44SSam Ravnborgobj-$(CONFIG_X86_MSR)		+= msr.o
826b0c3d44SSam Ravnborgobj-$(CONFIG_X86_CPUID)		+= cpuid.o
833a900d89SSam Ravnborgobj-$(CONFIG_PCI)		+= early-quirks.o
843a900d89SSam Ravnborgapm-y				:= apm_32.o
853e5095d1SIngo Molnarobj-$(CONFIG_APM)		+= apm.o
86ec8df88fSHenrik Kretzschmarobj-$(CONFIG_SMP)		+= smp.o
878b223bc7SThomas Gleixnerobj-$(CONFIG_SMP)		+= smpboot.o
88996db817SBrian Gerstobj-$(CONFIG_X86_TSC)		+= tsc_sync.o
8985bdddecSAlexey Starikovskiyobj-$(CONFIG_SMP)		+= setup_percpu.o
909be1b56aSIngo Molnarobj-$(CONFIG_X86_MPPARSE)	+= mpparse.o
916b0c3d44SSam Ravnborgobj-y				+= apic/
923d083395SSteven Rostedtobj-$(CONFIG_X86_REBOOTFIXUPS)	+= reboot_fixups_32.o
931fa9d67aSSteven Rostedt (VMware)obj-$(CONFIG_DYNAMIC_FTRACE)	+= ftrace.o
94fb52607aSFrederic Weisbeckerobj-$(CONFIG_FUNCTION_TRACER)	+= ftrace_$(BITS).o
95ccd50dfdSIngo Molnarobj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
968cbd9cc6SDavid Sharpobj-$(CONFIG_FTRACE_SYSCALLS)	+= ftrace.o
97bce29ac9SDaniel Bristot de Oliveiraobj-$(CONFIG_X86_TSC)		+= trace_clock.o
98f3a112c0SMasami Hiramatsuobj-$(CONFIG_TRACING)		+= trace.o
998757dc97SOmar Sandovalobj-$(CONFIG_RETHOOK)		+= rethook.o
1002965faa5SDave Youngobj-$(CONFIG_CRASH_CORE)	+= crash_core_$(BITS).o
1012965faa5SDave Youngobj-$(CONFIG_KEXEC_CORE)	+= machine_kexec_$(BITS).o
10274ca317cSVivek Goyalobj-$(CONFIG_KEXEC_CORE)	+= relocate_kernel_$(BITS).o crash.o
1036b0c3d44SSam Ravnborgobj-$(CONFIG_KEXEC_FILE)	+= kexec-bzimage64.o
104f684199fSMasami Hiramatsuobj-$(CONFIG_CRASH_DUMP)	+= crash_dump_$(BITS).o
1050fdc83b9SAmerigo Wangobj-y				+= kprobes/
10659330942SBorislav Petkovobj-$(CONFIG_MODULES)		+= module.o
10782da3ff8SIngo Molnarobj-$(CONFIG_X86_32)		+= doublefault_32.o
1086b0c3d44SSam Ravnborgobj-$(CONFIG_KGDB)		+= kgdb.o
1096b0c3d44SSam Ravnborgobj-$(CONFIG_VM86)		+= vm86_32.o
1106b0c3d44SSam Ravnborgobj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
1116b0c3d44SSam Ravnborg
1126b0c3d44SSam Ravnborgobj-$(CONFIG_HPET_TIMER) 	+= hpet.o
11323ac4ae8SAndreas Herrmann
11499e8b9caSDon Zickusobj-$(CONFIG_AMD_NB)		+= amd_nb.o
1156b0c3d44SSam Ravnborgobj-$(CONFIG_DEBUG_NMI_SELFTEST) += nmi_selftest.o
11690993cddSMarcelo Tosatti
117054ac8adSJuergen Grossobj-$(CONFIG_KVM_GUEST)		+= kvm.o kvmclock.o
118b4ecc126SJeremy Fitzhardingeobj-$(CONFIG_PARAVIRT)		+= paravirt.o
1197af192c9SGerd Hoffmannobj-$(CONFIG_PARAVIRT_SPINLOCKS)+= paravirt-spinlocks.o
1207a67832cSDan Williamsobj-$(CONFIG_PARAVIRT_CLOCK)	+= pvclock.o
12167926892SMichael Opdenackerobj-$(CONFIG_X86_PMEM_LEGACY_DEVICE) += pmem.o
1224a362601SJan Kiszka
1234a362601SJan Kiszkaobj-$(CONFIG_JAILHOUSE_GUEST)	+= jailhouse.o
124f7eaf6e0SThomas Gleixner
125e5e1d3cbSStas Sergeevobj-$(CONFIG_EISA)		+= eisa.o
1266b0c3d44SSam Ravnborgobj-$(CONFIG_PCSPKR_PLATFORM)	+= pcspeaker.o
127b43d196cSArjan van de Ven
128b43d196cSArjan van de Venobj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o
129da6b737bSSebastian Andrzej Siewior
1302b144498SSrikar Dronamrajuobj-$(CONFIG_OF)			+= devicetree.o
131cfb80c9eSJeremy Fitzhardingeobj-$(CONFIG_UPROBES)			+= uprobes.o
132c5e63197SJiri Olsa
133cf910e83SSeiji Aguchiobj-$(CONFIG_PERF_EVENTS)		+= perf_regs.o
134de966cf4STim Chenobj-$(CONFIG_TRACING)			+= tracepoint.o
135b971880fSBabu Mogerobj-$(CONFIG_SCHED_MC_PRIO)		+= itmt.o
136c5e63197SJiri Olsaobj-$(CONFIG_X86_UMIP)			+= umip.o
13711af8474SJosh Poimboeuf
13811af8474SJosh Poimboeufobj-$(CONFIG_UNWINDER_ORC)		+= unwind_orc.o
13911af8474SJosh Poimboeufobj-$(CONFIG_UNWINDER_FRAME_POINTER)	+= unwind_frame.o
1407c7900f8SJosh Poimboeufobj-$(CONFIG_UNWINDER_GUESS)		+= unwind_guess.o
141e759959fSBrijesh Singh
142aa5a4611STom Lendackyobj-$(CONFIG_AMD_MEM_ENCRYPT)		+= sev.o
1433c516f89SSami Tolvanen
1443c516f89SSami Tolvanenobj-$(CONFIG_CFI_CLANG)			+= cfi.o
145e81dc127SThomas Gleixner
146e81dc127SThomas Gleixnerobj-$(CONFIG_CALL_THUNKS)		+= callthunks.o
1476b0c3d44SSam Ravnborg
1486b0c3d44SSam Ravnborgobj-$(CONFIG_X86_CET)			+= cet.o
1496b0c3d44SSam Ravnborg
1506b0c3d44SSam Ravnborgobj-$(CONFIG_X86_USER_SHADOW_STACK)	+= shstk.o
1516b0c3d44SSam Ravnborg
152fffcda11SJoerg Roedel###
153d39398a3SYinghai Lu# 64 bit specific files
1548364e1f8SJan Kiszkaifeq ($(CONFIG_X86_64),y)
15570511134SRavikiran G Thirumalai	obj-$(CONFIG_AUDIT)		+= audit_64.o
1566b0c3d44SSam Ravnborg
157	obj-$(CONFIG_GART_IOMMU)	+= amd_gart_64.o aperture_64.o
158
159	obj-$(CONFIG_MMCONF_FAM10H)	+= mmconf-fam10h_64.o
160	obj-y				+= vsmp_64.o
161endif
162