qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH-for-7.2] target/ppc: Fix build warnings when building with 'd


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH-for-7.2] target/ppc: Fix build warnings when building with 'disable-tcg'
Date: Wed, 16 Nov 2022 16:27:59 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 16/11/22 14:17, Vaibhav Jain wrote:
Kowshik reported that building qemu with GCC 12.2.1 for 'ppc64-softmmu'
target is failing due to following build warnings:

<snip>
  ../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,
<snip>

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 <kowsjois@linux.ibm.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
---
  target/ppc/cpu_init.c    | 2 ++
  target/ppc/excp_helper.c | 2 ++
  2 files changed, 4 insertions(+)

diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 32e94153d1..cbf0081374 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 */

Oops sorry.

Fixes: 61bd1d2942 ("target/ppc: Convert to tcg_ops restore_state_to_opc")

diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index a05a2ed595..94adcb766b 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -2842,6 +2842,7 @@ void helper_td(CPUPPCState *env, target_ulong arg1, 
target_ulong arg2,
  #endif
  #endif
+#ifdef CONFIG_TCG
  static uint32_t helper_SIMON_LIKE_32_64(uint32_t x, uint64_t key, uint32_t 
lane)
  {
      const uint16_t c = 0xfffc;
@@ -2924,6 +2925,7 @@ HELPER_HASH(HASHST, env->spr[SPR_HASHKEYR], true)
  HELPER_HASH(HASHCHK, env->spr[SPR_HASHKEYR], false)
  HELPER_HASH(HASHSTP, env->spr[SPR_HASHPKEYR], true)
  HELPER_HASH(HASHCHKP, env->spr[SPR_HASHPKEYR], false)
+#endif /* CONFIG_TCG */

Fixes: 670f1da374 ("target/ppc: Implement hashst and hashchk")

Hmm this is another fix... You could split your patch in 2,
but not a big deal. Regardless:

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]