[PATCH v2 42/50] target/or1k: Build 'gdbstub.c' once for system single binary

Philippe Mathieu-Daudé posted 50 patches 1 month ago
Maintainers: Laurent Vivier <laurent@vivier.eu>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, "Dr. David Alan Gilbert" <dave@treblig.org>, Richard Henderson <richard.henderson@linaro.org>, Brian Cain <brian.cain@oss.qualcomm.com>, Paolo Bonzini <pbonzini@redhat.com>, Song Gao <gaosong@loongson.cn>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <arikalo@gmail.com>, Stafford Horne <shorne@gmail.com>, Nicholas Piggin <npiggin@gmail.com>, Chinmay Rath <rathc@linux.ibm.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Yoshinori Sato <yoshinori.sato@nifty.com>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Thomas Huth <thuth@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>, Bastian Koppelmann <kbastian@rumtueddeln.de>
[PATCH v2 42/50] target/or1k: Build 'gdbstub.c' once for system single binary
Posted by Philippe Mathieu-Daudé 1 month ago
There is a single qemu-system-or1k binary, but by moving
'gdbstub.c' in the target_common_system_arch[] source set
the resulting object can be linked into a single qemu-sytem
binary.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/or1k/meson.build | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/target/or1k/meson.build b/target/or1k/meson.build
index cc912ee6cf9..7cea45287a2 100644
--- a/target/or1k/meson.build
+++ b/target/or1k/meson.build
@@ -8,18 +8,25 @@ or1k_ss.add(files(
   'exception.c',
   'exception_helper.c',
   'fpu_helper.c',
-  'gdbstub.c',
   'interrupt_helper.c',
   'sys_helper.c',
   'translate.c',
 ))
 
+or1k_user_ss = ss.source_set()
+or1k_user_ss.add(files('gdbstub.c'))
+
 or1k_common_system_ss = ss.source_set()
-or1k_common_system_ss.add(files(
+or1k_common_system_ss.add(files('gdbstub.c'))
+
+or1k_system_ss = ss.source_set()
+or1k_system_ss.add(files(
   'interrupt.c',
   'machine.c',
   'mmu.c',
 ))
 
 target_arch += {'or1k': or1k_ss}
+target_user_arch += {'or1k': or1k_user_ss}
+target_system_arch += {'or1k': or1k_system_ss}
 target_common_system_arch += {'or1k': or1k_common_system_ss}
-- 
2.52.0


Re: [PATCH v2 42/50] target/or1k: Build 'gdbstub.c' once for system single binary
Posted by Pierrick Bouvier 1 month ago
On 2/19/26 11:19 AM, Philippe Mathieu-Daudé wrote:
> There is a single qemu-system-or1k binary, but by moving
> 'gdbstub.c' in the target_common_system_arch[] source set
> the resulting object can be linked into a single qemu-sytem
> binary.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/or1k/meson.build | 11 +++++++++--
>   1 file changed, 9 insertions(+), 2 deletions(-)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>