blob: be8007f367aabe7764beb7d9894286ab498d47b1 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#
3# Makefile for the linux kernel.
4#
5
Heiko Carstens5d360a72008-12-25 13:38:56 +01006ifdef CONFIG_FUNCTION_TRACER
Heiko Carstens82897ed2016-12-07 10:38:36 +01007
8# Do not trace tracer code
Heiko Carstens971a9ca2018-05-04 13:22:12 +02009CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
Heiko Carstens82897ed2016-12-07 10:38:36 +010010
11# Do not trace early setup code
Heiko Carstens971a9ca2018-05-04 13:22:12 +020012CFLAGS_REMOVE_early.o = $(CC_FLAGS_FTRACE)
Heiko Carstens82897ed2016-12-07 10:38:36 +010013
14endif
15
Heiko Carstens971a9ca2018-05-04 13:22:12 +020016GCOV_PROFILE_early.o := n
Heiko Carstens971a9ca2018-05-04 13:22:12 +020017KCOV_INSTRUMENT_early.o := n
Heiko Carstens971a9ca2018-05-04 13:22:12 +020018UBSAN_SANITIZE_early.o := n
Vasily Gorbikac1256f2017-11-20 12:15:10 +010019KASAN_SANITIZE_ipl.o := n
20KASAN_SANITIZE_machine_kexec.o := n
Vasily Gorbik0a9b4092017-11-17 13:10:33 +010021
Heiko Carstens82897ed2016-12-07 10:38:36 +010022#
Heiko Carstens98c7b382008-03-05 12:37:09 +010023# Passing null pointers is ok for smp code, since we access the lowcore here.
24#
Heiko Carstens82897ed2016-12-07 10:38:36 +010025CFLAGS_smp.o := -Wno-nonnull
Heiko Carstens98c7b382008-03-05 12:37:09 +010026
Martin Schwidefsky63506c42008-07-14 09:58:54 +020027#
Heiko Carstens1bca09f2013-03-14 13:44:25 +010028# Disable tailcall optimizations for stack / callchain walking functions
29# since this might generate broken code when accessing register 15 and
30# passing its content to other functions.
31#
32CFLAGS_stacktrace.o += -fno-optimize-sibling-calls
33CFLAGS_dumpstack.o += -fno-optimize-sibling-calls
Martin Schwidefsky78c98f92019-01-28 08:33:08 +010034CFLAGS_unwind_bc.o += -fno-optimize-sibling-calls
Heiko Carstens1bca09f2013-03-14 13:44:25 +010035
Martin Schwidefskyb5f87f12014-10-01 10:57:57 +020036obj-y := traps.o time.o process.o base.o early.o setup.o idle.o vtime.o
Sven Schnelle56e62a72020-11-21 11:14:56 +010037obj-y += processor.o syscall.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o
Vasily Gorbik2e83e0e2019-08-11 20:55:18 +020038obj-y += debug.o irq.o ipl.o dis.o diag.o vdso.o
Heiko Carstens6f8daa22021-04-07 21:06:41 +020039obj-y += sysinfo.o lgr.o os_info.o machine_kexec.o
QingFeng Haob7c92f12017-09-29 12:41:50 +020040obj-y += runtime_instr.o cache.o fpu.o dumpstack.o guarded_storage.o sthyi.o
Heiko Carstens049a2c22017-11-14 15:20:24 +010041obj-y += entry.o reipl.o relocate_kernel.o kdebugfs.o alternative.o
Martin Schwidefsky78c98f92019-01-28 08:33:08 +010042obj-y += nospec-branch.o ipl_vmparm.o machine_kexec_reloc.o unwind_bc.o
Peter Zijlstra1614b2b2021-11-29 14:28:41 +000043obj-y += smp.o text_amode31.o stacktrace.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070044
Vasily Gorbik8282cd62018-06-12 15:11:40 +020045extra-y += head64.o vmlinux.lds
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
Martin Schwidefsky4253b0e2018-04-24 08:23:54 +020047obj-$(CONFIG_SYSFS) += nospec-sysfs.o
Martin Schwidefskyb2e2f432018-03-23 17:09:39 +010048CFLAGS_REMOVE_nospec-branch.o += $(CC_FLAGS_EXPOLINE)
Martin Schwidefskyf19fbd52018-01-26 12:46:47 +010049
Al Viro711f5df2016-01-12 13:30:03 -050050obj-$(CONFIG_MODULES) += module.o
Heiko Carstens9236b4d2015-12-28 13:20:43 +010051obj-$(CONFIG_SCHED_TOPOLOGY) += topology.o
Alexander Gordeevb450eeb2020-08-04 20:35:50 +020052obj-$(CONFIG_NUMA) += numa.o
Al Viroc0803792006-08-31 19:02:42 -040053obj-$(CONFIG_AUDIT) += audit.o
54compat-obj-$(CONFIG_AUDIT) += compat_audit.o
Heiko Carstensfa2a0622014-03-06 11:24:41 +010055obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o
Arnd Bergmann90856082019-01-16 14:15:23 +010056obj-$(CONFIG_COMPAT) += $(compat-obj-y)
Heiko Carstens89175cf2017-01-11 09:14:52 +010057obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
Michael Grundy4ba069b2006-09-20 15:58:39 +020058obj-$(CONFIG_KPROBES) += kprobes.o
Heiko Carstensb61e1f32020-09-18 10:26:19 +020059obj-$(CONFIG_KPROBES) += kprobes_insn_page.o
Heiko Carstens53255c92014-10-07 15:45:10 +020060obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o
Michael Holzheu60a0c682011-10-30 15:16:40 +010061obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
Jan Willeke2a0a5b22014-09-22 16:39:06 +020062obj-$(CONFIG_UPROBES) += uprobes.o
Masahiro Yamadae9666d12018-12-31 00:14:15 +090063obj-$(CONFIG_JUMP_LABEL) += jump_label.o
Heiko Carstens305e4f12012-09-14 12:57:39 +020064
Philipp Rudoe49bb0a2017-08-30 14:03:38 +020065obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o
Philipp Rudo8be01882017-09-11 15:15:29 +020066obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o
Philipp Rudo71406882017-06-19 10:45:33 +020067
Nayna Jain9e2b4be2020-03-08 20:57:51 -040068obj-$(CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT) += ima_arch.o
Philipp Rudo268a7842019-03-26 15:45:53 +010069
Hendrik Brueckner7f5ac1a2018-10-25 17:26:34 +020070obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_cpum_cf_common.o
71obj-$(CONFIG_PERF_EVENTS) += perf_cpum_cf.o perf_cpum_sf.o
Heiko Carstensc33eff62015-06-06 12:44:25 +020072obj-$(CONFIG_PERF_EVENTS) += perf_cpum_cf_events.o perf_regs.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
Martin Schwidefskyb5a6b712015-08-21 16:05:32 +020074obj-$(CONFIG_TRACEPOINTS) += trace.o
Vasily Gorbikecdc5d82019-10-23 13:56:36 +020075obj-$(findstring y, $(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) $(CONFIG_PGSTE)) += uv.o
Martin Schwidefskyb5a6b712015-08-21 16:05:32 +020076
Martin Schwidefskyb0206322008-12-25 13:38:36 +010077# vdso
Heiko Carstens5a79859a2015-02-12 13:08:27 +010078obj-y += vdso64/
Sven Schnelle779df222021-06-25 14:50:08 +020079obj-$(CONFIG_COMPAT) += vdso32/