1 # SPDX-License-Identifier: GPL-2.0
3 # Makefile for ppc-specific library files..
6 ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
8 CFLAGS_code-patching.o += -fno-stack-protector
9 CFLAGS_feature-fixups.o += -fno-stack-protector
11 CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE)
12 CFLAGS_REMOVE_feature-fixups.o = $(CC_FLAGS_FTRACE)
14 KASAN_SANITIZE_code-patching.o := n
15 KASAN_SANITIZE_feature-fixups.o := n
18 CFLAGS_code-patching.o += -DDISABLE_BRANCH_PROFILING
19 CFLAGS_feature-fixups.o += -DDISABLE_BRANCH_PROFILING
22 CFLAGS_code-patching.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
23 CFLAGS_feature-fixups.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
25 obj-y += alloc.o code-patching.o feature-fixups.o pmem.o inst.o test_code-patching.o
28 obj-y += string.o memcmp_$(BITS).o
29 obj-$(CONFIG_PPC32) += strlen_32.o
32 obj-$(CONFIG_PPC32) += div64.o copy_32.o crtsavres.o
34 obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
36 # See corresponding test in arch/powerpc/Makefile
37 # 64-bit linker creates .sfpr on demand for final link (vmlinux),
38 # so it is only needed for modules, and only for older linkers which
39 # do not support --save-restore-funcs
40 ifeq ($(call ld-ifversion, -lt, 225000000, y),y)
41 always-$(CONFIG_PPC64) += crtsavres.o
44 obj-$(CONFIG_PPC_BOOK3S_64) += copyuser_power7.o copypage_power7.o \
47 obj64-y += copypage_64.o copyuser_64.o mem_64.o hweight_64.o \
48 memcpy_64.o copy_mc_64.o
50 ifndef CONFIG_PPC_QUEUED_SPINLOCKS
51 obj64-$(CONFIG_SMP) += locks.o
54 obj64-$(CONFIG_ALTIVEC) += vmx-helper.o
55 obj64-$(CONFIG_KPROBES_SANITY_TEST) += test_emulate_step.o \
56 test_emulate_step_exec_instr.o
58 obj-y += checksum_$(BITS).o checksum_wrappers.o \
62 obj-$(CONFIG_PPC_FPU) += ldstfp.o
65 obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
67 obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o
69 obj-$(CONFIG_ALTIVEC) += xor_vmx.o xor_vmx_glue.o
70 CFLAGS_xor_vmx.o += -mhard-float -maltivec $(call cc-option,-mabi=altivec)
72 obj-$(CONFIG_PPC64) += $(obj64-y)