xref: /openbmc/linux/arch/x86/kernel/Makefile (revision aa5a4611)
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	:= head_$(BITS).o
78d152e7aSLuis R. Rodriguezextra-y	+= head$(BITS).o
8f2d85299SLuis R. Rodriguezextra-y	+= ebda.o
98d152e7aSLuis R. Rodriguezextra-y	+= platform-quirks.o
108d152e7aSLuis R. Rodriguezextra-y	+= vmlinux.lds
116b0c3d44SSam Ravnborg
126b0c3d44SSam RavnborgCPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
13e43eb7baSIngo Molnar
14606576ceSSteven Rostedtifdef CONFIG_FUNCTION_TRACER
1534646bcaSIngo Molnar# Do not profile debug and lowlevel utilities
1689e1be50SSteven RostedtCFLAGS_REMOVE_tsc.o = -pg
17d5de8841SJeremy FitzhardingeCFLAGS_REMOVE_paravirt-spinlocks.o = -pg
189ecd4e16SJeremy FitzhardingeCFLAGS_REMOVE_pvclock.o = -pg
19258af474SSteven RostedtCFLAGS_REMOVE_kvmclock.o = -pg
2015adc048SSteven RostedtCFLAGS_REMOVE_ftrace.o = -pg
216cf87efbSIngo MolnarCFLAGS_REMOVE_early_printk.o = -pg
22bb43dbc5SKirill A. ShutemovCFLAGS_REMOVE_head64.o = -pg
23e759959fSBrijesh SinghCFLAGS_REMOVE_sev.o = -pg
24*aa5a4611STom LendackyCFLAGS_REMOVE_cc_platform.o = -pg
257fa09f24SSteven Rostedtendif
267fa09f24SSteven Rostedt
27ef7f0d6aSAndrey RyabininKASAN_SANITIZE_head$(BITS).o				:= n
28c420f167SAndrey RyabininKASAN_SANITIZE_dumpstack.o				:= n
29c420f167SAndrey RyabininKASAN_SANITIZE_dumpstack_$(BITS).o			:= n
30cd11016eSAlexander PotapenkoKASAN_SANITIZE_stacktrace.o				:= n
3112a8cc7fSAndrey RyabininKASAN_SANITIZE_paravirt.o				:= n
32e759959fSBrijesh SinghKASAN_SANITIZE_sev.o					:= n
33*aa5a4611STom LendackyKASAN_SANITIZE_cc_platform.o				:= n
34c0dd6716SJosh Poimboeuf
3540d04110SMarco Elver# With some compiler versions the generated code results in boot hangs, caused
3640d04110SMarco Elver# by several compilation units. To be safe, disable all instrumentation.
3740d04110SMarco ElverKCSAN_SANITIZE := n
3840d04110SMarco Elver
39c0dd6716SJosh PoimboeufOBJECT_FILES_NON_STANDARD_test_nx.o			:= y
40ef7f0d6aSAndrey Ryabinin
41e2ac83d7SJosh Poimboeufifdef CONFIG_FRAME_POINTER
42e2ac83d7SJosh PoimboeufOBJECT_FILES_NON_STANDARD_ftrace_$(BITS).o		:= y
43e2ac83d7SJosh Poimboeufendif
44e2ac83d7SJosh Poimboeuf
455c9a8750SDmitry Vyukov# If instrumentation of this dir is enabled, boot hangs during first second.
465c9a8750SDmitry Vyukov# Probably could be more selective here, but note that files related to irqs,
475c9a8750SDmitry Vyukov# boot, dumpstack/stacktrace, etc are either non-interesting or can lead to
485c9a8750SDmitry Vyukov# non-deterministic coverage.
495c9a8750SDmitry VyukovKCOV_INSTRUMENT		:= n
505c9a8750SDmitry Vyukov
51103a4908SArvind SankarCFLAGS_head$(BITS).o	+= -fno-stack-protector
52*aa5a4611STom LendackyCFLAGS_cc_platform.o	+= -fno-stack-protector
53103a4908SArvind Sankar
549cc342f6SMasahiro YamadaCFLAGS_irq.o := -I $(srctree)/$(src)/../include/asm/trace
5583ab8514SSteven Rostedt (Red Hat)
56905a36a2SIngo Molnarobj-y			:= process_$(BITS).o signal.o
57c0bfd26eSBrian Gerstobj-$(CONFIG_COMPAT)	+= signal_compat.o
58d8ed9d48SThomas Gleixnerobj-y			+= traps.o idt.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
59a5b9e5a2SAndy Lutomirskiobj-y			+= time.o ioport.o dumpstack.o nmi.o
60a5b9e5a2SAndy Lutomirskiobj-$(CONFIG_MODIFY_LDT_SYSCALL)	+= ldt.o
61e9666d10SMasahiro Yamadaobj-y			+= setup.o x86_init.o i8259.o irqinit.o
62e9666d10SMasahiro Yamadaobj-$(CONFIG_JUMP_LABEL)	+= jump_label.o
63e360adbeSPeter Zijlstraobj-$(CONFIG_IRQ_WORK)  += irq_work.o
645d94e81fSDan Williamsobj-y			+= probe_roms.o
65121b32a5SBrian Gerstobj-$(CONFIG_X86_32)	+= sys_ia32.o
66121b32a5SBrian Gerstobj-$(CONFIG_IA32_EMULATION)	+= sys_ia32.o
671fa9d67aSSteven Rostedt (VMware)obj-$(CONFIG_X86_64)	+= sys_x86_64.o
68197725deSH. Peter Anvinobj-$(CONFIG_X86_ESPFIX64)	+= espfix_64.o
695039e316SDave Youngobj-$(CONFIG_SYSFS)	+= ksysfs.o
70064d25f1SYinghai Luobj-y			+= bootflag.o e820.o
714061d68eSDavid Rientjesobj-y			+= pci-dma.o quirks.o topology.o kdebugfs.o
72fec777c3SChristoph Hellwigobj-y			+= alternative.o i8253.o hw_breakpoint.o
737da7c156SBin Gaoobj-y			+= tsc.o tsc_msr.o io_delay.o rtc.o
745bef80a4SKonrad Rzeszutek Wilkobj-y			+= pci-iommu_table.o
7530919b0bSBjorn Helgaasobj-y			+= resource.o
76d0a8d937SNick Desaulniersobj-y			+= irqflags.o
77e6d6c071SJosh Poimboeufobj-y			+= static_call.o
786b0c3d44SSam Ravnborg
7961c4628bSSuresh Siddhaobj-y				+= process.o
80ce4c4c26SIngo Molnarobj-y				+= fpu/
816b0c3d44SSam Ravnborgobj-y				+= ptrace.o
826b0c3d44SSam Ravnborgobj-$(CONFIG_X86_32)		+= tls.o
836b0c3d44SSam Ravnborgobj-$(CONFIG_IA32_EMULATION)	+= tls.o
846b0c3d44SSam Ravnborgobj-y				+= step.o
8531625340SJoseph Cihulaobj-$(CONFIG_INTEL_TXT)		+= tboot.o
864061d68eSDavid Rientjesobj-$(CONFIG_ISA_DMA_API)	+= i8237.o
876b0c3d44SSam Ravnborgobj-$(CONFIG_STACKTRACE)	+= stacktrace.o
886b0c3d44SSam Ravnborgobj-y				+= cpu/
896b0c3d44SSam Ravnborgobj-y				+= acpi/
90f095df0aSIngo Molnarobj-y				+= reboot.o
916b0c3d44SSam Ravnborgobj-$(CONFIG_X86_MSR)		+= msr.o
926b0c3d44SSam Ravnborgobj-$(CONFIG_X86_CPUID)		+= cpuid.o
936b0c3d44SSam Ravnborgobj-$(CONFIG_PCI)		+= early-quirks.o
943a900d89SSam Ravnborgapm-y				:= apm_32.o
953a900d89SSam Ravnborgobj-$(CONFIG_APM)		+= apm.o
963e5095d1SIngo Molnarobj-$(CONFIG_SMP)		+= smp.o
97ec8df88fSHenrik Kretzschmarobj-$(CONFIG_SMP)		+= smpboot.o
988b223bc7SThomas Gleixnerobj-$(CONFIG_X86_TSC)		+= tsc_sync.o
99996db817SBrian Gerstobj-$(CONFIG_SMP)		+= setup_percpu.o
10085bdddecSAlexey Starikovskiyobj-$(CONFIG_X86_MPPARSE)	+= mpparse.o
1019be1b56aSIngo Molnarobj-y				+= apic/
1026b0c3d44SSam Ravnborgobj-$(CONFIG_X86_REBOOTFIXUPS)	+= reboot_fixups_32.o
1033d083395SSteven Rostedtobj-$(CONFIG_DYNAMIC_FTRACE)	+= ftrace.o
1041fa9d67aSSteven Rostedt (VMware)obj-$(CONFIG_FUNCTION_TRACER)	+= ftrace_$(BITS).o
105fb52607aSFrederic Weisbeckerobj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
106ccd50dfdSIngo Molnarobj-$(CONFIG_FTRACE_SYSCALLS)	+= ftrace.o
1078cbd9cc6SDavid Sharpobj-$(CONFIG_X86_TSC)		+= trace_clock.o
108bce29ac9SDaniel Bristot de Oliveiraobj-$(CONFIG_TRACING)		+= trace.o
1098757dc97SOmar Sandovalobj-$(CONFIG_CRASH_CORE)	+= crash_core_$(BITS).o
1102965faa5SDave Youngobj-$(CONFIG_KEXEC_CORE)	+= machine_kexec_$(BITS).o
1112965faa5SDave Youngobj-$(CONFIG_KEXEC_CORE)	+= relocate_kernel_$(BITS).o crash.o
11274ca317cSVivek Goyalobj-$(CONFIG_KEXEC_FILE)	+= kexec-bzimage64.o
1136b0c3d44SSam Ravnborgobj-$(CONFIG_CRASH_DUMP)	+= crash_dump_$(BITS).o
114f684199fSMasami Hiramatsuobj-y				+= kprobes/
1150fdc83b9SAmerigo Wangobj-$(CONFIG_MODULES)		+= module.o
11659330942SBorislav Petkovobj-$(CONFIG_X86_32)		+= doublefault_32.o
11782da3ff8SIngo Molnarobj-$(CONFIG_KGDB)		+= kgdb.o
1186b0c3d44SSam Ravnborgobj-$(CONFIG_VM86)		+= vm86_32.o
1196b0c3d44SSam Ravnborgobj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
1206b0c3d44SSam Ravnborg
1216b0c3d44SSam Ravnborgobj-$(CONFIG_HPET_TIMER) 	+= hpet.o
1226b0c3d44SSam Ravnborg
12323ac4ae8SAndreas Herrmannobj-$(CONFIG_AMD_NB)		+= amd_nb.o
12499e8b9caSDon Zickusobj-$(CONFIG_DEBUG_NMI_SELFTEST) += nmi_selftest.o
1256b0c3d44SSam Ravnborg
12690993cddSMarcelo Tosattiobj-$(CONFIG_KVM_GUEST)		+= kvm.o kvmclock.o
127054ac8adSJuergen Grossobj-$(CONFIG_PARAVIRT)		+= paravirt.o
128b4ecc126SJeremy Fitzhardingeobj-$(CONFIG_PARAVIRT_SPINLOCKS)+= paravirt-spinlocks.o
1297af192c9SGerd Hoffmannobj-$(CONFIG_PARAVIRT_CLOCK)	+= pvclock.o
1307a67832cSDan Williamsobj-$(CONFIG_X86_PMEM_LEGACY_DEVICE) += pmem.o
13167926892SMichael Opdenacker
1324a362601SJan Kiszkaobj-$(CONFIG_JAILHOUSE_GUEST)	+= jailhouse.o
1334a362601SJan Kiszka
134f7eaf6e0SThomas Gleixnerobj-$(CONFIG_EISA)		+= eisa.o
135e5e1d3cbSStas Sergeevobj-$(CONFIG_PCSPKR_PLATFORM)	+= pcspeaker.o
1366b0c3d44SSam Ravnborg
137b43d196cSArjan van de Venobj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o
138b43d196cSArjan van de Ven
139b041cf22SIan Campbellobj-$(CONFIG_SWIOTLB)			+= pci-swiotlb.o
140da6b737bSSebastian Andrzej Siewiorobj-$(CONFIG_OF)			+= devicetree.o
1412b144498SSrikar Dronamrajuobj-$(CONFIG_UPROBES)			+= uprobes.o
142cfb80c9eSJeremy Fitzhardinge
143c5e63197SJiri Olsaobj-$(CONFIG_PERF_EVENTS)		+= perf_regs.o
144cf910e83SSeiji Aguchiobj-$(CONFIG_TRACING)			+= tracepoint.o
145de966cf4STim Chenobj-$(CONFIG_SCHED_MC_PRIO)		+= itmt.o
146b971880fSBabu Mogerobj-$(CONFIG_X86_UMIP)			+= umip.o
147c5e63197SJiri Olsa
14811af8474SJosh Poimboeufobj-$(CONFIG_UNWINDER_ORC)		+= unwind_orc.o
14911af8474SJosh Poimboeufobj-$(CONFIG_UNWINDER_FRAME_POINTER)	+= unwind_frame.o
15011af8474SJosh Poimboeufobj-$(CONFIG_UNWINDER_GUESS)		+= unwind_guess.o
1517c7900f8SJosh Poimboeuf
152e759959fSBrijesh Singhobj-$(CONFIG_AMD_MEM_ENCRYPT)		+= sev.o
153*aa5a4611STom Lendacky
154*aa5a4611STom Lendackyobj-$(CONFIG_ARCH_HAS_CC_PLATFORM)	+= cc_platform.o
155*aa5a4611STom Lendacky
1566b0c3d44SSam Ravnborg###
1576b0c3d44SSam Ravnborg# 64 bit specific files
1586b0c3d44SSam Ravnborgifeq ($(CONFIG_X86_64),y)
1596b0c3d44SSam Ravnborg	obj-$(CONFIG_AUDIT)		+= audit_64.o
1606b0c3d44SSam Ravnborg
161fffcda11SJoerg Roedel	obj-$(CONFIG_GART_IOMMU)	+= amd_gart_64.o aperture_64.o
162d39398a3SYinghai Lu
1638364e1f8SJan Kiszka	obj-$(CONFIG_MMCONF_FAM10H)	+= mmconf-fam10h_64.o
16470511134SRavikiran G Thirumalai	obj-y				+= vsmp_64.o
1656b0c3d44SSam Ravnborgendif
166