[PATCH 1/3] cpu-target: build compilation unit once for user/system

Pierrick Bouvier posted 3 patches 2 months, 3 weeks ago
There is a newer version of this series
[PATCH 1/3] cpu-target: build compilation unit once for user/system
Posted by Pierrick Bouvier 2 months, 3 weeks ago
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 meson.build        | 3 ++-
 cpu-target.c       | 5 -----
 target-info-stub.c | 4 ++++
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/meson.build b/meson.build
index 6a471a27dee..d0ae602c2ee 100644
--- a/meson.build
+++ b/meson.build
@@ -3887,7 +3887,8 @@ endif
 
 common_ss.add(files('cpu-common.c'))
 common_ss.add(files('sanitizer.c'))
-specific_ss.add(files('cpu-target.c'))
+user_ss.add(files('cpu-target.c'))
+system_ss.add(files('cpu-target.c'))
 
 subdir('system')
 
diff --git a/cpu-target.c b/cpu-target.c
index 772e35495b8..f030e2c642e 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -18,7 +18,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "cpu.h"
 #include "accel/accel-cpu-ops.h"
 #include "system/cpus.h"
 #include "exec/cpu-common.h"
@@ -27,10 +26,6 @@
 #include "hw/core/cpu.h"
 #include "trace/trace-root.h"
 
-/* Validate correct placement of CPUArchState. */
-QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) != 0);
-QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) != sizeof(CPUState));
-
 /* enable or disable single step mode. EXCP_DEBUG is returned by the
    CPU loop after each instruction */
 void cpu_single_step(CPUState *cpu, int enabled)
diff --git a/target-info-stub.c b/target-info-stub.c
index ca0caa3686c..d96d8249c1d 100644
--- a/target-info-stub.c
+++ b/target-info-stub.c
@@ -12,6 +12,10 @@
 #include "hw/boards.h"
 #include "cpu.h"
 
+/* Validate correct placement of CPUArchState. */
+QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) != 0);
+QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) != sizeof(CPUState));
+
 static const TargetInfo target_info_stub = {
     .target_name = TARGET_NAME,
     .target_arch = SYS_EMU_TARGET__MAX,
-- 
2.47.2
Re: [PATCH 1/3] cpu-target: build compilation unit once for user/system
Posted by Richard Henderson 2 months, 3 weeks ago
On 7/25/25 10:20, Pierrick Bouvier wrote:
> Signed-off-by: Pierrick Bouvier<pierrick.bouvier@linaro.org>
> ---
>   meson.build        | 3 ++-
>   cpu-target.c       | 5 -----
>   target-info-stub.c | 4 ++++
>   3 files changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~