xref: /openbmc/linux/arch/s390/kernel/Makefile (revision ba61bb17)
1# SPDX-License-Identifier: GPL-2.0
2#
3# Makefile for the linux kernel.
4#
5
6ifdef CONFIG_FUNCTION_TRACER
7
8# Do not trace tracer code
9CFLAGS_REMOVE_ftrace.o		= $(CC_FLAGS_FTRACE)
10
11# Do not trace early setup code
12CFLAGS_REMOVE_als.o		= $(CC_FLAGS_FTRACE)
13CFLAGS_REMOVE_early.o		= $(CC_FLAGS_FTRACE)
14CFLAGS_REMOVE_early_nobss.o	= $(CC_FLAGS_FTRACE)
15
16endif
17
18GCOV_PROFILE_als.o		:= n
19GCOV_PROFILE_early.o		:= n
20GCOV_PROFILE_early_nobss.o	:= n
21
22KCOV_INSTRUMENT_als.o		:= n
23KCOV_INSTRUMENT_early.o		:= n
24KCOV_INSTRUMENT_early_nobss.o	:= n
25
26UBSAN_SANITIZE_als.o		:= n
27UBSAN_SANITIZE_early.o		:= n
28UBSAN_SANITIZE_early_nobss.o	:= n
29
30#
31# Use -march=z900 for als.c to be able to print an error
32# message if the kernel is started on a machine which is too old
33#
34ifneq ($(CC_FLAGS_MARCH),-march=z900)
35CFLAGS_REMOVE_als.o	+= $(CC_FLAGS_MARCH)
36CFLAGS_REMOVE_als.o	+= $(CC_FLAGS_EXPOLINE)
37CFLAGS_als.o		+= -march=z900
38AFLAGS_REMOVE_head.o	+= $(CC_FLAGS_MARCH)
39AFLAGS_head.o		+= -march=z900
40endif
41
42CFLAGS_als.o		+= -D__NO_FORTIFY
43
44#
45# Passing null pointers is ok for smp code, since we access the lowcore here.
46#
47CFLAGS_smp.o		:= -Wno-nonnull
48
49#
50# Disable tailcall optimizations for stack / callchain walking functions
51# since this might generate broken code when accessing register 15 and
52# passing its content to other functions.
53#
54CFLAGS_stacktrace.o	+= -fno-optimize-sibling-calls
55CFLAGS_dumpstack.o	+= -fno-optimize-sibling-calls
56
57#
58# Pass UTS_MACHINE for user_regset definition
59#
60CFLAGS_ptrace.o		+= -DUTS_MACHINE='"$(UTS_MACHINE)"'
61
62obj-y	:= traps.o time.o process.o base.o early.o setup.o idle.o vtime.o
63obj-y	+= processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o
64obj-y	+= debug.o irq.o ipl.o dis.o diag.o vdso.o als.o early_nobss.o
65obj-y	+= sysinfo.o jump_label.o lgr.o os_info.o machine_kexec.o pgm_check.o
66obj-y	+= runtime_instr.o cache.o fpu.o dumpstack.o guarded_storage.o sthyi.o
67obj-y	+= entry.o reipl.o relocate_kernel.o kdebugfs.o alternative.o
68obj-y	+= nospec-branch.o
69
70extra-y				+= head.o head64.o vmlinux.lds
71
72obj-$(CONFIG_SYSFS)		+= nospec-sysfs.o
73CFLAGS_REMOVE_nospec-branch.o	+= $(CC_FLAGS_EXPOLINE)
74
75obj-$(CONFIG_MODULES)		+= module.o
76obj-$(CONFIG_SMP)		+= smp.o
77obj-$(CONFIG_SCHED_TOPOLOGY)	+= topology.o
78obj-$(CONFIG_HIBERNATION)	+= suspend.o swsusp.o
79obj-$(CONFIG_AUDIT)		+= audit.o
80compat-obj-$(CONFIG_AUDIT)	+= compat_audit.o
81obj-$(CONFIG_COMPAT)		+= compat_linux.o compat_signal.o
82obj-$(CONFIG_COMPAT)		+= compat_wrapper.o $(compat-obj-y)
83obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
84obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
85obj-$(CONFIG_KPROBES)		+= kprobes.o
86obj-$(CONFIG_FUNCTION_TRACER)	+= mcount.o ftrace.o
87obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
88obj-$(CONFIG_UPROBES)		+= uprobes.o
89
90obj-$(CONFIG_KEXEC_FILE)	+= machine_kexec_file.o kexec_image.o
91obj-$(CONFIG_KEXEC_FILE)	+= kexec_elf.o
92
93obj-$(CONFIG_PERF_EVENTS)	+= perf_event.o perf_cpum_cf.o perf_cpum_sf.o
94obj-$(CONFIG_PERF_EVENTS)	+= perf_cpum_cf_events.o perf_regs.o
95
96obj-$(CONFIG_TRACEPOINTS)	+= trace.o
97
98# vdso
99obj-y				+= vdso64/
100obj-$(CONFIG_COMPAT)		+= vdso32/
101
102chkbss := head.o head64.o als.o early_nobss.o
103include $(srctree)/arch/s390/scripts/Makefile.chkbss
104