1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only 2fbe934d6SPalmer Dabbelt# 3fbe934d6SPalmer Dabbelt# Makefile for the RISC-V Linux kernel 4fbe934d6SPalmer Dabbelt# 5fbe934d6SPalmer Dabbelt 610626c32SAlan Kaoifdef CONFIG_FTRACE 767d94577SGuo RenCFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) 867d94577SGuo RenCFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE) 95ad84adfSGuo RenCFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE) 1010626c32SAlan Kaoendif 11a6a58ecfSNanyong SunCFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,) 1210626c32SAlan Kao 13fba8a867SNick Kossifidisifdef CONFIG_KEXEC 14030d6dbfSChangbin DuAFLAGS_kexec_relocate.o := -mcmodel=medany $(call cc-option,-mno-relax) 15fba8a867SNick Kossifidisendif 16fba8a867SNick Kossifidis 17a35707c3SHeiko Stuebner# cmodel=medany and notrace when patching early 18a35707c3SHeiko Stuebnerifdef CONFIG_RISCV_ALTERNATIVE_EARLY 19a35707c3SHeiko StuebnerCFLAGS_alternative.o := -mcmodel=medany 20a35707c3SHeiko StuebnerCFLAGS_cpufeature.o := -mcmodel=medany 21a35707c3SHeiko Stuebnerifdef CONFIG_FTRACE 22a35707c3SHeiko StuebnerCFLAGS_REMOVE_alternative.o = $(CC_FLAGS_FTRACE) 23a35707c3SHeiko StuebnerCFLAGS_REMOVE_cpufeature.o = $(CC_FLAGS_FTRACE) 24a35707c3SHeiko Stuebnerendif 25a35707c3SHeiko Stuebnerifdef CONFIG_KASAN 26a35707c3SHeiko StuebnerKASAN_SANITIZE_alternative.o := n 27a35707c3SHeiko StuebnerKASAN_SANITIZE_cpufeature.o := n 28a35707c3SHeiko Stuebnerendif 29a35707c3SHeiko Stuebnerendif 30a35707c3SHeiko Stuebner 31fbe934d6SPalmer Dabbeltextra-y += vmlinux.lds 32fbe934d6SPalmer Dabbelt 3332164845SMasahiro Yamadaobj-y += head.o 34335b1390SDamien Le Moalobj-y += soc.o 35e64f737aSHeiko Stuebnerobj-$(CONFIG_RISCV_ALTERNATIVE) += alternative.o 36fbe934d6SPalmer Dabbeltobj-y += cpu.o 37fbe934d6SPalmer Dabbeltobj-y += cpufeature.o 38fbe934d6SPalmer Dabbeltobj-y += entry.o 39fbe934d6SPalmer Dabbeltobj-y += irq.o 40fbe934d6SPalmer Dabbeltobj-y += process.o 41fbe934d6SPalmer Dabbeltobj-y += ptrace.o 42fbe934d6SPalmer Dabbeltobj-y += reset.o 43fbe934d6SPalmer Dabbeltobj-y += setup.o 44fbe934d6SPalmer Dabbeltobj-y += signal.o 45fbe934d6SPalmer Dabbeltobj-y += syscall_table.o 46fbe934d6SPalmer Dabbeltobj-y += sys_riscv.o 47fbe934d6SPalmer Dabbeltobj-y += time.o 48fbe934d6SPalmer Dabbeltobj-y += traps.o 49fbe934d6SPalmer Dabbeltobj-y += riscv_ksyms.o 50fbe934d6SPalmer Dabbeltobj-y += stacktrace.o 51fbe934d6SPalmer Dabbeltobj-y += cacheinfo.o 52043cb41aSZong Liobj-y += patch.o 53c22b0bcbSGuo Renobj-y += probes/ 546bd33e1eSChristoph Hellwigobj-$(CONFIG_MMU) += vdso.o vdso/ 55fbe934d6SPalmer Dabbelt 562bc3fc87SAnup Patelobj-$(CONFIG_RISCV_M_MODE) += traps_misaligned.o 579671f706SAlan Kaoobj-$(CONFIG_FPU) += fpu.o 58fbe934d6SPalmer Dabbeltobj-$(CONFIG_SMP) += smpboot.o 59fbe934d6SPalmer Dabbeltobj-$(CONFIG_SMP) += smp.o 602875fe05SAtish Patraobj-$(CONFIG_SMP) += cpu_ops.o 612ffc48fcSAtish Patra 622ffc48fcSAtish Patraobj-$(CONFIG_RISCV_BOOT_SPINWAIT) += cpu_ops_spinwait.o 63fbe934d6SPalmer Dabbeltobj-$(CONFIG_MODULES) += module.o 64ab1ef68eSZong Liobj-$(CONFIG_MODULE_SECTIONS) += module-sections.o 65c15ac4fdSAlan Kao 6663b13e64SAnup Patelobj-$(CONFIG_CPU_PM) += suspend_entry.o suspend.o 67*c0317210SSia Jee Hengobj-$(CONFIG_HIBERNATION) += hibernate.o hibernate-asm.o 6863b13e64SAnup Patel 69c15ac4fdSAlan Kaoobj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o 70c15ac4fdSAlan Kaoobj-$(CONFIG_DYNAMIC_FTRACE) += mcount-dyn.o 71fbe934d6SPalmer Dabbelt 7222e2100bSChangbin Duobj-$(CONFIG_TRACE_IRQFLAGS) += trace_irq.o 7322e2100bSChangbin Du 74dbeb90b0SMao Hanobj-$(CONFIG_PERF_EVENTS) += perf_callchain.o 7598a93b0bSMao Hanobj-$(CONFIG_HAVE_PERF_REGS) += perf_regs.o 763320648eSChristoph Hellwigobj-$(CONFIG_RISCV_SBI) += sbi.o 77cfafe260SAtish Patraifeq ($(CONFIG_RISCV_SBI), y) 78cfafe260SAtish Patraobj-$(CONFIG_SMP) += cpu_ops_sbi.o 79cfafe260SAtish Patraendif 80f1e58583SAtish Patraobj-$(CONFIG_HOTPLUG_CPU) += cpu-hotplug.o 81fe89bd2bSVincent Chenobj-$(CONFIG_KGDB) += kgdb.o 823a66a087SLi Zhengyuobj-$(CONFIG_KEXEC_CORE) += kexec_relocate.o crash_save_regs.o machine_kexec.o 836261586eSLiao Changobj-$(CONFIG_KEXEC_FILE) += elf_kexec.o machine_kexec_file.o 8456409750SNick Kossifidisobj-$(CONFIG_CRASH_DUMP) += crash_dump.o 85649d6b10SXianting Tianobj-$(CONFIG_CRASH_CORE) += crash_core.o 86178e9fc4SAlan Kao 87ebc00ddeSEmil Renner Berthingobj-$(CONFIG_JUMP_LABEL) += jump_label.o 88ebc00ddeSEmil Renner Berthing 89b91540d5SAtish Patraobj-$(CONFIG_EFI) += efi.o 9059c10c52SGuo Renobj-$(CONFIG_COMPAT) += compat_syscall_table.o 917383ee05SGuo Renobj-$(CONFIG_COMPAT) += compat_signal.o 920715372aSGuo Renobj-$(CONFIG_COMPAT) += compat_vdso/ 93