public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: Use --strip-unneeded with INSTALL_MOD_STRIP
@ 2025-01-23  3:17 Charlie Jenkins
  2025-01-31  3:52 ` Nathan Chancellor
  0 siblings, 1 reply; 11+ messages in thread
From: Charlie Jenkins @ 2025-01-23  3:17 UTC (permalink / raw)
  To: Masahiro Yamada, Nathan Chancellor, Nicolas Schier, Paul Walmsley,
	Palmer Dabbelt, Albert Ou
  Cc: linux-kbuild, linux-kernel, linux-riscv, Charlie Jenkins

On riscv, kernel modules end up with a significant number of local
symbols. This becomes apparent when compiling modules with debug symbols
enabled. Using amdgpu.ko as an example of a large module, on riscv the
size is 754MB (no stripping), 53MB (--strip-debug), and 21MB
(--strip-unneeded). ON x86, amdgpu.ko is 482MB (no stripping), 21MB
(--strip-debug), and 20MB (--strip-unneeded).

Use --strip-unneeded instead of --strip-debug to strip modules so
decrease the size of the resulting modules. This is particularly
relevant for riscv, but also marginally aids other architectures.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
---
 scripts/Makefile.modinst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index f97c9926ed31b2b14601ff7773a2ea48b225628b..c22f35f6b9db3cac3923b9e787b219f752570642 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -80,7 +80,7 @@ quiet_cmd_install = INSTALL $@
 ifdef INSTALL_MOD_STRIP
 
 ifeq ($(INSTALL_MOD_STRIP),1)
-strip-option := --strip-debug
+strip-option := --strip-unneeded
 else
 strip-option := $(INSTALL_MOD_STRIP)
 endif

---
base-commit: ffd294d346d185b70e28b1a28abe367bbfe53c04
change-id: 20250122-strip_unneeded-cab729310056
-- 
- Charlie


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-04-21  6:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-23  3:17 [PATCH] kbuild: Use --strip-unneeded with INSTALL_MOD_STRIP Charlie Jenkins
2025-01-31  3:52 ` Nathan Chancellor
2025-01-31  6:54   ` Charlie Jenkins
2025-01-31 15:10     ` Masahiro Yamada
2025-01-31 21:33       ` Charlie Jenkins
2025-02-04  4:04         ` Masahiro Yamada
2025-02-04 18:29           ` Charlie Jenkins
2025-02-05 15:00             ` Masahiro Yamada
2025-04-03 15:07               ` Alexandre Ghiti
2025-04-21  6:06                 ` Alexandre Ghiti
2025-01-31 14:26   ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox