qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] meson.build: add -mcx16 flag
@ 2024-05-22 19:30 Artyom Kunakovsky
  2024-05-23  8:02 ` Daniel P. Berrangé
  2024-05-23 10:12 ` Paolo Bonzini
  0 siblings, 2 replies; 6+ messages in thread
From: Artyom Kunakovsky @ 2024-05-22 19:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Artyom Kunakovsky

fix linker error if the project was configured by the './configure --cpu=unknown --target-list=riscv64-softmmu' command

Signed-off-by: Artyom Kunakovsky <artyomkunakovsky@gmail.com>
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index a9de71d450..0c24878c86 100644
--- a/meson.build
+++ b/meson.build
@@ -298,7 +298,7 @@ endforeach
 
 qemu_common_flags = [
   '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE',
-  '-fno-strict-aliasing', '-fno-common', '-fwrapv' ]
+  '-fno-strict-aliasing', '-fno-common', '-fwrapv', '-mcx16' ]
 qemu_cflags = []
 qemu_ldflags = []
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] meson.build: add -mcx16 flag
  2024-05-22 19:30 [PATCH] meson.build: add -mcx16 flag Artyom Kunakovsky
@ 2024-05-23  8:02 ` Daniel P. Berrangé
  2024-05-23  8:35   ` Artyom Kunakovsky
  2024-05-23  8:52   ` Peter Maydell
  2024-05-23 10:12 ` Paolo Bonzini
  1 sibling, 2 replies; 6+ messages in thread
From: Daniel P. Berrangé @ 2024-05-23  8:02 UTC (permalink / raw)
  To: Artyom Kunakovsky; +Cc: qemu-devel

On Wed, May 22, 2024 at 10:30:16PM +0300, Artyom Kunakovsky wrote:
> fix linker error if the project was configured by the './configure --cpu=unknown --target-list=riscv64-softmmu' command

Isn't this simply user error, with the right answer being
to pass a valid CPU target to --cpu, rather than "unknown"

> 
> Signed-off-by: Artyom Kunakovsky <artyomkunakovsky@gmail.com>
> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] meson.build: add -mcx16 flag
  2024-05-23  8:02 ` Daniel P. Berrangé
@ 2024-05-23  8:35   ` Artyom Kunakovsky
  2024-05-23  8:52   ` Peter Maydell
  1 sibling, 0 replies; 6+ messages in thread
From: Artyom Kunakovsky @ 2024-05-23  8:35 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: qemu-devel@nongnu.org

[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]

The compilation error caused by attempting of use 128 bit '__sync_val_compare_and_swap_16', which is supported on the host but not enabled, I don't think this is expected behavior.

Also the patch is little incomplete, I already sent v2 patch, that applying the flag only for x86_64 host.

With regards,
Artyom K.
________________________________
From: Daniel P. Berrangé <berrange@redhat.com>
Sent: Thursday, May 23, 2024 11:02:31 AM
To: Artyom Kunakovsky <artyomkunakovsky@gmail.com>
Cc: qemu-devel@nongnu.org <qemu-devel@nongnu.org>
Subject: Re: [PATCH] meson.build: add -mcx16 flag

On Wed, May 22, 2024 at 10:30:16PM +0300, Artyom Kunakovsky wrote:
> fix linker error if the project was configured by the './configure --cpu=unknown --target-list=riscv64-softmmu' command

Isn't this simply user error, with the right answer being
to pass a valid CPU target to --cpu, rather than "unknown"

>
> Signed-off-by: Artyom Kunakovsky <artyomkunakovsky@gmail.com>
> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

With regards,
Daniel
--
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


[-- Attachment #2: Type: text/html, Size: 2559 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] meson.build: add -mcx16 flag
  2024-05-23  8:02 ` Daniel P. Berrangé
  2024-05-23  8:35   ` Artyom Kunakovsky
@ 2024-05-23  8:52   ` Peter Maydell
  2024-05-23  9:14     ` Daniel P. Berrangé
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2024-05-23  8:52 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: Artyom Kunakovsky, qemu-devel

On Thu, 23 May 2024 at 09:04, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Wed, May 22, 2024 at 10:30:16PM +0300, Artyom Kunakovsky wrote:
> > fix linker error if the project was configured by the './configure --cpu=unknown --target-list=riscv64-softmmu' command
>
> Isn't this simply user error, with the right answer being
> to pass a valid CPU target to --cpu, rather than "unknown"

I've felt for ages that we should probably drop the "unrecognized
host CPU, fall back to TCI" path and insist that we only run
on recognized CPU types. Then we could also sanity check that
the user passed a valid --cpu option.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] meson.build: add -mcx16 flag
  2024-05-23  8:52   ` Peter Maydell
@ 2024-05-23  9:14     ` Daniel P. Berrangé
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel P. Berrangé @ 2024-05-23  9:14 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Artyom Kunakovsky, qemu-devel

On Thu, May 23, 2024 at 09:52:35AM +0100, Peter Maydell wrote:
> On Thu, 23 May 2024 at 09:04, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Wed, May 22, 2024 at 10:30:16PM +0300, Artyom Kunakovsky wrote:
> > > fix linker error if the project was configured by the './configure --cpu=unknown --target-list=riscv64-softmmu' command
> >
> > Isn't this simply user error, with the right answer being
> > to pass a valid CPU target to --cpu, rather than "unknown"
> 
> I've felt for ages that we should probably drop the "unrecognized
> host CPU, fall back to TCI" path and insist that we only run
> on recognized CPU types. Then we could also sanity check that
> the user passed a valid --cpu option.

Yeah, I think that's reasonable. Worst case, a user will have to send us a
patch to recognise a new CPU target, at which point at least we know that
it exists as a possible target.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] meson.build: add -mcx16 flag
  2024-05-22 19:30 [PATCH] meson.build: add -mcx16 flag Artyom Kunakovsky
  2024-05-23  8:02 ` Daniel P. Berrangé
@ 2024-05-23 10:12 ` Paolo Bonzini
  1 sibling, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2024-05-23 10:12 UTC (permalink / raw)
  To: Artyom Kunakovsky, qemu-devel

On 5/22/24 21:30, Artyom Kunakovsky wrote:
> fix linker error if the project was configured by the './configure --cpu=unknown --target-list=riscv64-softmmu' command
> 
> Signed-off-by: Artyom Kunakovsky <artyomkunakovsky@gmail.com>
> ---
>   meson.build | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index a9de71d450..0c24878c86 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -298,7 +298,7 @@ endforeach
>   
>   qemu_common_flags = [
>     '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE',
> -  '-fno-strict-aliasing', '-fno-common', '-fwrapv' ]
> +  '-fno-strict-aliasing', '-fno-common', '-fwrapv', '-mcx16' ]

-mcx16 does not exist on non-x86 hosts so this change breaks them.

QEMU's configure script knows to add -mcx16 on x86 hosts; you've added 
--cpu=unknown yourself, you have to add --extra-cflags=-mcx16 as well.

Paolo

>   qemu_cflags = []
>   qemu_ldflags = []
>   



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-23 10:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-22 19:30 [PATCH] meson.build: add -mcx16 flag Artyom Kunakovsky
2024-05-23  8:02 ` Daniel P. Berrangé
2024-05-23  8:35   ` Artyom Kunakovsky
2024-05-23  8:52   ` Peter Maydell
2024-05-23  9:14     ` Daniel P. Berrangé
2024-05-23 10:12 ` Paolo Bonzini

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).