qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Aditya Gupta <adityag@linux.ibm.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	Harsh Prateek Bora <harshpb@linux.ibm.com>,
	Chinmay Rath <rathc@linux.ibm.com>
Cc: "Cédric Le Goater" <clg@redhat.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH] fix: Fix build error with CONFIG_POWERNV disabled
Date: Thu, 21 Aug 2025 14:05:57 +0200	[thread overview]
Message-ID: <f7a8b91e-e2df-4c11-818e-f244f8e648ad@redhat.com> (raw)
In-Reply-To: <3xbdwul3qwdb246pk5xeeduotfvyeyjr6qkozzatb7h2zdrxlb@pcuu3ewglrjj>

On 21/08/2025 12.53, Aditya Gupta wrote:
> On 25/08/20 05:55PM, Aditya Gupta wrote:
>> Currently when CONFIG_POWERNV is not enabled, the build fails, such as
>> with --without-default-devices:
>>
>>      $ ./configure --without-default-devices
>>      $ make
>>
>>      [281/283] Linking target qemu-system-ppc64
>>      FAILED: qemu-system-ppc64
>>      cc -m64 @qemu-system-ppc64.rsp
>>      /usr/bin/ld: libqemu-ppc64-softmmu.a.p/target_ppc_misc_helper.c.o: in function `helper_load_sprd':
>>      .../target/ppc/misc_helper.c:335:(.text+0xcdc): undefined reference to `pnv_chip_find_core'
>>      /usr/bin/ld: libqemu-ppc64-softmmu.a.p/target_ppc_misc_helper.c.o: in function `helper_store_sprd':
>>      .../target/ppc/misc_helper.c:375:(.text+0xdf4): undefined reference to `pnv_chip_find_core'
>>      collect2: error: ld returned 1 exit status
>>      ...
>>
>>> <...snip...>
> 
> The following is also sufficient to fix the compilation issue. Wasn't
> sure if #ifdef POWERNV looks good there:
> 
>      diff --git a/target/ppc/misc_helper.c b/target/ppc/misc_helper.c
>      index e7d94625185c..a8e55b2937c7 100644
>      --- a/target/ppc/misc_helper.c
>      +++ b/target/ppc/misc_helper.c
>      @@ -323,6 +323,7 @@ void helper_store_sprc(CPUPPCState *env, target_ulong val)
>       
>       target_ulong helper_load_sprd(CPUPPCState *env)
>       {
>      +#ifdef CONFIG_POWERNV
>           /*
>            * SPRD is a HV-only register for Power CPUs, so this will only be
>            * accessed by powernv machines.
>      @@ -361,11 +362,14 @@ target_ulong helper_load_sprd(CPUPPCState *env)
>                                         TARGET_FMT_lx"\n", sprc);
>               break;
>           }
>      +#endif

I don't think this is a good patch, it likely always disables the code, even 
if the POWERNV machine is available? At least it lacks the #include 
CONFIG_DEVICES that would be required here.

  Thomas



  reply	other threads:[~2025-08-21 12:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20 12:25 [PATCH] fix: Fix build error with CONFIG_POWERNV disabled Aditya Gupta
2025-08-21 10:53 ` Aditya Gupta
2025-08-21 12:05   ` Thomas Huth [this message]
2025-08-21 12:34     ` Aditya Gupta
2025-08-21 14:08 ` Stefan Hajnoczi
2025-09-01  6:59 ` Cédric Le Goater
2025-09-01  8:32   ` Aditya Gupta
2025-09-02 10:44 ` Philippe Mathieu-Daudé
2025-09-02 11:06   ` Philippe Mathieu-Daudé
2025-09-02 11:16     ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7a8b91e-e2df-4c11-818e-f244f8e648ad@redhat.com \
    --to=thuth@redhat.com \
    --cc=adityag@linux.ibm.com \
    --cc=clg@redhat.com \
    --cc=harshpb@linux.ibm.com \
    --cc=mjt@tls.msk.ru \
    --cc=npiggin@gmail.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rathc@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).