blob: 6aef9ee28a3940dbf6754cd990df7f61ee4e7798 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +01002#
3# Makefile for the linux kernel.
4#
Sam Ravnborg88e4d252007-10-17 22:06:30 +02005
Luis R. Rodriguez8d152e72016-04-13 17:04:34 -07006extra-y := head_$(BITS).o
7extra-y += head$(BITS).o
Luis R. Rodriguezf2d85292016-04-13 17:04:43 -07008extra-y += ebda.o
Luis R. Rodriguez8d152e72016-04-13 17:04:34 -07009extra-y += platform-quirks.o
10extra-y += vmlinux.lds
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +010011
12CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
Ingo Molnare43eb7b2008-02-14 08:38:49 +010013
Steven Rostedt606576c2008-10-06 19:06:12 -040014ifdef CONFIG_FUNCTION_TRACER
Ingo Molnar34646bc2008-07-09 15:42:09 +020015# Do not profile debug and lowlevel utilities
Steven Rostedt89e1be52011-05-27 23:11:24 -040016CFLAGS_REMOVE_tsc.o = -pg
Jeremy Fitzhardinged5de8842008-07-23 13:28:58 -070017CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
Jeremy Fitzhardinge9ecd4e12010-09-22 17:07:27 -070018CFLAGS_REMOVE_pvclock.o = -pg
Steven Rostedt258af472010-09-22 22:22:25 -040019CFLAGS_REMOVE_kvmclock.o = -pg
Steven Rostedt15adc042008-10-23 09:33:08 -040020CFLAGS_REMOVE_ftrace.o = -pg
Ingo Molnar6cf87ef2008-11-04 10:42:23 +010021CFLAGS_REMOVE_early_printk.o = -pg
Kirill A. Shutemovbb43dbc2017-06-27 14:59:48 +030022CFLAGS_REMOVE_head64.o = -pg
Brijesh Singhe7599592021-04-27 06:16:34 -050023CFLAGS_REMOVE_sev.o = -pg
Tom Lendackyaa5a4612021-09-08 17:58:34 -050024CFLAGS_REMOVE_cc_platform.o = -pg
Steven Rostedt7fa09f22008-05-14 21:30:32 -040025endif
26
Josh Poimboeufc0dd6716862016-02-28 22:22:34 -060027KASAN_SANITIZE_head$(BITS).o := n
28KASAN_SANITIZE_dumpstack.o := n
29KASAN_SANITIZE_dumpstack_$(BITS).o := n
Andrey Ryabinin12a8cc72017-09-29 17:08:18 +030030KASAN_SANITIZE_stacktrace.o := n
31KASAN_SANITIZE_paravirt.o := n
Brijesh Singhe7599592021-04-27 06:16:34 -050032KASAN_SANITIZE_sev.o := n
Tom Lendackyaa5a4612021-09-08 17:58:34 -050033KASAN_SANITIZE_cc_platform.o := n
Josh Poimboeufc0dd6716862016-02-28 22:22:34 -060034
Marco Elver40d04112019-11-14 19:03:03 +010035# With some compiler versions the generated code results in boot hangs, caused
36# by several compilation units. To be safe, disable all instrumentation.
37KCSAN_SANITIZE := n
38
Josh Poimboeufc0dd6716862016-02-28 22:22:34 -060039OBJECT_FILES_NON_STANDARD_test_nx.o := y
Andrey Ryabininef7f0d62015-02-13 14:39:25 -080040
Josh Poimboeufe2ac83d2018-01-22 22:07:46 -060041ifdef CONFIG_FRAME_POINTER
42OBJECT_FILES_NON_STANDARD_ftrace_$(BITS).o := y
43endif
44
Dmitry Vyukov5c9a8752016-03-22 14:27:30 -070045# If instrumentation of this dir is enabled, boot hangs during first second.
46# Probably could be more selective here, but note that files related to irqs,
47# boot, dumpstack/stacktrace, etc are either non-interesting or can lead to
48# non-deterministic coverage.
49KCOV_INSTRUMENT := n
50
Arvind Sankar103a4902020-10-08 15:16:23 -040051CFLAGS_head$(BITS).o += -fno-stack-protector
Tom Lendackyaa5a4612021-09-08 17:58:34 -050052CFLAGS_cc_platform.o += -fno-stack-protector
Arvind Sankar103a4902020-10-08 15:16:23 -040053
Masahiro Yamada9cc342f2019-05-13 15:22:16 +090054CFLAGS_irq.o := -I $(srctree)/$(src)/../include/asm/trace
Steven Rostedt (Red Hat)83ab8512013-06-21 10:29:05 -040055
Ingo Molnar905a36a2015-06-03 13:37:36 +020056obj-y := process_$(BITS).o signal.o
Brian Gerstc0bfd262015-06-22 07:55:10 -040057obj-$(CONFIG_COMPAT) += signal_compat.o
Thomas Gleixnerd8ed9d42017-08-28 08:47:43 +020058obj-y += traps.o idt.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
Andy Lutomirskia5b9e5a2015-07-30 14:31:34 -070059obj-y += time.o ioport.o dumpstack.o nmi.o
60obj-$(CONFIG_MODIFY_LDT_SYSCALL) += ldt.o
Masahiro Yamadae9666d12018-12-31 00:14:15 +090061obj-y += setup.o x86_init.o i8259.o irqinit.o
62obj-$(CONFIG_JUMP_LABEL) += jump_label.o
Peter Zijlstrae360adb2010-10-14 14:01:34 +080063obj-$(CONFIG_IRQ_WORK) += irq_work.o
Dan Williams5d94e812011-03-08 10:36:19 -080064obj-y += probe_roms.o
Brian Gerst121b32a2020-03-13 15:51:41 -040065obj-$(CONFIG_X86_32) += sys_ia32.o
66obj-$(CONFIG_IA32_EMULATION) += sys_ia32.o
Steven Rostedt (VMware)1fa9d672017-03-23 10:33:53 -040067obj-$(CONFIG_X86_64) += sys_x86_64.o
H. Peter Anvin197725d2014-05-04 10:00:49 -070068obj-$(CONFIG_X86_ESPFIX64) += espfix_64.o
Dave Young5039e312013-12-20 18:02:21 +080069obj-$(CONFIG_SYSFS) += ksysfs.o
Yinghai Lu064d25f2008-06-16 19:58:28 -070070obj-y += bootflag.o e820.o
David Rientjes4061d682011-03-22 16:34:57 -070071obj-y += pci-dma.o quirks.o topology.o kdebugfs.o
Christoph Hellwigfec777c2018-03-19 11:38:15 +010072obj-y += alternative.o i8253.o hw_breakpoint.o
Bin Gao7da7c152013-10-21 09:16:33 -070073obj-y += tsc.o tsc_msr.o io_delay.o rtc.o
Konrad Rzeszutek Wilk5bef80a2010-08-26 13:57:58 -040074obj-y += pci-iommu_table.o
Bjorn Helgaas30919b02010-12-16 10:38:51 -070075obj-y += resource.o
Nick Desaulniersd0a8d932018-06-21 09:23:24 -070076obj-y += irqflags.o
Josh Poimboeufe6d6c072020-08-18 15:57:44 +020077obj-y += static_call.o
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +010078
Suresh Siddha61c46282008-03-10 15:28:04 -070079obj-y += process.o
Ingo Molnarce4c4c22015-04-22 10:39:11 +020080obj-y += fpu/
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +010081obj-y += ptrace.o
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +010082obj-$(CONFIG_X86_32) += tls.o
83obj-$(CONFIG_IA32_EMULATION) += tls.o
84obj-y += step.o
Joseph Cihula31625342009-06-30 19:30:59 -070085obj-$(CONFIG_INTEL_TXT) += tboot.o
David Rientjes4061d682011-03-22 16:34:57 -070086obj-$(CONFIG_ISA_DMA_API) += i8237.o
Peter Zijlstra1614b2b2021-11-29 14:28:41 +000087obj-y += stacktrace.o
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +010088obj-y += cpu/
89obj-y += acpi/
Ingo Molnarf095df02009-01-27 17:17:55 +010090obj-y += reboot.o
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +010091obj-$(CONFIG_X86_MSR) += msr.o
92obj-$(CONFIG_X86_CPUID) += cpuid.o
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +010093obj-$(CONFIG_PCI) += early-quirks.o
Sam Ravnborg3a900d82008-02-04 16:47:55 +010094apm-y := apm_32.o
95obj-$(CONFIG_APM) += apm.o
Ingo Molnar3e5095d2009-01-27 17:07:08 +010096obj-$(CONFIG_SMP) += smp.o
Henrik Kretzschmarec8df882011-03-11 08:02:35 +010097obj-$(CONFIG_SMP) += smpboot.o
Thomas Gleixner8b223bc2016-11-19 13:47:36 +000098obj-$(CONFIG_X86_TSC) += tsc_sync.o
Brian Gerst996db812009-01-27 12:56:47 +090099obj-$(CONFIG_SMP) += setup_percpu.o
Alexey Starikovskiy85bddde2008-04-04 23:43:18 +0400100obj-$(CONFIG_X86_MPPARSE) += mpparse.o
Ingo Molnar9be1b562009-02-17 23:12:48 +0100101obj-y += apic/
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +0100102obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o
Steven Rostedt3d083392008-05-12 21:20:42 +0200103obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
Steven Rostedt (VMware)1fa9d672017-03-23 10:33:53 -0400104obj-$(CONFIG_FUNCTION_TRACER) += ftrace_$(BITS).o
Ingo Molnarccd50df2009-03-13 17:02:17 +0100105obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
106obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o
David Sharp8cbd9cc2012-11-13 12:18:21 -0800107obj-$(CONFIG_X86_TSC) += trace_clock.o
Daniel Bristot de Oliveirabce29ac2021-06-22 16:42:27 +0200108obj-$(CONFIG_TRACING) += trace.o
Omar Sandoval8757dc92019-12-20 08:22:49 -0800109obj-$(CONFIG_CRASH_CORE) += crash_core_$(BITS).o
Dave Young2965faa2015-09-09 15:38:55 -0700110obj-$(CONFIG_KEXEC_CORE) += machine_kexec_$(BITS).o
111obj-$(CONFIG_KEXEC_CORE) += relocate_kernel_$(BITS).o crash.o
Vivek Goyal74ca3172014-08-29 15:18:46 -0700112obj-$(CONFIG_KEXEC_FILE) += kexec-bzimage64.o
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +0100113obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o
Masami Hiramatsuf6841992012-09-28 17:15:22 +0900114obj-y += kprobes/
Amerigo Wang0fdc83b2009-06-03 21:46:19 -0400115obj-$(CONFIG_MODULES) += module.o
Borislav Petkov59330942020-04-04 01:33:05 +0200116obj-$(CONFIG_X86_32) += doublefault_32.o
Ingo Molnar82da3ff2008-04-17 20:05:37 +0200117obj-$(CONFIG_KGDB) += kgdb.o
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +0100118obj-$(CONFIG_VM86) += vm86_32.o
119obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
120
121obj-$(CONFIG_HPET_TIMER) += hpet.o
122
Andreas Herrmann23ac4ae2010-09-17 18:03:43 +0200123obj-$(CONFIG_AMD_NB) += amd_nb.o
Don Zickus99e8b9c2011-10-13 15:14:26 -0400124obj-$(CONFIG_DEBUG_NMI_SELFTEST) += nmi_selftest.o
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +0100125
Marcelo Tosatti90993cd2012-08-16 17:00:19 -0300126obj-$(CONFIG_KVM_GUEST) += kvm.o kvmclock.o
Juergen Gross054ac8a2021-03-11 15:23:19 +0100127obj-$(CONFIG_PARAVIRT) += paravirt.o
Jeremy Fitzhardingeb4ecc122009-05-13 17:16:55 -0700128obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= paravirt-spinlocks.o
Gerd Hoffmann7af192c2008-06-03 16:17:29 +0200129obj-$(CONFIG_PARAVIRT_CLOCK) += pvclock.o
Dan Williams7a678322015-08-19 00:34:34 -0400130obj-$(CONFIG_X86_PMEM_LEGACY_DEVICE) += pmem.o
Michael Opdenacker67926892008-01-30 13:33:18 +0100131
Jan Kiszka4a362602017-11-27 09:11:46 +0100132obj-$(CONFIG_JAILHOUSE_GUEST) += jailhouse.o
133
Thomas Gleixnerf7eaf6e2017-08-28 08:47:20 +0200134obj-$(CONFIG_EISA) += eisa.o
Stas Sergeeve5e1d3c2008-05-07 12:39:56 +0200135obj-$(CONFIG_PCSPKR_PLATFORM) += pcspeaker.o
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +0100136
Arjan van de Venb43d1962008-10-05 12:21:32 -0700137obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o
138
Ian Campbellb041cf22009-01-23 10:56:16 +0000139obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o
Sebastian Andrzej Siewiorda6b7372011-02-22 21:07:37 +0100140obj-$(CONFIG_OF) += devicetree.o
Srikar Dronamraju2b144492012-02-09 14:56:42 +0530141obj-$(CONFIG_UPROBES) += uprobes.o
Jeremy Fitzhardingecfb80c92008-12-16 12:17:36 -0800142
Jiri Olsac5e63192012-08-07 15:20:36 +0200143obj-$(CONFIG_PERF_EVENTS) += perf_regs.o
Seiji Aguchicf910e82013-06-20 11:46:53 -0400144obj-$(CONFIG_TRACING) += tracepoint.o
Tim Chende966cf2016-11-29 10:43:27 -0800145obj-$(CONFIG_SCHED_MC_PRIO) += itmt.o
Babu Mogerb9718802019-11-05 21:25:32 +0000146obj-$(CONFIG_X86_UMIP) += umip.o
Jiri Olsac5e63192012-08-07 15:20:36 +0200147
Josh Poimboeuf11af8472017-10-13 15:02:00 -0500148obj-$(CONFIG_UNWINDER_ORC) += unwind_orc.o
149obj-$(CONFIG_UNWINDER_FRAME_POINTER) += unwind_frame.o
150obj-$(CONFIG_UNWINDER_GUESS) += unwind_guess.o
Josh Poimboeuf7c7900f2016-09-16 14:18:12 -0500151
Brijesh Singhe7599592021-04-27 06:16:34 -0500152obj-$(CONFIG_AMD_MEM_ENCRYPT) += sev.o
Tom Lendackyaa5a4612021-09-08 17:58:34 -0500153
154obj-$(CONFIG_ARCH_HAS_CC_PLATFORM) += cc_platform.o
155
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +0100156###
157# 64 bit specific files
158ifeq ($(CONFIG_X86_64),y)
Ingo Molnarf62bae52009-02-17 18:09:24 +0100159 obj-$(CONFIG_AUDIT) += audit_64.o
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +0100160
Joerg Roedelfffcda12011-05-10 17:22:06 +0200161 obj-$(CONFIG_GART_IOMMU) += amd_gart_64.o aperture_64.o
Yinghai Lud39398a2008-02-26 11:04:17 -0800162
Jan Kiszka8364e1f2018-03-07 08:39:17 +0100163 obj-$(CONFIG_MMCONF_FAM10H) += mmconf-fam10h_64.o
Ravikiran G Thirumalai70511132009-03-23 23:14:29 -0700164 obj-y += vsmp_64.o
Sam Ravnborg6b0c3d42008-01-30 13:32:27 +0100165endif