On 4/28/21 6:38 PM, Richard Henderson wrote: > On 4/28/21 7:48 AM, Philippe Mathieu-Daudé wrote: >> diff --git a/util/meson.build b/util/meson.build >> index 510765cde46..c2eda2d1374 100644 >> --- a/util/meson.build >> +++ b/util/meson.build >> @@ -59,12 +59,10 @@ >> util_ss.add(files('aiocb.c', 'async.c', 'aio-wait.c')) >> util_ss.add(files('base64.c')) >> util_ss.add(files('buffer.c')) >> - util_ss.add(files('bufferiszero.c')) >> >> util_ss.add(files('coroutine-@0@.c'.format(config_host['CONFIG_COROUTINE_BACKEND']))) >> >> util_ss.add(files('hbitmap.c')) >> - util_ss.add(files('hexdump.c')) >> util_ss.add(files('iova-tree.c')) >> - util_ss.add(files('iov.c', 'qemu-sockets.c', 'uri.c')) >> + util_ss.add(files('qemu-sockets.c', 'uri.c')) >> util_ss.add(files('lockcnt.c')) >> util_ss.add(files('main-loop.c')) >> util_ss.add(files('nvdimm-utils.c')) >> @@ -83,3 +81,9 @@ >> if_false: >> files('filemonitor-stub.c')) >> util_ss.add(when: 'CONFIG_LINUX', if_true: files('vfio-helpers.c')) >> endif >> + >> +if have_block or config_host.has_key('CONFIG_VHOST_USER_FS') >> + util_ss.add(files('hexdump.c')) >> + util_ss.add(files('bufferiszero.c')) >> + util_ss.add(files('iov.c')) >> +endif > > Isn't util a static library, built once? Why are we avoiding building > these unconditionally? Surely symbols will be included in any linked > binaries only as needed.
Yes, in this case built once for $ configure --target-list=i386-linux-user --disable-tools --enable-virtiofsd. Are you suggesting to remove the 'if have_block' check? This makes build a the files pointlessly for user-mode-only builds...