În mie., 7 iul. 2021 la 10:32, Paolo Bonzini <pbonz...@redhat.com> a scris:

> On 07/07/21 05:24, Richard Zak wrote:
> > What conditions are required for "#define CONFIG_PIPE2" to be set in
> > build/config-host.h? It prevents building for Haiku as pipe2() doesn't
> > exist. I didn't see anything in the configure script regarding pipe2. I
> > also updated my code to the latest in the repository and this issue just
> > popped up.
>
> Does this help?
>
> diff --git a/meson.build b/meson.build
> index 660e294b7e..32d5bd3685 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1339,7 +1339,7 @@ config_host_data.set('HAVE_STRUCT_STAT_ST_ATIM',
>   config_host_data.set('CONFIG_EVENTFD', cc.compiles('''
>     #include <sys/eventfd.h>
>     int main(void) { return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); }'''))
> -config_host_data.set('CONFIG_FDATASYNC', cc.compiles(gnu_source_prefix +
> '''
> +config_host_data.set('CONFIG_FDATASYNC', cc.links(gnu_source_prefix + '''
>     #include <unistd.h>
>     int main(void) {
>     #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
> @@ -1356,14 +1356,14 @@ config_host_data.set('CONFIG_MADVISE',
> cc.compiles(gnu_source_prefix + '''
>   config_host_data.set('CONFIG_MEMFD', cc.compiles(gnu_source_prefix + '''
>     #include <sys/mman.h>
>     int main(void) { return memfd_create("foo", MFD_ALLOW_SEALING); }'''))
> -config_host_data.set('CONFIG_OPEN_BY_HANDLE',
> cc.compiles(gnu_source_prefix + '''
> +config_host_data.set('CONFIG_OPEN_BY_HANDLE', cc.links(gnu_source_prefix
> + '''
>     #include <fcntl.h>
>     #if !defined(AT_EMPTY_PATH)
>     # error missing definition
>     #else
>     int main(void) { struct file_handle fh; return open_by_handle_at(0,
> &fh, 0); }
>     #endif'''))
> -config_host_data.set('CONFIG_PIPE2', cc.compiles(gnu_source_prefix + '''
> +config_host_data.set('CONFIG_PIPE2', cc.links(gnu_source_prefix + '''
>     #include <unistd.h>
>     #include <fcntl.h>
>
> ?
>
> Paolo
>
>
That did it! build/config-host.h now has "#undef CONFIG_PIPE2" and the code
compiles.

-- 
Regards,

Richard J. Zak
Professional Genius
PGP Key: https://keybase.io/rjzak/key.asc

Reply via email to