qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: "Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Ed Maste" <emaste@freebsd.org>, "Li-Wen Hsu" <lwhsu@freebsd.org>,
	"Warner Losh" <imp@bsdimp.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Beraldo Leal" <bleal@redhat.com>,
	"Kyle Evans" <kevans@freebsd.org>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v2 4/4] meson: Link with libinotify on FreeBSD
Date: Mon, 5 Feb 2024 19:36:32 +0100	[thread overview]
Message-ID: <b6ab054b-47b4-49e5-ada7-6a407d54207b@linaro.org> (raw)
In-Reply-To: <20240205181352.1567-5-iii@linux.ibm.com>

Hi Ilya,

On 5/2/24 19:11, Ilya Leoshkevich wrote:
> make vm-build-freebsd fails with:
> 
>      ld: error: undefined symbol: inotify_init1
>      >>> referenced by filemonitor-inotify.c:183 (../src/util/filemonitor-inotify.c:183)
>      >>>               util_filemonitor-inotify.c.o:(qemu_file_monitor_new) in archive libqemuutil.a
> 
> On FreeBSD inotify functions are defined in libinotify.so. Add it to
> the dependencies.
> 
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>   meson.build      | 12 +++++++++++-
>   util/meson.build |  6 +++++-
>   2 files changed, 16 insertions(+), 2 deletions(-)

(for some reason your git-diff context is very verbose,
  making review somehow annoying).

> +# libinotify-kqueue
> +inotify = not_found
> +if host_os == 'freebsd'
> +  inotify = cc.find_library('inotify')
> +endif
> +
>   #################
>   # config-host.h #
>   #################
>   


> @@ -2376,61 +2382,62 @@ have_asan_fiber = false
>   if get_option('sanitizers') and \
>      not cc.has_function('__sanitizer_start_switch_fiber',
>                            args: '-fsanitize=address',
>                            prefix: '#include <sanitizer/asan_interface.h>')
>     warning('Missing ASAN due to missing fiber annotation interface')
>     warning('Without code annotation, the report may be inferior.')
>   else
>     have_asan_fiber = true
>   endif
>   config_host_data.set('CONFIG_ASAN_IFACE_FIBER', have_asan_fiber)
>   
>   # has_header_symbol


>   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'))
> +                     cc.has_header_symbol('sys/inotify.h', 'inotify_init1') and
> +                     (host_os != 'freebsd' or inotify.found()))

Maybe we could use the same pattern as 'have_asan_fiber':

  have_inotify_init1 = cc.has_header_symbol('sys/inotify.h', 
'inotify_init1')
  if have_inotify_init1 and host_os == 'freebsd'
    have_inotify_init1 = cc.find_library('inotify')
  endif
  config_host_data.set('CONFIG_INOTIFY1', have_inotify_init1)

I wonder why we don't need the similar library check for the
inotify_init symbol.

Regards,

Phil.


  reply	other threads:[~2024-02-05 18:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 18:11 [PATCH v2 0/4] make vm-build-freebsd fixes Ilya Leoshkevich
2024-02-05 18:11 ` [PATCH v2 1/4] tests/vm: Set UseDNS=no in the sshd configuration Ilya Leoshkevich
2024-02-05 18:11 ` [PATCH v2 2/4] tests/vm/freebsd: Reload " Ilya Leoshkevich
2024-02-05 18:54   ` Thomas Huth
2024-02-05 18:11 ` [PATCH v2 3/4] tests/test-util-filemonitor: Adapt to FreeBSD inotify rename semantics Ilya Leoshkevich
2024-02-05 18:11 ` [PATCH v2 4/4] meson: Link with libinotify on FreeBSD Ilya Leoshkevich
2024-02-05 18:36   ` Philippe Mathieu-Daudé [this message]
2024-02-05 18:55     ` Ilya Leoshkevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b6ab054b-47b4-49e5-ada7-6a407d54207b@linaro.org \
    --to=philmd@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=emaste@freebsd.org \
    --cc=iii@linux.ibm.com \
    --cc=imp@bsdimp.com \
    --cc=kevans@freebsd.org \
    --cc=lwhsu@freebsd.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).