xref: /openbmc/linux/arch/x86/kernel/Makefile (revision a545b48c)
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
207fa09f24SSteven Rostedtendif
217fa09f24SSteven Rostedt
22ef7f0d6aSAndrey RyabininKASAN_SANITIZE_head$(BITS).o				:= n
23c420f167SAndrey RyabininKASAN_SANITIZE_dumpstack.o				:= n
24c420f167SAndrey RyabininKASAN_SANITIZE_dumpstack_$(BITS).o			:= n
25cd11016eSAlexander PotapenkoKASAN_SANITIZE_stacktrace.o				:= n
2612a8cc7fSAndrey RyabininKASAN_SANITIZE_paravirt.o				:= n
27e759959fSBrijesh SinghKASAN_SANITIZE_sev.o					:= n
28c0dd6716SJosh Poimboeuf
2940d04110SMarco Elver# With some compiler versions the generated code results in boot hangs, caused
3040d04110SMarco Elver# by several compilation units. To be safe, disable all instrumentation.
3140d04110SMarco ElverKCSAN_SANITIZE := n
3293324e68SAlexander PotapenkoKMSAN_SANITIZE_head$(BITS).o				:= n
3393324e68SAlexander PotapenkoKMSAN_SANITIZE_nmi.o					:= n
3440d04110SMarco Elver
355c9a8750SDmitry Vyukov# If instrumentation of this dir is enabled, boot hangs during first second.
365c9a8750SDmitry Vyukov# Probably could be more selective here, but note that files related to irqs,
375c9a8750SDmitry Vyukov# boot, dumpstack/stacktrace, etc are either non-interesting or can lead to
385c9a8750SDmitry Vyukov# non-deterministic coverage.
395c9a8750SDmitry VyukovKCOV_INSTRUMENT		:= 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
47*a545b48cSBrian Gerstobj-y			+= process_$(BITS).o signal.o signal_$(BITS).o
48c0bfd26eSBrian Gerstobj-$(CONFIG_COMPAT)	+= signal_compat.o
49d8ed9d48SThomas Gleixnerobj-y			+= traps.o idt.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
50a5b9e5a2SAndy Lutomirskiobj-y			+= time.o ioport.o dumpstack.o nmi.o
51a5b9e5a2SAndy Lutomirskiobj-$(CONFIG_MODIFY_LDT_SYSCALL)	+= ldt.o
52e9666d10SMasahiro Yamadaobj-y			+= setup.o x86_init.o i8259.o irqinit.o
53e9666d10SMasahiro Yamadaobj-$(CONFIG_JUMP_LABEL)	+= jump_label.o
54e360adbeSPeter Zijlstraobj-$(CONFIG_IRQ_WORK)  += irq_work.o
555d94e81fSDan Williamsobj-y			+= probe_roms.o
56*a545b48cSBrian Gerstobj-$(CONFIG_X86_32)	+= sys_ia32.o
5724e6dc35SBrian Gerstobj-$(CONFIG_IA32_EMULATION)	+= sys_ia32.o signal_32.o
581fa9d67aSSteven Rostedt (VMware)obj-$(CONFIG_X86_64)	+= sys_x86_64.o
59197725deSH. Peter Anvinobj-$(CONFIG_X86_ESPFIX64)	+= espfix_64.o
605039e316SDave Youngobj-$(CONFIG_SYSFS)	+= ksysfs.o
61064d25f1SYinghai Luobj-y			+= bootflag.o e820.o
624061d68eSDavid Rientjesobj-y			+= pci-dma.o quirks.o topology.o kdebugfs.o
63fec777c3SChristoph Hellwigobj-y			+= alternative.o i8253.o hw_breakpoint.o
647da7c156SBin Gaoobj-y			+= tsc.o tsc_msr.o io_delay.o rtc.o
6530919b0bSBjorn Helgaasobj-y			+= resource.o
66d0a8d937SNick Desaulniersobj-y			+= irqflags.o
67e6d6c071SJosh Poimboeufobj-y			+= static_call.o
686b0c3d44SSam Ravnborg
6961c4628bSSuresh Siddhaobj-y				+= process.o
70ce4c4c26SIngo Molnarobj-y				+= fpu/
716b0c3d44SSam Ravnborgobj-y				+= ptrace.o
726b0c3d44SSam Ravnborgobj-$(CONFIG_X86_32)		+= tls.o
736b0c3d44SSam Ravnborgobj-$(CONFIG_IA32_EMULATION)	+= tls.o
746b0c3d44SSam Ravnborgobj-y				+= step.o
7531625340SJoseph Cihulaobj-$(CONFIG_INTEL_TXT)		+= tboot.o
764061d68eSDavid Rientjesobj-$(CONFIG_ISA_DMA_API)	+= i8237.o
771614b2b1SPeter Zijlstraobj-y				+= stacktrace.o
786b0c3d44SSam Ravnborgobj-y				+= cpu/
796b0c3d44SSam Ravnborgobj-y				+= acpi/
80f095df0aSIngo Molnarobj-y				+= reboot.o
816b0c3d44SSam Ravnborgobj-$(CONFIG_X86_MSR)		+= msr.o
826b0c3d44SSam Ravnborgobj-$(CONFIG_X86_CPUID)		+= cpuid.o
836b0c3d44SSam Ravnborgobj-$(CONFIG_PCI)		+= early-quirks.o
843a900d89SSam Ravnborgapm-y				:= apm_32.o
853a900d89SSam Ravnborgobj-$(CONFIG_APM)		+= apm.o
863e5095d1SIngo Molnarobj-$(CONFIG_SMP)		+= smp.o
87ec8df88fSHenrik Kretzschmarobj-$(CONFIG_SMP)		+= smpboot.o
888b223bc7SThomas Gleixnerobj-$(CONFIG_X86_TSC)		+= tsc_sync.o
89996db817SBrian Gerstobj-$(CONFIG_SMP)		+= setup_percpu.o
9085bdddecSAlexey Starikovskiyobj-$(CONFIG_X86_MPPARSE)	+= mpparse.o
919be1b56aSIngo Molnarobj-y				+= apic/
926b0c3d44SSam Ravnborgobj-$(CONFIG_X86_REBOOTFIXUPS)	+= reboot_fixups_32.o
933d083395SSteven Rostedtobj-$(CONFIG_DYNAMIC_FTRACE)	+= ftrace.o
941fa9d67aSSteven Rostedt (VMware)obj-$(CONFIG_FUNCTION_TRACER)	+= ftrace_$(BITS).o
95fb52607aSFrederic Weisbeckerobj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
96ccd50dfdSIngo Molnarobj-$(CONFIG_FTRACE_SYSCALLS)	+= ftrace.o
978cbd9cc6SDavid Sharpobj-$(CONFIG_X86_TSC)		+= trace_clock.o
98bce29ac9SDaniel Bristot de Oliveiraobj-$(CONFIG_TRACING)		+= trace.o
99f3a112c0SMasami Hiramatsuobj-$(CONFIG_RETHOOK)		+= rethook.o
1008757dc97SOmar Sandovalobj-$(CONFIG_CRASH_CORE)	+= crash_core_$(BITS).o
1012965faa5SDave Youngobj-$(CONFIG_KEXEC_CORE)	+= machine_kexec_$(BITS).o
1022965faa5SDave Youngobj-$(CONFIG_KEXEC_CORE)	+= relocate_kernel_$(BITS).o crash.o
10374ca317cSVivek Goyalobj-$(CONFIG_KEXEC_FILE)	+= kexec-bzimage64.o
1046b0c3d44SSam Ravnborgobj-$(CONFIG_CRASH_DUMP)	+= crash_dump_$(BITS).o
105f684199fSMasami Hiramatsuobj-y				+= kprobes/
1060fdc83b9SAmerigo Wangobj-$(CONFIG_MODULES)		+= module.o
10759330942SBorislav Petkovobj-$(CONFIG_X86_32)		+= doublefault_32.o
10882da3ff8SIngo Molnarobj-$(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
1136b0c3d44SSam Ravnborg
11423ac4ae8SAndreas Herrmannobj-$(CONFIG_AMD_NB)		+= amd_nb.o
11599e8b9caSDon Zickusobj-$(CONFIG_DEBUG_NMI_SELFTEST) += nmi_selftest.o
1166b0c3d44SSam Ravnborg
11790993cddSMarcelo Tosattiobj-$(CONFIG_KVM_GUEST)		+= kvm.o kvmclock.o
118054ac8adSJuergen Grossobj-$(CONFIG_PARAVIRT)		+= paravirt.o
119b4ecc126SJeremy Fitzhardingeobj-$(CONFIG_PARAVIRT_SPINLOCKS)+= paravirt-spinlocks.o
1207af192c9SGerd Hoffmannobj-$(CONFIG_PARAVIRT_CLOCK)	+= pvclock.o
1217a67832cSDan Williamsobj-$(CONFIG_X86_PMEM_LEGACY_DEVICE) += pmem.o
12267926892SMichael Opdenacker
1234a362601SJan Kiszkaobj-$(CONFIG_JAILHOUSE_GUEST)	+= jailhouse.o
1244a362601SJan Kiszka
125f7eaf6e0SThomas Gleixnerobj-$(CONFIG_EISA)		+= eisa.o
126e5e1d3cbSStas Sergeevobj-$(CONFIG_PCSPKR_PLATFORM)	+= pcspeaker.o
1276b0c3d44SSam Ravnborg
128b43d196cSArjan van de Venobj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o
129b43d196cSArjan van de Ven
130da6b737bSSebastian Andrzej Siewiorobj-$(CONFIG_OF)			+= devicetree.o
1312b144498SSrikar Dronamrajuobj-$(CONFIG_UPROBES)			+= uprobes.o
132cfb80c9eSJeremy Fitzhardinge
133c5e63197SJiri Olsaobj-$(CONFIG_PERF_EVENTS)		+= perf_regs.o
134cf910e83SSeiji Aguchiobj-$(CONFIG_TRACING)			+= tracepoint.o
135de966cf4STim Chenobj-$(CONFIG_SCHED_MC_PRIO)		+= itmt.o
136b971880fSBabu Mogerobj-$(CONFIG_X86_UMIP)			+= umip.o
137c5e63197SJiri Olsa
13811af8474SJosh Poimboeufobj-$(CONFIG_UNWINDER_ORC)		+= unwind_orc.o
13911af8474SJosh Poimboeufobj-$(CONFIG_UNWINDER_FRAME_POINTER)	+= unwind_frame.o
14011af8474SJosh Poimboeufobj-$(CONFIG_UNWINDER_GUESS)		+= unwind_guess.o
1417c7900f8SJosh Poimboeuf
142e759959fSBrijesh Singhobj-$(CONFIG_AMD_MEM_ENCRYPT)		+= sev.o
143aa5a4611STom Lendacky
1443c516f89SSami Tolvanenobj-$(CONFIG_CFI_CLANG)			+= cfi.o
1453c516f89SSami Tolvanen
1466b0c3d44SSam Ravnborg###
1476b0c3d44SSam Ravnborg# 64 bit specific files
1486b0c3d44SSam Ravnborgifeq ($(CONFIG_X86_64),y)
1496b0c3d44SSam Ravnborg	obj-$(CONFIG_AUDIT)		+= audit_64.o
1506b0c3d44SSam Ravnborg
151fffcda11SJoerg Roedel	obj-$(CONFIG_GART_IOMMU)	+= amd_gart_64.o aperture_64.o
152d39398a3SYinghai Lu
1538364e1f8SJan Kiszka	obj-$(CONFIG_MMCONF_FAM10H)	+= mmconf-fam10h_64.o
15470511134SRavikiran G Thirumalai	obj-y				+= vsmp_64.o
1556b0c3d44SSam Ravnborgendif
156