* [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7
@ 2025-05-08 9:35 Thomas Huth
2025-05-08 9:35 ` [PATCH 1/5] include/hw/dma/xlnx_dpdma: Remove dependency on console.h Thomas Huth
` (5 more replies)
0 siblings, 6 replies; 15+ messages in thread
From: Thomas Huth @ 2025-05-08 9:35 UTC (permalink / raw)
To: Peter Maydell, qemu-arm, Brad Smith
Cc: Warner Losh, Paolo Bonzini, Marc-André Lureau,
Daniel P. Berrangé
At the end of April, OpenBSD 7.7 has been released, so we could update
our test VM to that version now. However, I noticed that some arm machines
now fail to compile since they fail to include the <epoxy/gl.h> header.
This header resides in /usr/X11R6/include instead of /usr/include in
OpenBSD, so we have to make sure that the machines are compiled with the
right CFLAGS (or don't include the header at all if it is not really
necessary). Thus the first patches of this series clean up this first
before we can finally switch to OpenBSD 7.7. The last patch then
also reverts a hack for OpenBSD in the main meson.build file since the
related problem has finally been fixed there.
Thomas Huth (5):
include/hw/dma/xlnx_dpdma: Remove dependency on console.h
hw/display/bcm2835_fb: Move inclusion of console.h to the .c file
hw/arm: Compile musicpal and the xlnx machines with the right CFLAGS
tests/vm: Update OpenBSD to 7.7
Revert "meson.build: Disable -fzero-call-used-regs on OpenBSD"
meson.build | 6 +-----
include/hw/display/bcm2835_fb.h | 1 -
include/hw/dma/xlnx_dpdma.h | 1 -
hw/display/bcm2835_fb.c | 1 +
hw/arm/meson.build | 4 ++--
tests/vm/openbsd | 4 ++--
6 files changed, 6 insertions(+), 11 deletions(-)
--
2.49.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/5] include/hw/dma/xlnx_dpdma: Remove dependency on console.h
2025-05-08 9:35 [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7 Thomas Huth
@ 2025-05-08 9:35 ` Thomas Huth
2025-05-08 9:35 ` [PATCH 2/5] hw/display/bcm2835_fb: Move inclusion of console.h to the .c file Thomas Huth
` (4 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Thomas Huth @ 2025-05-08 9:35 UTC (permalink / raw)
To: Peter Maydell, qemu-arm, Brad Smith
Cc: Warner Losh, Paolo Bonzini, Marc-André Lureau,
Daniel P. Berrangé
From: Thomas Huth <thuth@redhat.com>
console.h brings a dependency on the <epoxy/opengl.h> and the pixman
header file (if available), so we should avoid to include this file
if it is not really necessary (otherwise we have to specify the
dependency in the meson.build file, too, to get the right include
paths everywhere). console.h does not seem to be necessary for the
xlnx_dpdma code, so drop the include here.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/hw/dma/xlnx_dpdma.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/hw/dma/xlnx_dpdma.h b/include/hw/dma/xlnx_dpdma.h
index 1ec0d265be2..484b2e377f0 100644
--- a/include/hw/dma/xlnx_dpdma.h
+++ b/include/hw/dma/xlnx_dpdma.h
@@ -26,7 +26,6 @@
#define XLNX_DPDMA_H
#include "hw/sysbus.h"
-#include "ui/console.h"
#include "system/dma.h"
#include "qom/object.h"
--
2.49.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/5] hw/display/bcm2835_fb: Move inclusion of console.h to the .c file
2025-05-08 9:35 [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7 Thomas Huth
2025-05-08 9:35 ` [PATCH 1/5] include/hw/dma/xlnx_dpdma: Remove dependency on console.h Thomas Huth
@ 2025-05-08 9:35 ` Thomas Huth
2025-05-08 9:35 ` [PATCH 3/5] hw/arm: Compile musicpal and the xlnx machines with the right CFLAGS Thomas Huth
` (3 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Thomas Huth @ 2025-05-08 9:35 UTC (permalink / raw)
To: Peter Maydell, qemu-arm, Brad Smith
Cc: Warner Losh, Paolo Bonzini, Marc-André Lureau,
Daniel P. Berrangé
From: Thomas Huth <thuth@redhat.com>
The definitions from console.h are not needed in the bcm2835_fb.h
header file yet, so let's move it to the place that really needs
its definitions, i.e. into the bcm2835_fb.c file.
This way the header can also be used by code that is not compiled
with the CFLAGS that are required for pixman or OpenGL (in case
their headers do not reside under /usr/include).
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/hw/display/bcm2835_fb.h | 1 -
hw/display/bcm2835_fb.c | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/hw/display/bcm2835_fb.h b/include/hw/display/bcm2835_fb.h
index 49541bf08f4..acc9230b6a8 100644
--- a/include/hw/display/bcm2835_fb.h
+++ b/include/hw/display/bcm2835_fb.h
@@ -13,7 +13,6 @@
#define BCM2835_FB_H
#include "hw/sysbus.h"
-#include "ui/console.h"
#include "qom/object.h"
#define UPPER_RAM_BASE 0x40000000
diff --git a/hw/display/bcm2835_fb.c b/hw/display/bcm2835_fb.c
index 820e67ac8bb..1bb2ee45a01 100644
--- a/hw/display/bcm2835_fb.c
+++ b/hw/display/bcm2835_fb.c
@@ -27,6 +27,7 @@
#include "hw/display/bcm2835_fb.h"
#include "hw/hw.h"
#include "hw/irq.h"
+#include "ui/console.h"
#include "framebuffer.h"
#include "ui/pixel_ops.h"
#include "hw/misc/bcm2835_mbox_defs.h"
--
2.49.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/5] hw/arm: Compile musicpal and the xlnx machines with the right CFLAGS
2025-05-08 9:35 [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7 Thomas Huth
2025-05-08 9:35 ` [PATCH 1/5] include/hw/dma/xlnx_dpdma: Remove dependency on console.h Thomas Huth
2025-05-08 9:35 ` [PATCH 2/5] hw/display/bcm2835_fb: Move inclusion of console.h to the .c file Thomas Huth
@ 2025-05-08 9:35 ` Thomas Huth
2025-05-08 12:11 ` Peter Maydell
2025-05-08 9:35 ` [PATCH 4/5] tests/vm: Update OpenBSD to 7.7 Thomas Huth
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Thomas Huth @ 2025-05-08 9:35 UTC (permalink / raw)
To: Peter Maydell, qemu-arm, Brad Smith
Cc: Warner Losh, Paolo Bonzini, Marc-André Lureau,
Daniel P. Berrangé
From: Thomas Huth <thuth@redhat.com>
These machines include ui/console.h, which in turn includes the
pixman headers and <epoxy/gl.h> via ui/surface.h. If these library
headers are located outside of /usr/include (like gl.h on OpenBSD 7.7),
we must make sure to compile this code with the right CFLAGS so that
the headers can be found.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/arm/meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/arm/meson.build b/hw/arm/meson.build
index 5098795f61d..51d0c055abf 100644
--- a/hw/arm/meson.build
+++ b/hw/arm/meson.build
@@ -8,7 +8,7 @@ arm_common_ss.add(when: 'CONFIG_HIGHBANK', if_true: files('highbank.c'))
arm_common_ss.add(when: 'CONFIG_INTEGRATOR', if_true: files('integratorcp.c'))
arm_common_ss.add(when: 'CONFIG_MICROBIT', if_true: files('microbit.c'))
arm_common_ss.add(when: 'CONFIG_MPS3R', if_true: files('mps3r.c'))
-arm_common_ss.add(when: 'CONFIG_MUSICPAL', if_true: [pixman, files('musicpal.c')])
+arm_common_ss.add(when: 'CONFIG_MUSICPAL', if_true: [files('musicpal.c'), pixman, opengl])
arm_common_ss.add(when: 'CONFIG_NETDUINOPLUS2', if_true: files('netduinoplus2.c'))
arm_common_ss.add(when: 'CONFIG_OLIMEX_STM32_H405', if_true: files('olimex-stm32-h405.c'))
arm_common_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx.c', 'npcm7xx_boards.c'))
@@ -34,7 +34,7 @@ arm_common_ss.add(when: 'CONFIG_STM32F205_SOC', if_true: files('stm32f205_soc.c'
arm_common_ss.add(when: 'CONFIG_STM32F405_SOC', if_true: files('stm32f405_soc.c'))
arm_common_ss.add(when: 'CONFIG_B_L475E_IOT01A', if_true: files('b-l475e-iot01a.c'))
arm_common_ss.add(when: 'CONFIG_STM32L4X5_SOC', if_true: files('stm32l4x5_soc.c'))
-arm_common_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: files('xlnx-zynqmp.c', 'xlnx-zcu102.c'))
+arm_common_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: [files('xlnx-zynqmp.c', 'xlnx-zcu102.c'), pixman, opengl])
arm_common_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal.c', 'xlnx-versal-virt.c'))
arm_common_ss.add(when: 'CONFIG_FSL_IMX25', if_true: files('fsl-imx25.c', 'imx25_pdk.c'))
arm_common_ss.add(when: 'CONFIG_FSL_IMX31', if_true: files('fsl-imx31.c', 'kzm.c'))
--
2.49.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/5] tests/vm: Update OpenBSD to 7.7
2025-05-08 9:35 [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7 Thomas Huth
` (2 preceding siblings ...)
2025-05-08 9:35 ` [PATCH 3/5] hw/arm: Compile musicpal and the xlnx machines with the right CFLAGS Thomas Huth
@ 2025-05-08 9:35 ` Thomas Huth
2025-05-08 9:35 ` [PATCH 5/5] Revert "meson.build: Disable -fzero-call-used-regs on OpenBSD" Thomas Huth
2025-05-08 12:12 ` [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7 Peter Maydell
5 siblings, 0 replies; 15+ messages in thread
From: Thomas Huth @ 2025-05-08 9:35 UTC (permalink / raw)
To: Peter Maydell, qemu-arm, Brad Smith
Cc: Warner Losh, Paolo Bonzini, Marc-André Lureau,
Daniel P. Berrangé
From: Thomas Huth <thuth@redhat.com>
OpenBSD 7.7 has been released at the end of April 2025, so let's
update to that version.
Reported-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/vm/openbsd | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/vm/openbsd b/tests/vm/openbsd
index 5e4f76f3988..2ea86a01bad 100755
--- a/tests/vm/openbsd
+++ b/tests/vm/openbsd
@@ -22,8 +22,8 @@ class OpenBSDVM(basevm.BaseVM):
name = "openbsd"
arch = "x86_64"
- link = "https://cdn.openbsd.org/pub/OpenBSD/7.6/amd64/install76.iso"
- csum = "60cba8cb391b50bba8fa10fc768bd0529636f5345d82133c93e22c798d8e5269"
+ link = "https://cdn.openbsd.org/pub/OpenBSD/7.7/amd64/install77.iso"
+ csum = "da0106e39463f015524dca806f407c37a9bdd17e6dfffe533b06a2dd2edd8a27"
size = "20G"
pkgs = [
# tools
--
2.49.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 5/5] Revert "meson.build: Disable -fzero-call-used-regs on OpenBSD"
2025-05-08 9:35 [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7 Thomas Huth
` (3 preceding siblings ...)
2025-05-08 9:35 ` [PATCH 4/5] tests/vm: Update OpenBSD to 7.7 Thomas Huth
@ 2025-05-08 9:35 ` Thomas Huth
2025-05-08 10:05 ` Daniel P. Berrangé
2025-05-08 12:12 ` [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7 Peter Maydell
5 siblings, 1 reply; 15+ messages in thread
From: Thomas Huth @ 2025-05-08 9:35 UTC (permalink / raw)
To: Peter Maydell, qemu-arm, Brad Smith
Cc: Warner Losh, Paolo Bonzini, Marc-André Lureau,
Daniel P. Berrangé
From: Thomas Huth <thuth@redhat.com>
This reverts commit 2d6d995709482cc8b6a76dbb5334a28001a14a9a.
OpenBSD 7.7 fixed the problem with the -fzero-call-used-regs on OpenBSD,
see https://github.com/openbsd/src/commit/03eca72d1e030b7a542cd6aec1 for
the fix there.
Suggested-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
meson.build | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/meson.build b/meson.build
index 6c61e1dcaec..5f0e6a65cb0 100644
--- a/meson.build
+++ b/meson.build
@@ -699,11 +699,7 @@ hardening_flags = [
#
# NB: Clang 17 is broken and SEGVs
# https://github.com/llvm/llvm-project/issues/75168
-#
-# NB2: This clashes with the "retguard" extension of OpenBSD's Clang
-# https://gitlab.com/qemu-project/qemu/-/issues/2278
-if host_os != 'openbsd' and \
- cc.compiles('extern struct { void (*cb)(void); } s; void f(void) { s.cb(); }',
+if cc.compiles('extern struct { void (*cb)(void); } s; void f(void) { s.cb(); }',
name: '-fzero-call-used-regs=used-gpr',
args: ['-O2', '-fzero-call-used-regs=used-gpr'])
hardening_flags += '-fzero-call-used-regs=used-gpr'
--
2.49.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 5/5] Revert "meson.build: Disable -fzero-call-used-regs on OpenBSD"
2025-05-08 9:35 ` [PATCH 5/5] Revert "meson.build: Disable -fzero-call-used-regs on OpenBSD" Thomas Huth
@ 2025-05-08 10:05 ` Daniel P. Berrangé
2025-05-08 10:12 ` Thomas Huth
2025-05-10 0:21 ` Brad Smith
0 siblings, 2 replies; 15+ messages in thread
From: Daniel P. Berrangé @ 2025-05-08 10:05 UTC (permalink / raw)
To: Thomas Huth
Cc: Peter Maydell, qemu-arm, Brad Smith, Warner Losh, Paolo Bonzini,
Marc-André Lureau
On Thu, May 08, 2025 at 11:35:19AM +0200, Thomas Huth wrote:
> From: Thomas Huth <thuth@redhat.com>
>
> This reverts commit 2d6d995709482cc8b6a76dbb5334a28001a14a9a.
>
> OpenBSD 7.7 fixed the problem with the -fzero-call-used-regs on OpenBSD,
> see https://github.com/openbsd/src/commit/03eca72d1e030b7a542cd6aec1 for
> the fix there.
Is that fix also backported to OpenBS 7.6 ?
We support the 2 most recent releases of each platform, so for OpenBSD
thats currently 7.6 and 7.7.
If it wasn't backported to 7.6, we must wait until 7.8 before we can
rely on the fix being present.
>
> Suggested-by: Brad Smith <brad@comstyle.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> meson.build | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 6c61e1dcaec..5f0e6a65cb0 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -699,11 +699,7 @@ hardening_flags = [
> #
> # NB: Clang 17 is broken and SEGVs
> # https://github.com/llvm/llvm-project/issues/75168
> -#
> -# NB2: This clashes with the "retguard" extension of OpenBSD's Clang
> -# https://gitlab.com/qemu-project/qemu/-/issues/2278
> -if host_os != 'openbsd' and \
> - cc.compiles('extern struct { void (*cb)(void); } s; void f(void) { s.cb(); }',
> +if cc.compiles('extern struct { void (*cb)(void); } s; void f(void) { s.cb(); }',
> name: '-fzero-call-used-regs=used-gpr',
> args: ['-O2', '-fzero-call-used-regs=used-gpr'])
> hardening_flags += '-fzero-call-used-regs=used-gpr'
> --
> 2.49.0
>
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] 15+ messages in thread
* Re: [PATCH 5/5] Revert "meson.build: Disable -fzero-call-used-regs on OpenBSD"
2025-05-08 10:05 ` Daniel P. Berrangé
@ 2025-05-08 10:12 ` Thomas Huth
2025-05-08 10:17 ` Paolo Bonzini
2025-05-10 0:21 ` Brad Smith
1 sibling, 1 reply; 15+ messages in thread
From: Thomas Huth @ 2025-05-08 10:12 UTC (permalink / raw)
To: Daniel P. Berrangé
Cc: Peter Maydell, qemu-arm, Brad Smith, Warner Losh, Paolo Bonzini,
Marc-André Lureau
On 08/05/2025 12.05, Daniel P. Berrangé wrote:
> On Thu, May 08, 2025 at 11:35:19AM +0200, Thomas Huth wrote:
>> From: Thomas Huth <thuth@redhat.com>
>>
>> This reverts commit 2d6d995709482cc8b6a76dbb5334a28001a14a9a.
>>
>> OpenBSD 7.7 fixed the problem with the -fzero-call-used-regs on OpenBSD,
>> see https://github.com/openbsd/src/commit/03eca72d1e030b7a542cd6aec1 for
>> the fix there.
>
> Is that fix also backported to OpenBS 7.6 ?
>
> We support the 2 most recent releases of each platform, so for OpenBSD
> thats currently 7.6 and 7.7.
Sure about that? We claim to "support the most recent major version at all
times" and "Support for the previous major version will be dropped 2 years
after the new major version is released or when the vendor itself drops
support, whichever comes first.".
So for me that sounds like we only support 7.7 now, since the support for
the previous major release - which was 6.x - has ended already.
(Apart from that: Does 7.6 still get updates or does the OpenBSD team drop
the support once 7.7 was released?)
Thomas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 5/5] Revert "meson.build: Disable -fzero-call-used-regs on OpenBSD"
2025-05-08 10:12 ` Thomas Huth
@ 2025-05-08 10:17 ` Paolo Bonzini
2025-05-08 10:24 ` Thomas Huth
0 siblings, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2025-05-08 10:17 UTC (permalink / raw)
To: Thomas Huth
Cc: Daniel P. Berrangé, Peter Maydell, qemu-arm, Brad Smith,
Warner Losh, Marc-André Lureau
On Thu, May 8, 2025 at 12:12 PM Thomas Huth <thuth@redhat.com> wrote:
> > We support the 2 most recent releases of each platform, so for OpenBSD
> > thats currently 7.6 and 7.7.
>
> Sure about that? We claim to "support the most recent major version at all
> times" and "Support for the previous major version will be dropped 2 years
> after the new major version is released or when the vendor itself drops
> support, whichever comes first.".
>
> So for me that sounds like we only support 7.7 now, since the support for
> the previous major release - which was 6.x - has ended already.
OpenBSD does not really have major/minor releases. It just rolls over
from x.9 to (x+1).0, so the supported releases are 7.6 and 7.7.
Paolo
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 5/5] Revert "meson.build: Disable -fzero-call-used-regs on OpenBSD"
2025-05-08 10:17 ` Paolo Bonzini
@ 2025-05-08 10:24 ` Thomas Huth
0 siblings, 0 replies; 15+ messages in thread
From: Thomas Huth @ 2025-05-08 10:24 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Daniel P. Berrangé, Peter Maydell, qemu-arm, Brad Smith,
Warner Losh, Marc-André Lureau
On 08/05/2025 12.17, Paolo Bonzini wrote:
> On Thu, May 8, 2025 at 12:12 PM Thomas Huth <thuth@redhat.com> wrote:
>>> We support the 2 most recent releases of each platform, so for OpenBSD
>>> thats currently 7.6 and 7.7.
>>
>> Sure about that? We claim to "support the most recent major version at all
>> times" and "Support for the previous major version will be dropped 2 years
>> after the new major version is released or when the vendor itself drops
>> support, whichever comes first.".
>>
>> So for me that sounds like we only support 7.7 now, since the support for
>> the previous major release - which was 6.x - has ended already.
>
> OpenBSD does not really have major/minor releases. It just rolls over
> from x.9 to (x+1).0, so the supported releases are 7.6 and 7.7.
Ok, but then maybe someone should adjust docs/about/build-platforms.rst to
avoid confusion here.
Thomas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/5] hw/arm: Compile musicpal and the xlnx machines with the right CFLAGS
2025-05-08 9:35 ` [PATCH 3/5] hw/arm: Compile musicpal and the xlnx machines with the right CFLAGS Thomas Huth
@ 2025-05-08 12:11 ` Peter Maydell
2025-05-08 12:45 ` Paolo Bonzini
0 siblings, 1 reply; 15+ messages in thread
From: Peter Maydell @ 2025-05-08 12:11 UTC (permalink / raw)
To: Thomas Huth
Cc: qemu-arm, Brad Smith, Warner Losh, Paolo Bonzini,
Marc-André Lureau, Daniel P. Berrangé
On Thu, 8 May 2025 at 10:35, Thomas Huth <thuth@redhat.com> wrote:
>
> From: Thomas Huth <thuth@redhat.com>
>
> These machines include ui/console.h, which in turn includes the
> pixman headers and <epoxy/gl.h> via ui/surface.h. If these library
> headers are located outside of /usr/include (like gl.h on OpenBSD 7.7),
> we must make sure to compile this code with the right CFLAGS so that
> the headers can be found.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> hw/arm/meson.build | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/meson.build b/hw/arm/meson.build
> index 5098795f61d..51d0c055abf 100644
> --- a/hw/arm/meson.build
> +++ b/hw/arm/meson.build
> @@ -8,7 +8,7 @@ arm_common_ss.add(when: 'CONFIG_HIGHBANK', if_true: files('highbank.c'))
> arm_common_ss.add(when: 'CONFIG_INTEGRATOR', if_true: files('integratorcp.c'))
> arm_common_ss.add(when: 'CONFIG_MICROBIT', if_true: files('microbit.c'))
> arm_common_ss.add(when: 'CONFIG_MPS3R', if_true: files('mps3r.c'))
> -arm_common_ss.add(when: 'CONFIG_MUSICPAL', if_true: [pixman, files('musicpal.c')])
> +arm_common_ss.add(when: 'CONFIG_MUSICPAL', if_true: [files('musicpal.c'), pixman, opengl])
Is there not some better way to do this with Meson?
If we're building with the opengl dependency then the
header files should go on the include path for all the
compilation objects, not just ones where we explicitly
ask for it. Otherwise you get bugs like this because there's
nothing that will check that you only used header X in
C files which say they're using the dependency.
I think that either:
* the build system should ensure it gets the headers right
when it's building things
* there should be some check such that "use header X without
declaring dependency on it" is a build failure everywhere,
not just on the oddball hosts where X isn't in the default
include path
thanks
-- PMM
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7
2025-05-08 9:35 [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7 Thomas Huth
` (4 preceding siblings ...)
2025-05-08 9:35 ` [PATCH 5/5] Revert "meson.build: Disable -fzero-call-used-regs on OpenBSD" Thomas Huth
@ 2025-05-08 12:12 ` Peter Maydell
2025-05-08 12:39 ` Thomas Huth
5 siblings, 1 reply; 15+ messages in thread
From: Peter Maydell @ 2025-05-08 12:12 UTC (permalink / raw)
To: Thomas Huth
Cc: qemu-arm, Brad Smith, Warner Losh, Paolo Bonzini,
Marc-André Lureau, Daniel P. Berrangé
On Thu, 8 May 2025 at 10:35, Thomas Huth <thuth@redhat.com> wrote:
>
> At the end of April, OpenBSD 7.7 has been released, so we could update
> our test VM to that version now. However, I noticed that some arm machines
> now fail to compile since they fail to include the <epoxy/gl.h> header.
> This header resides in /usr/X11R6/include instead of /usr/include in
> OpenBSD, so we have to make sure that the machines are compiled with the
> right CFLAGS (or don't include the header at all if it is not really
> necessary). Thus the first patches of this series clean up this first
> before we can finally switch to OpenBSD 7.7. The last patch then
> also reverts a hack for OpenBSD in the main meson.build file since the
> related problem has finally been fixed there.
It looks like you forgot to cc qemu-devel; would you mind
reposting so the series gets picked up by patchew etc
and gets seen by people who only read -devel?
thanks
-- PMM
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7
2025-05-08 12:12 ` [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7 Peter Maydell
@ 2025-05-08 12:39 ` Thomas Huth
0 siblings, 0 replies; 15+ messages in thread
From: Thomas Huth @ 2025-05-08 12:39 UTC (permalink / raw)
To: Peter Maydell
Cc: qemu-arm, Brad Smith, Warner Losh, Paolo Bonzini,
Marc-André Lureau, Daniel P. Berrangé
On 08/05/2025 14.12, Peter Maydell wrote:
> On Thu, 8 May 2025 at 10:35, Thomas Huth <thuth@redhat.com> wrote:
>>
>> At the end of April, OpenBSD 7.7 has been released, so we could update
>> our test VM to that version now. However, I noticed that some arm machines
>> now fail to compile since they fail to include the <epoxy/gl.h> header.
>> This header resides in /usr/X11R6/include instead of /usr/include in
>> OpenBSD, so we have to make sure that the machines are compiled with the
>> right CFLAGS (or don't include the header at all if it is not really
>> necessary). Thus the first patches of this series clean up this first
>> before we can finally switch to OpenBSD 7.7. The last patch then
>> also reverts a hack for OpenBSD in the main meson.build file since the
>> related problem has finally been fixed there.
>
> It looks like you forgot to cc qemu-devel; would you mind
> reposting so the series gets picked up by patchew etc
> and gets seen by people who only read -devel?
Ooops, sorry, will do! Thanks for noticing it!
Thomas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/5] hw/arm: Compile musicpal and the xlnx machines with the right CFLAGS
2025-05-08 12:11 ` Peter Maydell
@ 2025-05-08 12:45 ` Paolo Bonzini
0 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2025-05-08 12:45 UTC (permalink / raw)
To: Peter Maydell, Thomas Huth
Cc: qemu-arm, Brad Smith, Warner Losh, Marc-André Lureau,
Daniel P. Berrangé
On 5/8/25 14:11, Peter Maydell wrote:
>> diff --git a/hw/arm/meson.build b/hw/arm/meson.build
>> index 5098795f61d..51d0c055abf 100644
>> --- a/hw/arm/meson.build
>> +++ b/hw/arm/meson.build
>> @@ -8,7 +8,7 @@ arm_common_ss.add(when: 'CONFIG_HIGHBANK', if_true: files('highbank.c'))
>> arm_common_ss.add(when: 'CONFIG_INTEGRATOR', if_true: files('integratorcp.c'))
>> arm_common_ss.add(when: 'CONFIG_MICROBIT', if_true: files('microbit.c'))
>> arm_common_ss.add(when: 'CONFIG_MPS3R', if_true: files('mps3r.c'))
>> -arm_common_ss.add(when: 'CONFIG_MUSICPAL', if_true: [pixman, files('musicpal.c')])
>> +arm_common_ss.add(when: 'CONFIG_MUSICPAL', if_true: [files('musicpal.c'), pixman, opengl])
>
> Is there not some better way to do this with Meson?
> I think that either:
> * the build system should ensure it gets the headers right
> when it's building things
> * there should be some check such that "use header X without
> declaring dependency on it" is a build failure everywhere,
> not just on the oddball hosts where X isn't in the default
> include path
The former was already happening for specific_ss
# allow using headers from the dependencies but do not include the sources
lib_deps = []
foreach dep : arch_deps
lib_deps += dep.partial_dependency(compile_args: true, includes: true)
endforeach
lib = static_library('qemu-' + target,
sources: arch_srcs + genh,
dependencies: lib_deps,
and the commit message shows that it was for a similar case:
commit 727bb5b477e66b6cd8a558bf2cdf9a666b914f27
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: Tue May 7 12:22:31 2024 +0200
meson: pick libfdt from common_ss when building target-specific files
Avoid having to list dependencies such as libfdt twice, both on common_ss
and specific_ss. Instead, just take all the dependencies in common_ss
and allow the target-specific libqemu-*.fa library to use them.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(Note that the partial_dependency() stuff is not strictly needed. It's
only there to document *why* the dependency are added).
Plus, there is an older workaround (that should be unnecessary
these days) in ui/meson.build:
specific_ss.add(when: ['CONFIG_SYSTEM_ONLY'], if_true: pixman) # for the include path
specific_ss.add(when: ['CONFIG_SYSTEM_ONLY'], if_true: opengl) # for the include path
The root cause is that specific_ss (and now hw_common_arch[]) is built
as a separate target so the common code's include paths have to be added
either by hand as in Thomas's patch, or with a for loop as in the above
commit.
So, the problem is that a loop similar to the one above was not added when
building hw_common_arch_libs. Something like this should work:
diff --git a/meson.build b/meson.build
index bfddcc07dfd..812d6f90adb 100644
--- a/meson.build
+++ b/meson.build
@@ -3237,6 +3237,7 @@ config_devices_mak_list = []
config_devices_h = {}
config_target_h = {}
config_target_mak = {}
+config_base_arch_mak = {}
disassemblers = {
'alpha' : ['CONFIG_ALPHA_DIS'],
@@ -3428,6 +3429,11 @@ foreach target : target_dirs
config_all_devices += config_devices
endif
config_target_mak += {target: config_target}
+
+ # build a merged config for all targets with the same TARGET_BASE_ARCH
+ target_base_arch = config_target['TARGET_BASE_ARCH']
+ config_base_arch = config_base_arch_mak.get(target_base_arch, {}) + config_target
+ config_base_arch_mak += {target_base_arch: config_base_arch}
endforeach
target_dirs = actual_target_dirs
@@ -4107,28 +4113,27 @@ common_all = static_library('common',
# construct common libraries per base architecture
hw_common_arch_libs = {}
-foreach target : target_dirs
- config_target = config_target_mak[target]
- target_base_arch = config_target['TARGET_BASE_ARCH']
-
- # check if already generated
- if target_base_arch in hw_common_arch_libs
- continue
- endif
-
+foreach target_base_arch, config_base_arch : config_base_arch_mak
if target_base_arch in hw_common_arch
+ base_arch_hw = hw_common_arch[target_base_arch].apply(config_base_arch, strict: false)
+ base_arch_common = common_ss.apply(config_base_arch, strict: false)
+
+ lib_deps = base_arch_hw.dependencies()
+ foreach dep : base_arch_common.dependencies()
+ lib_deps += dep.partial_dependency(compile_args: true, includes: true)
+ endforeach
+
target_inc = [include_directories('target' / target_base_arch)]
- src = hw_common_arch[target_base_arch]
lib = static_library(
'hw_' + target_base_arch,
build_by_default: false,
- sources: src.all_sources() + genh,
+ sources: base_arch_hw.sources() + genh,
include_directories: common_user_inc + target_inc,
implicit_include_directories: false,
# prevent common code to access cpu compile time
# definition, but still allow access to cpu.h
c_args: ['-DCPU_DEFS_H', '-DCOMPILING_SYSTEM_VS_USER', '-DCONFIG_SOFTMMU'],
- dependencies: src.all_dependencies())
+ dependencies: lib_deps)
hw_common_arch_libs += {target_base_arch: lib}
endif
endforeach
(It passes at least "make libhw_arm.a" here).
Paolo
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 5/5] Revert "meson.build: Disable -fzero-call-used-regs on OpenBSD"
2025-05-08 10:05 ` Daniel P. Berrangé
2025-05-08 10:12 ` Thomas Huth
@ 2025-05-10 0:21 ` Brad Smith
1 sibling, 0 replies; 15+ messages in thread
From: Brad Smith @ 2025-05-10 0:21 UTC (permalink / raw)
To: Daniel P. Berrangé, Thomas Huth
Cc: Peter Maydell, qemu-arm, Warner Losh, Paolo Bonzini,
Marc-André Lureau
[-- Attachment #1: Type: text/plain, Size: 783 bytes --]
On 2025-05-08 6:05 a.m., Daniel P. Berrangé wrote:
> On Thu, May 08, 2025 at 11:35:19AM +0200, Thomas Huth wrote:
>> From: Thomas Huth<thuth@redhat.com>
>>
>> This reverts commit 2d6d995709482cc8b6a76dbb5334a28001a14a9a.
>>
>> OpenBSD 7.7 fixed the problem with the -fzero-call-used-regs on OpenBSD,
>> seehttps://github.com/openbsd/src/commit/03eca72d1e030b7a542cd6aec1 for
>> the fix there.
> Is that fix also backported to OpenBS 7.6 ?
>
> We support the 2 most recent releases of each platform, so for OpenBSD
> thats currently 7.6 and 7.7.
>
> If it wasn't backported to 7.6, we must wait until 7.8 before we can
> rely on the fix being present.
I was under the impression it was only 1.
Oh well. Just means waiting until end of Oct for the next release.
[-- Attachment #2: Type: text/html, Size: 1511 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2025-05-10 0:21 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-08 9:35 [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7 Thomas Huth
2025-05-08 9:35 ` [PATCH 1/5] include/hw/dma/xlnx_dpdma: Remove dependency on console.h Thomas Huth
2025-05-08 9:35 ` [PATCH 2/5] hw/display/bcm2835_fb: Move inclusion of console.h to the .c file Thomas Huth
2025-05-08 9:35 ` [PATCH 3/5] hw/arm: Compile musicpal and the xlnx machines with the right CFLAGS Thomas Huth
2025-05-08 12:11 ` Peter Maydell
2025-05-08 12:45 ` Paolo Bonzini
2025-05-08 9:35 ` [PATCH 4/5] tests/vm: Update OpenBSD to 7.7 Thomas Huth
2025-05-08 9:35 ` [PATCH 5/5] Revert "meson.build: Disable -fzero-call-used-regs on OpenBSD" Thomas Huth
2025-05-08 10:05 ` Daniel P. Berrangé
2025-05-08 10:12 ` Thomas Huth
2025-05-08 10:17 ` Paolo Bonzini
2025-05-08 10:24 ` Thomas Huth
2025-05-10 0:21 ` Brad Smith
2025-05-08 12:12 ` [PATCH 0/5] Fix dependencies in arm machines and update OpenBSD to 7.7 Peter Maydell
2025-05-08 12:39 ` Thomas Huth
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.