On Mon, 15 Nov 2021 at 16:36, Peter Maydell <peter.mayd...@linaro.org> wrote: > > On Thu, 14 Oct 2021 at 17:49, Paolo Bonzini <pbonz...@redhat.com> wrote: > > > > Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> > > Message-Id: <20211007130829.632254-15-pbonz...@redhat.com> > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > > --- > > configure | 91 ------------------------------------------------ > > meson.build | 44 +++++++++++++++++++++++ > > util/meson.build | 4 ++- > > 3 files changed, 47 insertions(+), 92 deletions(-) > > > > diff --git a/meson.build b/meson.build > > index 6bf43e6d30..6b7487b725 100644 > > --- a/meson.build > > +++ b/meson.build > > @@ -1550,6 +1550,8 @@ config_host_data.set('CONFIG_INOTIFY', > > cc.has_header_symbol('sys/inotify.h', 'inotify_init')) > > config_host_data.set('CONFIG_INOTIFY1', > > cc.has_header_symbol('sys/inotify.h', > > 'inotify_init1')) > > +config_host_data.set('CONFIG_IOVEC', > > + cc.has_header_symbol('sys/uio.h', 'struct iovec')) > > config_host_data.set('CONFIG_MACHINE_BSWAP_H', > > cc.has_header_symbol('machine/bswap.h', 'bswap32', > > prefix: '''#include > > <sys/endian.h> > > Hi -- I've just noticed that this change breaks compilation for me, > because this test incorrectly fails to set CONFIG_IOVEC on a system > where the header defines 'struct iovec'. This seems to be because > "struct iovec" isn't a valid thing to test with has_header_symbol, > because it provokes a compiler error from clang.
https://github.com/mesonbuild/meson/issues/1975 says that for gcc it's actually going to be wrong the other way (always setting CONFIG_IOVEC whether the system header has the struct or not), because "struct wombat;" is syntactically OK as a *declaration*, not a use. Maybe we can work around this by testing for the presence of something else, eg IOV_MAX or the readv or writev functions ? -- PMM