xref: /openbmc/linux/arch/powerpc/lib/Makefile (revision 4ec575b7)
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
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
44obj64-$(CONFIG_SMP)	+= locks.o
45obj64-$(CONFIG_ALTIVEC)	+= vmx-helper.o
46obj64-$(CONFIG_KPROBES_SANITY_TEST)	+= test_emulate_step.o \
47					   test_emulate_step_exec_instr.o
48
49obj-y			+= checksum_$(BITS).o checksum_wrappers.o \
50			   string_$(BITS).o
51
52obj-y			+= sstep.o
53obj-$(CONFIG_PPC_FPU)	+= ldstfp.o
54obj64-y			+= quad.o
55
56obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
57
58obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o
59
60obj-$(CONFIG_ALTIVEC)	+= xor_vmx.o xor_vmx_glue.o
61CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec)
62
63obj-$(CONFIG_PPC64) += $(obj64-y)
64