analogdevicesinc/libiio

undefined reference to io_getevents

ZeroChaos- opened this issue · 2 comments

I am unable to build with gcc 13 on gentoo, I can provide more build log if needed, but the error is

[45/49] /usr/bin/x86_64-pc-linux-gnu-gcc -DLIBIIO_EXPORTS=1 -D_GNU_SOURCE=1 -D_POSIX_C_SOURCE=200809L -D__XSI_VISIBLE=500 -I/usr/include/libusb-1.0 -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25 -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25_build -I/usr/include/libxml2 -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25_build/iiod -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25/iiod  -march=native -mtune=native -ggdb3 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Wpedantic -Wshadow -std=c99 -Wno-sign-compare -MD -MT iiod/CMakeFiles/iiod.dir/lexer.c.o -MF iiod/CMakeFiles/iiod.dir/lexer.c.o.d -o iiod/CMakeFiles/iiod.dir/lexer.c.o -c /var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25_build/iiod/lexer.c
[46/49] /usr/bin/x86_64-pc-linux-gnu-gcc -DLIBIIO_EXPORTS=1 -D_GNU_SOURCE=1 -D_POSIX_C_SOURCE=200809L -D__XSI_VISIBLE=500 -I/usr/include/libusb-1.0 -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25 -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25_build -I/usr/include/libxml2 -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25_build/iiod -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25/iiod  -march=native -mtune=native -ggdb3 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Wpedantic -Wshadow -std=c99 -MD -MT iiod/CMakeFiles/iiod.dir/usbd.c.o -MF iiod/CMakeFiles/iiod.dir/usbd.c.o.d -o iiod/CMakeFiles/iiod.dir/usbd.c.o -c /var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25/iiod/usbd.c
[47/49] /usr/bin/x86_64-pc-linux-gnu-gcc -DLIBIIO_EXPORTS=1 -D_GNU_SOURCE=1 -D_POSIX_C_SOURCE=200809L -D__XSI_VISIBLE=500 -I/usr/include/libusb-1.0 -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25 -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25_build -I/usr/include/libxml2 -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25_build/iiod -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25/iiod  -march=native -mtune=native -ggdb3 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Wpedantic -Wshadow -std=c99 -MD -MT iiod/CMakeFiles/iiod.dir/serial.c.o -MF iiod/CMakeFiles/iiod.dir/serial.c.o.d -o iiod/CMakeFiles/iiod.dir/serial.c.o -c /var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25/iiod/serial.c
[48/49] /usr/bin/x86_64-pc-linux-gnu-gcc -DLIBIIO_EXPORTS=1 -D_GNU_SOURCE=1 -D_POSIX_C_SOURCE=200809L -D__XSI_VISIBLE=500 -I/usr/include/libusb-1.0 -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25 -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25_build -I/usr/include/libxml2 -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25_build/iiod -I/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25/iiod  -march=native -mtune=native -ggdb3 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Wpedantic -Wshadow -std=c99 -MD -MT iiod/CMakeFiles/iiod.dir/dns-sd.c.o -MF iiod/CMakeFiles/iiod.dir/dns-sd.c.o.d -o iiod/CMakeFiles/iiod.dir/dns-sd.c.o -c /var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25/iiod/dns-sd.c
[49/49] : && /usr/bin/x86_64-pc-linux-gnu-gcc -march=native -mtune=native -ggdb3 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Wpedantic -Wshadow -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 iiod/CMakeFiles/iiod.dir/iiod.c.o iiod/CMakeFiles/iiod.dir/ops.c.o iiod/CMakeFiles/iiod.dir/thread-pool.c.o iiod/CMakeFiles/iiod.dir/parser.c.o iiod/CMakeFiles/iiod.dir/lexer.c.o iiod/CMakeFiles/iiod.dir/usbd.c.o iiod/CMakeFiles/iiod.dir/serial.c.o iiod/CMakeFiles/iiod.dir/dns-sd.c.o -o iiod/iiod  -Wl,-rpath,/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25_build:  libiio.so.0.25  /usr/lib64/libpthread.a  /usr/lib64/libavahi-client.so  /usr/lib64/libavahi-common.so  -laio && :
FAILED: iiod/iiod 
: && /usr/bin/x86_64-pc-linux-gnu-gcc -march=native -mtune=native -ggdb3 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Wpedantic -Wshadow -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 iiod/CMakeFiles/iiod.dir/iiod.c.o iiod/CMakeFiles/iiod.dir/ops.c.o iiod/CMakeFiles/iiod.dir/thread-pool.c.o iiod/CMakeFiles/iiod.dir/parser.c.o iiod/CMakeFiles/iiod.dir/lexer.c.o iiod/CMakeFiles/iiod.dir/usbd.c.o iiod/CMakeFiles/iiod.dir/serial.c.o iiod/CMakeFiles/iiod.dir/dns-sd.c.o -o iiod/iiod  -Wl,-rpath,/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25_build:  libiio.so.0.25  /usr/lib64/libpthread.a  /usr/lib64/libavahi-client.so  /usr/lib64/libavahi-common.so  -laio && :
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: iiod/CMakeFiles/iiod.dir/ops.c.o: in function `async_io':
/var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25/iiod/ops.c:203:(.text+0x5e7): undefined reference to `io_getevents'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/net-libs/libiio-0.25/work/libiio-0.25/iiod/ops.c:213:(.text+0x679): undefined reference to `io_cancel'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

-DWITH_AIO=no builds successfully but -DWITH_AIO=yes fails with the above message
I have libaio-0.3.113 installed

Ugh, apologies, I rebuilt libaio for fun and now it works. Something on my side was broken, sorry for the noise.