From 049b4ad66984aad278b3fc0a75b5a995c9b66a16 Mon Sep 17 00:00:00 2001 From: Vaibhav Jain Date: Wed, 16 Nov 2022 18:47:43 +0530 Subject: target/ppc: Fix build warnings when building with 'disable-tcg' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kowshik reported that building qemu with GCC 12.2.1 for 'ppc64-softmmu' target is failing due to following build warnings: ../target/ppc/cpu_init.c:7018:13: error: 'ppc_restore_state_to_opc' defined but not used [-Werror=unused-function] 7018 | static void ppc_restore_state_to_opc(CPUState *cs, Fix this by wrapping these function definitions in 'ifdef CONFIG_TCG' so that they are only defined if qemu is compiled with '--enable-tcg' Reported-by: Kowshik Jois B S Fixes: 61bd1d2942 ("target/ppc: Convert to tcg_ops restore_state_to_opc") Fixes: 670f1da374 ("target/ppc: Implement hashst and hashchk") Fixes: 53ae2aeb94 ("target/ppc: Implement hashstp and hashchkp") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1319 Signed-off-by: Vaibhav Jain Reviewed-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daudé Tested-by: Kowshik Jois B S Message-Id: <20221116131743.658708-1-vaibhav@linux.ibm.com> Signed-off-by: Daniel Henrique Barboza --- target/ppc/cpu_init.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'target/ppc/cpu_init.c') diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 32e9415..cbf0081 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7015,6 +7015,7 @@ static vaddr ppc_cpu_get_pc(CPUState *cs) return cpu->env.nip; } +#ifdef CONFIG_TCG static void ppc_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data) @@ -7023,6 +7024,7 @@ static void ppc_restore_state_to_opc(CPUState *cs, cpu->env.nip = data[0]; } +#endif /* CONFIG_TCG */ static bool ppc_cpu_has_work(CPUState *cs) { -- cgit v1.1