diff mbox series

kbuild: scripts/Makefile.modinst discard-locals from modules on riscv

Message ID 20220330131139.401658-1-dimitri.ledkov@canonical.com (mailing list archive)
State New, archived
Headers show
Series kbuild: scripts/Makefile.modinst discard-locals from modules on riscv | expand

Commit Message

Dimitri John Ledkov March 30, 2022, 1:11 p.m. UTC
On riscv, GNU toolchain generated ~800MB+ of local symbols in .ko
files on riscv. When stripping .ko on riscv, discard these local
symbols by default to make .ko module sizes comparable to other
architectures.

This patch is tested on SiFive Unmatched and is shipped in
Ubuntu. This can be revisited once improved GNU toolchain becomes
available and is used.

Link: https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1036

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
---
 scripts/Makefile.modinst | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index c2c43a0ecfe0..fc8fc19ed754 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -46,7 +46,11 @@  quiet_cmd_install = INSTALL $@
 ifdef INSTALL_MOD_STRIP
 
 ifeq ($(INSTALL_MOD_STRIP),1)
+ifeq ($(ARCH),riscv)
+strip-option := --strip-debug --discard-locals
+else
 strip-option := --strip-debug
+endif
 else
 strip-option := $(INSTALL_MOD_STRIP)
 endif