semihosting: Build stubs once

Move stubs to the global stub_ss[] source set. These files
are now built once for all binaries, instead of one time
per system binary.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260225035739.42848-12-philmd@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé
2026-02-24 17:26:54 +01:00
parent 2fa22ab7fe
commit 8adc13d0c5

View File

@@ -1,4 +1,4 @@
common_ss.add(when: 'CONFIG_SEMIHOSTING', if_false: files('stubs-all.c')) stub_ss.add(files('stubs-all.c'))
user_ss.add(when: 'CONFIG_SEMIHOSTING', if_true: files( user_ss.add(when: 'CONFIG_SEMIHOSTING', if_true: files(
'user.c', 'user.c',
'guestfd.c')) 'guestfd.c'))
@@ -8,12 +8,13 @@ system_ss.add(when: 'CONFIG_SEMIHOSTING', if_true: files(
'guestfd.c', 'guestfd.c',
'uaccess.c', 'uaccess.c',
'syscalls.c', 'syscalls.c',
), if_false: files( ))
stub_ss.add(files(
'stubs-system.c', 'stubs-system.c',
)) ))
system_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', system_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING',
if_true: files('arm-compat-semi.c'), if_true: files('arm-compat-semi.c'))
if_false: files('arm-compat-semi-stub.c')) stub_ss.add(files('arm-compat-semi-stub.c'))
specific_ss.add(when: ['CONFIG_SEMIHOSTING', 'CONFIG_USER_ONLY'], specific_ss.add(when: ['CONFIG_SEMIHOSTING', 'CONFIG_USER_ONLY'],
if_true: files('syscalls.c')) if_true: files('syscalls.c'))