xref: /openbmc/linux/arch/powerpc/lib/Makefile (revision 0f4b20ef)
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_code-patching.o += -fno-stack-protector
9CFLAGS_feature-fixups.o += -fno-stack-protector
10
11CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE)
12CFLAGS_REMOVE_feature-fixups.o = $(CC_FLAGS_FTRACE)
13
14KASAN_SANITIZE_code-patching.o := n
15KASAN_SANITIZE_feature-fixups.o := n
16
17ifdef CONFIG_KASAN
18CFLAGS_code-patching.o += -DDISABLE_BRANCH_PROFILING
19CFLAGS_feature-fixups.o += -DDISABLE_BRANCH_PROFILING
20endif
21
22CFLAGS_code-patching.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
23CFLAGS_feature-fixups.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
24
25obj-y += alloc.o code-patching.o feature-fixups.o pmem.o
26
27obj-$(CONFIG_CODE_PATCHING_SELFTEST) += test-code-patching.o
28
29ifndef CONFIG_KASAN
30obj-y	+=	string.o memcmp_$(BITS).o
31obj-$(CONFIG_PPC32)	+= strlen_32.o
32endif
33
34obj-$(CONFIG_PPC32)	+= div64.o copy_32.o crtsavres.o
35
36obj-$(CONFIG_FUNCTION_ERROR_INJECTION)	+= error-inject.o
37
38# See corresponding test in arch/powerpc/Makefile
39# 64-bit linker creates .sfpr on demand for final link (vmlinux),
40# so it is only needed for modules, and only for older linkers which
41# do not support --save-restore-funcs
42ifeq ($(call ld-ifversion, -lt, 22500, y),y)
43extra-$(CONFIG_PPC64)	+= crtsavres.o
44endif
45
46obj-$(CONFIG_PPC_BOOK3S_64) += copyuser_power7.o copypage_power7.o \
47			       memcpy_power7.o restart_table.o
48
49obj64-y	+= copypage_64.o copyuser_64.o mem_64.o hweight_64.o \
50	   memcpy_64.o copy_mc_64.o
51
52ifndef CONFIG_PPC_QUEUED_SPINLOCKS
53obj64-$(CONFIG_SMP)	+= locks.o
54endif
55
56obj64-$(CONFIG_ALTIVEC)	+= vmx-helper.o
57obj64-$(CONFIG_KPROBES_SANITY_TEST)	+= test_emulate_step.o \
58					   test_emulate_step_exec_instr.o
59
60obj-y			+= checksum_$(BITS).o checksum_wrappers.o \
61			   string_$(BITS).o
62
63obj-y			+= sstep.o
64obj-$(CONFIG_PPC_FPU)	+= ldstfp.o
65obj64-y			+= quad.o
66
67obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
68
69obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o
70
71obj-$(CONFIG_ALTIVEC)	+= xor_vmx.o xor_vmx_glue.o
72CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec)
73# Enable <altivec.h>
74CFLAGS_xor_vmx.o += -isystem $(shell $(CC) -print-file-name=include)
75
76obj-$(CONFIG_PPC64) += $(obj64-y)
77