[PATCH v2 3/8] scripts/Makefile.asm-headers: pass USED_SYSCALLS to syscalltbl.sh

From: Yuan Tan

Date: Wed Oct 15 2025 - 02:18:25 EST


From: Yuhang Zheng <z1652074432@xxxxxxxxx>

Include auto.conf in asm-headers and pass CONFIG_USED_SYSCALLS to
syscalltbl.sh when CONFIG_TRIM_UNUSED_SYSCALLS is enabled.

Signed-off-by: Yuhang Zheng <z1652074432@xxxxxxxxx>
Signed-off-by: Yuan Tan <tanyuan@xxxxxxxxxxx>
Signed-off-by: Zhangjin Wu <falcon@xxxxxxxxxxx>
---
scripts/Makefile.asm-headers | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/scripts/Makefile.asm-headers b/scripts/Makefile.asm-headers
index 8a4856e74180..0ae82c6a2a15 100644
--- a/scripts/Makefile.asm-headers
+++ b/scripts/Makefile.asm-headers
@@ -13,6 +13,8 @@
PHONY := all
all:

+include $(objtree)/include/config/auto.conf
+
src := $(srctree)/$(subst /generated,,$(obj))

syscall_abis_32 += common,32
@@ -68,6 +70,8 @@ quiet_cmd_systbl = SYSTBL $@
cmd_systbl = $(CONFIG_SHELL) $(systbl) \
$(if $(systbl-args-$*),$(systbl-args-$*),$(systbl-args)) \
--abis $(subst $(space),$(comma),$(strip $(syscall_abis_$*))) \
+ $(if $(CONFIG_TRIM_UNUSED_SYSCALLS), \
+ --used-syscalls=$(subst $(space),$(comma),$(strip $(CONFIG_USED_SYSCALLS)))) \
$< $@

all: $(generic-y) $(syscall-y)
--
2.43.0