1# SPDX-License-Identifier: GPL-2.0 2# 3# Makefile for ppc-specific library files.. 4# 5 6CFLAGS_code-patching.o += -fno-stack-protector 7CFLAGS_feature-fixups.o += -fno-stack-protector 8 9CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE) 10CFLAGS_REMOVE_feature-fixups.o = $(CC_FLAGS_FTRACE) 11 12KASAN_SANITIZE_code-patching.o := n 13KASAN_SANITIZE_feature-fixups.o := n 14# restart_table.o contains functions called in the NMI interrupt path 15# which can be in real mode. Disable KASAN. 16KASAN_SANITIZE_restart_table.o := n 17KCSAN_SANITIZE_code-patching.o := n 18KCSAN_SANITIZE_feature-fixups.o := n 19 20ifdef CONFIG_KASAN 21CFLAGS_code-patching.o += -DDISABLE_BRANCH_PROFILING 22CFLAGS_feature-fixups.o += -DDISABLE_BRANCH_PROFILING 23endif 24 25CFLAGS_code-patching.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) 26CFLAGS_feature-fixups.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) 27 28obj-y += code-patching.o feature-fixups.o pmem.o 29 30obj-$(CONFIG_CODE_PATCHING_SELFTEST) += test-code-patching.o 31 32ifndef CONFIG_KASAN 33obj-y += string.o memcmp_$(BITS).o 34obj-$(CONFIG_PPC32) += strlen_32.o 35endif 36 37obj-$(CONFIG_PPC32) += div64.o copy_32.o crtsavres.o 38 39obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o 40 41# See corresponding test in arch/powerpc/Makefile 42# 64-bit linker creates .sfpr on demand for final link (vmlinux), 43# so it is only needed for modules, and only for older linkers which 44# do not support --save-restore-funcs 45ifndef CONFIG_LD_IS_BFD 46always-$(CONFIG_PPC64) += crtsavres.o 47endif 48 49obj-$(CONFIG_PPC_BOOK3S_64) += copyuser_power7.o copypage_power7.o \ 50 memcpy_power7.o restart_table.o 51 52obj64-y += copypage_64.o copyuser_64.o mem_64.o hweight_64.o \ 53 memcpy_64.o copy_mc_64.o 54 55ifdef CONFIG_PPC_QUEUED_SPINLOCKS 56obj-$(CONFIG_SMP) += qspinlock.o 57else 58obj64-$(CONFIG_SMP) += locks.o 59endif 60 61obj64-$(CONFIG_ALTIVEC) += vmx-helper.o 62obj64-$(CONFIG_KPROBES_SANITY_TEST) += test_emulate_step.o \ 63 test_emulate_step_exec_instr.o 64 65obj-y += checksum_$(BITS).o checksum_wrappers.o \ 66 string_$(BITS).o 67 68obj-y += sstep.o 69obj-$(CONFIG_PPC_FPU) += ldstfp.o 70obj64-y += quad.o 71 72obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o 73 74obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o 75 76obj-$(CONFIG_ALTIVEC) += xor_vmx.o xor_vmx_glue.o 77CFLAGS_xor_vmx.o += -mhard-float -maltivec $(call cc-option,-mabi=altivec) 78# Enable <altivec.h> 79CFLAGS_xor_vmx.o += -isystem $(shell $(CC) -print-file-name=include) 80 81obj-$(CONFIG_PPC64) += $(obj64-y) 82