blob: 005c46a3d7e6387987232c3cbc068d134b6563ec [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 107c0964cb8db7ca28ac5199426414fdab3c274d Mon Sep 17 00:00:00 2001
2From: "Alexandros C. Couloumbis" <alex@ozo.com>
3Date: Fri, 7 Jul 2017 17:14:51 +0200
4Subject: hack: arch: powerpc: drop register save/restore library from modules
5
6Upstream GCC uses a libgcc function for saving/restoring registers. This
7makes the code bigger, and upstream kernels need to carry that function
8for every single kernel module. Our GCC is patched to avoid those
9references, so we can drop the extra bloat for modules.
10
11lede-commit: e8e1084654f50904e6bf77b70b2de3f137d7b3ec
12Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
13---
14 arch/powerpc/Makefile | 1 -
15 1 file changed, 1 deletion(-)
16
17--- a/arch/powerpc/Makefile
18+++ b/arch/powerpc/Makefile
19@@ -44,20 +44,6 @@ machine-$(CONFIG_PPC64) += 64
20 machine-$(CONFIG_CPU_LITTLE_ENDIAN) += le
21 UTS_MACHINE := $(subst $(space),,$(machine-y))
22
23-# XXX This needs to be before we override LD below
24-ifdef CONFIG_PPC32
25-KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
26-else
27-KBUILD_LDS_MODULE += $(srctree)/arch/powerpc/kernel/module.lds
28-ifeq ($(call ld-ifversion, -ge, 225000000, y),y)
29-# Have the linker provide sfpr if possible.
30-# There is a corresponding test in arch/powerpc/lib/Makefile
31-KBUILD_LDFLAGS_MODULE += --save-restore-funcs
32-else
33-KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
34-endif
35-endif
36-
37 ifdef CONFIG_CPU_LITTLE_ENDIAN
38 KBUILD_CFLAGS += -mlittle-endian
39 KBUILD_LDFLAGS += -EL