xref: /openbmc/linux/arch/powerpc/lib/Makefile (revision 29c37341)
1# SPDX-License-Identifier: GPL-2.0
2#
3# Makefile for ppc-specific library files..
4#
5
6ccflags-$(CONFIG_PPC64)	:= $(NO_MINIMAL_TOC)
7
8CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE)
9CFLAGS_REMOVE_feature-fixups.o = $(CC_FLAGS_FTRACE)
10
11KASAN_SANITIZE_code-patching.o := n
12KASAN_SANITIZE_feature-fixups.o := n
13
14ifdef CONFIG_KASAN
15CFLAGS_code-patching.o += -DDISABLE_BRANCH_PROFILING
16CFLAGS_feature-fixups.o += -DDISABLE_BRANCH_PROFILING
17endif
18
19obj-y += alloc.o code-patching.o feature-fixups.o pmem.o inst.o test_code-patching.o
20
21ifndef CONFIG_KASAN
22obj-y	+=	string.o memcmp_$(BITS).o
23obj-$(CONFIG_PPC32)	+= strlen_32.o
24endif
25
26obj-$(CONFIG_PPC32)	+= div64.o copy_32.o crtsavres.o
27
28obj-$(CONFIG_FUNCTION_ERROR_INJECTION)	+= error-inject.o
29
30# See corresponding test in arch/powerpc/Makefile
31# 64-bit linker creates .sfpr on demand for final link (vmlinux),
32# so it is only needed for modules, and only for older linkers which
33# do not support --save-restore-funcs
34ifeq ($(call ld-ifversion, -lt, 225000000, y),y)
35extra-$(CONFIG_PPC64)	+= crtsavres.o
36endif
37
38obj-$(CONFIG_PPC_BOOK3S_64) += copyuser_power7.o copypage_power7.o \
39			       memcpy_power7.o
40
41obj64-y	+= copypage_64.o copyuser_64.o mem_64.o hweight_64.o \
42	   memcpy_64.o memcpy_mcsafe_64.o
43
44ifndef CONFIG_PPC_QUEUED_SPINLOCKS
45obj64-$(CONFIG_SMP)	+= locks.o
46endif
47
48obj64-$(CONFIG_ALTIVEC)	+= vmx-helper.o
49obj64-$(CONFIG_KPROBES_SANITY_TEST)	+= test_emulate_step.o \
50					   test_emulate_step_exec_instr.o
51
52obj-y			+= checksum_$(BITS).o checksum_wrappers.o \
53			   string_$(BITS).o
54
55obj-y			+= sstep.o
56obj-$(CONFIG_PPC_FPU)	+= ldstfp.o
57obj64-y			+= quad.o
58
59obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
60
61obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o
62
63obj-$(CONFIG_ALTIVEC)	+= xor_vmx.o xor_vmx_glue.o
64CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec)
65
66obj-$(CONFIG_PPC64) += $(obj64-y)
67