@samitouri / QOSamiQemu / commits / b693da615a

Revert "target/arm: Build cpu32-system.o as common object"

In c8bea1276c we moved cpu32.c and built it as a common object. The commit message says "cpu32.c only contains CPU types used in 32-bit system emulation". However, this is incorrect -- it contains 32-bit CPU types used in both system and usermode emulation. (The case where we don't need these CPUs and which we were using ifdefs to avoid is specifically the AArch64 usermode qemu-aarch64 binary.) The effect is that qemu-arm lost all the named CPU types except the M-profile ones (which are in cpu-v7m.c). This reverts commit c8bea1276c85855b2e088b740737d043c8556d58. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3962 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Message-id: 20260720100312.119894-1-peter.maydell@linaro.org

Peter Maydell committed Jul 20, 2026 at 19:05 UTC b693da615a7ab2adae7383fecb87b0e13966256e
2 files changed +13 -2
target/arm/tcg/cpu32.c renamed
+9 -1
@@ -1,5 +1,5 @@
1 /*
2 - * QEMU ARM TCG-only CPUs (not needed for the AArch64 linux-user build)
2 + * QEMU ARM TCG-only CPUs.
3 *
4 * Copyright (c) 2012 SUSE LINUX Products GmbH
5 *
@@ -13,9 +13,15 @@
13 #include "cpu.h"
14 #include "accel/tcg/cpu-ops.h"
15 #include "internals.h"
16 +#if !defined(CONFIG_USER_ONLY)
17 #include "hw/core/boards.h"
18 +#endif
19 #include "cpregs.h"
20
21 +
22 +/* CPU models. These are not needed for the AArch64 linux-user build. */
23 +#if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64)
24 +
25 static void arm926_initfn(Object *obj)
26 {
27 ARMCPU *cpu = ARM_CPU(obj);
@@ -740,3 +746,5 @@ static void arm_tcg_cpu_register_types(void)
746 }
747
748 type_init(arm_tcg_cpu_register_types)
749 +
750 +#endif /* !CONFIG_USER_ONLY || !TARGET_AARCH64 */
target/arm/tcg/meson.build
+4 -1
@@ -30,6 +30,10 @@ translate32_d = [
30 arm_ss.add(when: 'TARGET_AARCH64', if_true: gen_a64)
31 arm_stubs_ss.add(files('stubs32.c'))
32
33 +arm_ss.add(files(
34 + 'cpu32.c',
35 +))
36 +
37 arm_ss.add(when: 'TARGET_AARCH64', if_true: files(
38 'gengvec64.c',
39 'translate-a64.c',
@@ -82,7 +86,6 @@ arm_common_user_system_ss.add(when: 'TARGET_AARCH64', if_true: files(
86
87 arm_common_system_ss.add(files(
88 'cpregs-at.c',
85 - 'cpu32-system.c',
89 'gicv5-cpuif.c',
90 'psci.c',
91 'tlb_helper.c',