From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PULL 12/12] meson: Link with libinotify on FreeBSD
Date: Tue, 6 Feb 2024 11:43:47 +0100 [thread overview]
Message-ID: <20240206104347.238825-13-thuth@redhat.com> (raw)
In-Reply-To: <20240206104347.238825-1-thuth@redhat.com>
From: Ilya Leoshkevich <iii@linux.ibm.com>
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 the inotify functions are defined in libinotify.so. Add it
to the dependencies.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20240206002344.12372-5-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
meson.build | 23 +++++++++++++++++++----
util/meson.build | 6 +++++-
2 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/meson.build b/meson.build
index b5d6dc94a8..e5d6f2d057 100644
--- a/meson.build
+++ b/meson.build
@@ -2384,6 +2384,22 @@ else
endif
config_host_data.set('CONFIG_ASAN_IFACE_FIBER', have_asan_fiber)
+have_inotify_init = cc.has_header_symbol('sys/inotify.h', 'inotify_init')
+have_inotify_init1 = cc.has_header_symbol('sys/inotify.h', 'inotify_init1')
+inotify = not_found
+if (have_inotify_init or have_inotify_init1) and host_os == 'freebsd'
+ # libinotify-kqueue
+ inotify = cc.find_library('inotify')
+ if have_inotify_init
+ have_inotify_init = inotify.found()
+ endif
+ if have_inotify_init1
+ have_inotify_init1 = inotify.found()
+ endif
+endif
+config_host_data.set('CONFIG_INOTIFY', have_inotify_init)
+config_host_data.set('CONFIG_INOTIFY1', have_inotify_init1)
+
# has_header_symbol
config_host_data.set('CONFIG_BLKZONED',
cc.has_header_symbol('linux/blkzoned.h', 'BLKOPENZONE'))
@@ -2400,10 +2416,6 @@ config_host_data.set('CONFIG_FIEMAP',
config_host_data.set('CONFIG_GETRANDOM',
cc.has_function('getrandom') and
cc.has_header_symbol('sys/random.h', 'GRND_NONBLOCK'))
-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_PRCTL_PR_SET_TIMERSLACK',
cc.has_header_symbol('sys/prctl.h', 'PR_SET_TIMERSLACK'))
config_host_data.set('CONFIG_RTNETLINK',
@@ -4407,6 +4419,9 @@ summary_info += {'libudev': libudev}
summary_info += {'FUSE lseek': fuse_lseek.found()}
summary_info += {'selinux': selinux}
summary_info += {'libdw': libdw}
+if host_os == 'freebsd'
+ summary_info += {'libinotify-kqueue': inotify}
+endif
summary(summary_info, bool_yn: true, section: 'Dependencies')
if host_arch == 'unknown'
diff --git a/util/meson.build b/util/meson.build
index af3bf5692d..0ef9886be0 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -104,7 +104,11 @@ if have_block
util_ss.add(files('throttle.c'))
util_ss.add(files('timed-average.c'))
if config_host_data.get('CONFIG_INOTIFY1')
- util_ss.add(files('filemonitor-inotify.c'))
+ freebsd_dep = []
+ if host_os == 'freebsd'
+ freebsd_dep = inotify
+ endif
+ util_ss.add(files('filemonitor-inotify.c'), freebsd_dep)
else
util_ss.add(files('filemonitor-stub.c'))
endif
--
2.43.0
next prev parent reply other threads:[~2024-02-06 10:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-06 10:43 [PULL 00/12] s390x, tests and misc. patches Thomas Huth
2024-02-06 10:43 ` [PULL 01/12] hw/scsi/lsi53c895a: add missing decrement of reentrancy counter Thomas Huth
2024-02-06 10:43 ` [PULL 02/12] target/ppc/cpu-models: Rename power5+ and power7+ for new QOM naming rules Thomas Huth
2024-02-06 10:43 ` [PULL 03/12] docs/about: Deprecate the old "power5+" and "power7+" CPU names Thomas Huth
2024-02-06 10:43 ` [PULL 04/12] target/s390x: Emulate CVDG Thomas Huth
2024-02-06 10:43 ` [PULL 05/12] target/s390x: Emulate CVB, CVBY and CVBG Thomas Huth
2024-02-06 10:43 ` [PULL 06/12] tests/tcg/s390x: Test CONVERT TO DECIMAL Thomas Huth
2024-02-06 10:43 ` [PULL 07/12] tests/tcg/s390x: Test CONVERT TO BINARY Thomas Huth
2024-02-06 10:43 ` [PULL 08/12] target/s390x: Prefer fast cpu_env() over slower CPU QOM cast macro Thomas Huth
2024-02-06 10:43 ` [PULL 09/12] tests/vm: Set UseDNS=no in the sshd configuration Thomas Huth
2024-02-06 10:43 ` [PULL 10/12] tests/vm/freebsd: Reload " Thomas Huth
2024-02-06 10:43 ` [PULL 11/12] test-util-filemonitor: Adapt to the FreeBSD inotify rename semantics Thomas Huth
2024-02-06 10:43 ` Thomas Huth [this message]
2024-02-08 16:07 ` [PULL 00/12] s390x, tests and misc. patches Peter Maydell
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=20240206104347.238825-13-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=iii@linux.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).