@samitouri / QOSamiQemu / commits / 48201bb01f

target/arm: Add stub for define_gicv5_cpuif_regs()

The common helper.c file calls define_gicv5_cpuif_regs() which is only defined when TCG is built: $ git grep -w define_gicv5_cpuif_regs target/arm/internals.h:1885:void define_gicv5_cpuif_regs(ARMCPU *cpu); target/arm/helper.c:6334: define_gicv5_cpuif_regs(cpu); target/arm/tcg/gicv5-cpuif.c:923:void define_gicv5_cpuif_regs(ARMCPU *cpu) This fixes when building on macOS with --disable-tcg: Undefined symbols for architecture arm64: "_define_gicv5_cpuif_regs", referenced from: _register_cp_regs_for_features in target_arm_helper.c.o Define the GICv5 stubs in their own compilation unit, otherwise we get the following error: duplicate symbol '_raise_exception_ra' in: libsystem_arm.a.p/target_arm_tcg_op_helper.c.o libstubs_arm.a[4](target_arm_tcg-stubs.c.o) Fixes: ee0f1ce00db ("target/arm: GICv5 cpuif: Initial skeleton and GSB barrier insns") Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20260721122135.6288-3-philmd@oss.qualcomm.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Philippe Mathieu-Daudé committed Jul 27, 2026 at 10:28 UTC 48201bb01f9ea3584a3c1f553bd03e852e8b7215
3 files changed +18 -4
target/arm/gicv5-stubs.c new
+17
@@ -0,0 +1,17 @@
1 +/*
2 + * QEMU ARM stubs for GICv5 TCG helper functions
3 + *
4 + * SPDX-License-Identifier: GPL-2.0-or-later
5 + */
6 +
7 +#include "qemu/osdep.h"
8 +#include "internals.h"
9 +
10 +void define_gicv5_cpuif_regs(ARMCPU *cpu)
11 +{
12 + g_assert_not_reached();
13 +}
14 +
15 +void gicv5_update_ppi_state(CPUARMState *env, int ppi, bool level)
16 +{
17 +}
target/arm/meson.build
+1
@@ -37,6 +37,7 @@ arm_system_ss.add(when: 'CONFIG_HVF', if_true: files('hyp_gdbstub.c'))
37 arm_user_ss.add(files('cpu.c'))
38 arm_stubs_ss.add(files(
39 'cpu32-stubs.c',
40 + 'gicv5-stubs.c',
41 'kvm-stub.c'
42 ))
43 arm_user_ss.add(files(
target/arm/tcg-stubs.c
-4
@@ -43,7 +43,3 @@ void vfp_clear_float_status_exc_flags(CPUARMState *env)
43 void vfp_set_fpcr_to_host(CPUARMState *env, uint32_t val, uint32_t mask)
44 {
45 }
46 -
47 -void gicv5_update_ppi_state(CPUARMState *env, int ppi, bool level)
48 -{
49 -}