From c07cb292d271e3cb0ac18538d7c035eb8bf4c362 Mon Sep 17 00:00:00 2001 From: Wentao Guan Date: Wed, 27 May 2026 04:32:49 +0800 Subject: [PATCH] kbuild: try readelf first in gen_symversions deepin inclusion category: performance Instead of nm, readelf is more faster, and significantly improve build speed when enable CONFIG_GENKSYMS. Signed-off-by: Wentao Guan --- scripts/Makefile.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index b897c78067112..381d99bdbdd2b 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -171,7 +171,7 @@ ifdef CONFIG_MODVERSIONS # be compiled and linked to the kernel and/or modules. gen_symversions = \ - if $(NM) $@ 2>/dev/null | grep -q ' __export_symbol_'; then \ + if $(READELF) -sW $@ 2>/dev/null | grep -q '__export_symbol_'; then \ $(call cmd_gensymtypes_$(1),$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ >> $(dot-target).cmd; \ fi