meson: Fix targetos match for illumos and Solaris.
Subsystems (2)
PATCH 1/1 meson: Fix targetos match for illumos and Solaris.
qemu 8.1.0 breaks on illumos platforms due to _XOPEN_SOURCE and others no longer being set correctly, leading to breakage such as:
https://us-central.manta.mnx.io/pkgsrc/public/reports/trunk/tools/20230908.1404/qemu-8.1.0/build.log
This is a result of meson conversion which incorrectly matches against 'solaris' instead of 'sunos' for uname.
First time submitting a patch here, hope I did it correctly. Thanks.
--- meson.build | 4 ++-- net/meson.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
meson.build +2 -2
@@ -226,7 +226,7 @@ if targetos == 'darwin' if compiler.get_id() == 'gcc' qemu_common_flags += '-DOS_OBJECT_USE_OBJC=0' endif -elif targetos == 'solaris' +elif targetos == 'sunos' # needed for CMSG_ macros in sys/socket.h qemu_common_flags += '-D_XOPEN_SOURCE=600' # needed for TIOCWIN* defines in termios.h
@@ -2048,7 +2048,7 @@ have_slirp_smbd = get_option('slirp_smbd') \ if have_slirp_smbd smbd_path = get_option('smbd') if smbd_path == '' - smbd_path = (targetos == 'solaris' ? '/usr/sfw/sbin/smbd' : '/usr/sbin/smbd') + smbd_path = (targetos == 'sunos' ? '/usr/sfw/sbin/smbd' : '/usr/sbin/smbd') endif config_host_data.set_quoted('CONFIG_SMBD_COMMAND', smbd_path) endif
net/meson.build +1 -1
@@ -47,7 +47,7 @@ elif targetos == 'linux' system_ss.add(files('tap.c', 'tap-linux.c')) elif targetos in bsd_oses system_ss.add(files('tap.c', 'tap-bsd.c')) -elif targetos == 'solaris' +elif targetos == 'sunos' system_ss.add(files('tap.c', 'tap-solaris.c')) else system_ss.add(files('tap.c', 'tap-stub.c'))
Signature · 1 line
2.42.0
Paolo Bonzini
AppliedQueued, thanks.
Paolo
Quoted 4 lines · Jonathan Perkin
qemu 8.1.0 breaks on illumos platforms due to
_XOPEN_SOURCEand others no longer being set correctly, leading to breakage such as:https://us-central.manta.mnx.io/pkgsrc/public/reports/trunk/tools/20230908.1404/qemu-8.1.0/build.log
Paolo if you don't mind please replace this link
(which is likely going to disappear) by:
In file included from include/qemu/osdep.h:151,
from ../qom/container.c:13:
include/sysemu/os-posix.h: In function 'qemu_flockfile':
include/sysemu/os-posix.h:88:5: warning: implicit declaration of function 'flockfile' [-Wimplicit-function-declaration]
88 | flockfile(f);
| ^~~~~~~~~include/sysemu/os-posix.h:88:5: warning: nested extern declaration of 'flockfile' [-Wnested-externs]
../util/compatfd.c: In function 'sigwait_compat':../util/compatfd.c:36:15: error: too many arguments to function 'sigwait'
36 | err = sigwait(&info->mask, &sig);
| ^~~~~~~
In file included from include/qemu/osdep.h:117,
from ../util/compatfd.c:16:
/usr/include/signal.h:165:12: note: declared here
165 | extern int sigwait(sigset_t *);
| ^~~~~~~Quoted 16 lines
This is a result of meson conversion which incorrectly matches against 'solaris' instead of 'sunos' for uname.
First time submitting a patch here, hope I did it correctly. Thanks.
Signed-off-by Jonathan Perkin <[email protected]>--- meson.build | 4 ++-- net/meson.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)meson.build +0
-0
meson.build if targetos == 'darwin' · line 229
Quoted 5 lines
meson.build +1
-1@@ -226,7 +226,7 @@ if targetos == 'darwin' if compiler.get_id() == 'gcc' qemu_common_flags += '-DOS_OBJECT_USE_OBJC=0' endif -elif targetos == 'solaris' +elif targetos == 'sunos'
Commit a988b4c561 from Oct 2022... I'm surprised nobody tried to build QEMU on illumos for almost 1 year...
Quoted 27 lines
meson.build +1
-1# needed for CMSG_ macros in sys/socket.h qemu_common_flags += '-D_XOPEN_SOURCE=600' # needed for TIOCWIN* defines in termios.h@@ -2048,7 +2048,7 @@ have_slirp_smbd = get_option('slirp_smbd') \ if have_slirp_smbd smbd_path = get_option('smbd') if smbd_path == '' - smbd_path = (targetos == 'solaris' ? '/usr/sfw/sbin/smbd' : '/usr/sbin/smbd') + smbd_path = (targetos == 'sunos' ? '/usr/sfw/sbin/smbd' : '/usr/sbin/smbd') endif
config_host_data.set_quoted('CONFIG_SMBD_COMMAND', smbd_path)endifnet/meson.build +1
-1@@ -47,7 +47,7 @@ elif targetos == 'linux' system_ss.add(files('tap.c', 'tap-linux.c')) elif targetos in bsd_oses system_ss.add(files('tap.c', 'tap-bsd.c')) -elif targetos == 'solaris' +elif targetos == 'sunos' system_ss.add(files('tap.c', 'tap-solaris.c')) else system_ss.add(files('tap.c', 'tap-stub.c'))