Skip to contentSkip to conversation

total fail on FreeBSD 14.0 amd64 regardless of compiler

DISCUSSION Dennis Clarke 3 participants 4 messages Oct 10, 2022

lore
Share & tools
lore
#0 lore raw

re: https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg01249.html

Using GCC 12 is even worse :

[2040/6841] Compiling C object qemu-system-aarch64.p/softmmu_main.c.o
[2041/6841] Linking target qemu-system-aarch64
FAILED: qemu-system-aarch64
/usr/local/bin/g++12 -m64 -mcx16 @qemu-system-aarch64.rsp
/usr/local/bin/ld: libqemuutil.a.p/util_filemonitor-inotify.c.o: undefined reference to symbol 'inotify_init1' /usr/local/bin/ld: /usr/local/lib/libinotify.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
gmake[1]: *** [Makefile:165: run-ninja] Error 1
gmake[1]: Leaving directory '/opt/bw/build/qemu/build'
gmake: *** [GNUmakefile:11: all] Error 2

So whats the magic here ?

Signature · 4 lines
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional
#1 lore raw
Quoted 10 lines · Dennis Clarke

re: https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg01249.html

Using GCC 12 is even worse :

[2040/6841] Compiling C object qemu-system-aarch64.p/softmmu_main.c.o
[2041/6841] Linking target qemu-system-aarch64
FAILED: qemu-system-aarch64
/usr/local/bin/g++12 -m64 -mcx16 @qemu-system-aarch64.rsp
/usr/local/bin/ld: libqemuutil.a.p/util_filemonitor-inotify.c.o: undefined reference to symbol 'inotify_init1'

Now that sounds like the detection for inotify_init1 did not work right in the meson.build script...

Looking at meson.build:

config_host_data.set('CONFIG_INOTIFY1',

                     cc.has_header_symbol('sys/inotify.h', 'inotify_init1'))

... do you have such a "inotify.h" header on your FreeBSD system and does it contain an inotify_init1 function?

Thomas

#2 lore raw
Quoted 17 lines · Thomas Huth
Quoted 10 lines · Dennis Clarke

re: https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg01249.html

Using GCC 12 is even worse :

[2040/6841] Compiling C object qemu-system-aarch64.p/softmmu_main.c.o
[2041/6841] Linking target qemu-system-aarch64
FAILED: qemu-system-aarch64
/usr/local/bin/g++12 -m64 -mcx16 @qemu-system-aarch64.rsp
/usr/local/bin/ld: libqemuutil.a.p/util_filemonitor-inotify.c.o: undefined reference to symbol 'inotify_init1'

Now that sounds like the detection for inotify_init1 did not work right in the meson.build script...

Looking at meson.build:

Quoted 8 lines

config_host_data.set('CONFIG_INOTIFY1',
                     cc.has_header_symbol('sys/inotify.h',
'inotify_init1'))

... do you have such a "inotify.h" header on your FreeBSD system and does it contain an inotify_init1 function?

 Thomas

Let's see :

phobos#
phobos# uname -apKU
FreeBSD phobos 14.0-CURRENT FreeBSD 14.0-CURRENT #14 main-n258340-497cdf9673e: Sun Oct 2 09:51:14 GMT 2022 root@phobos:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 amd64 1400072 1400072 phobos# ls -lap /usr/local/include/sys/inotify.h
-rw-r--r-- 1 root wheel 4540 Oct 4 01:24 /usr/local/include/sys/inotify.h
phobos#
phobos# grep 'inotify_init1' /usr/local/include/sys/inotify.h
/* Flags for the parameter of inotify_init1. */
int inotify_init1 (int flags) __THROW;
phobos#

Looks to be there.

Signature · 4 lines
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional
#3 lore raw
In reply to Dennis Clarke
Quoted 5 lines · Dennis Clarke

re: https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg01249.html

Using GCC 12 is even worse :

Quoted 8 lines

[2040/6841] Compiling C object qemu-system-aarch64.p/softmmu_main.c.o [2041/6841] Linking target qemu-system-aarch64
FAILED: qemu-system-aarch64
/usr/local/bin/g++12 -m64 -mcx16 @qemu-system-aarch64.rsp /usr/local/bin/ld: libqemuutil.a.p/util_filemonitor-inotify.c.o: undefined reference to symbol 'inotify_init1'
/usr/local/bin/ld: /usr/local/lib/libinotify.so.0: error adding symbols: DSO missing from command line

This is trying to tell us that inotify_init1 is in libinotify.so.0 but we have not put -linotify on the command line for the link step. On Linux these are a standard part of glibc, but on FreeBSD they are separate.

I'm thinking that in previous FreeBSD we probably got this linked indirectly, but something in 14.0 has become stricer, wanting it listed explicitly.

IOW, a meson.build change is likely needed to add -linotify on FreeBSD.

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|