lvm2-2.02.181 depends on dev-libs/libaio. It is probably not needed with USE=device-mapper-only.
Created attachment 542642 [details] Emerge text Confirmed this bug in ~arm64[device-mapper-only, readline, systemd, udev]; the build completes successfully with libaio installed.
Additionally, lvm2[static] needs libaio[static-libs]. Otherwise the build fails even with libaio installed, since libaio.a is missing.
(In reply to Erik Fjeldstrom from comment #1) > Created attachment 542642 [details] > Emerge text > > Confirmed this bug in ~arm64[device-mapper-only, readline, systemd, udev]; Yes, build system unconditionally checks for libaio.h even if it is not needed (USE=device-mapper-only): https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ad756bb7083743b612d3fc66b268b605576f448a
Hmmm, installing libaio did not solve the problem for me, the build still fails with libaio installed. (I'm not building static libs). The problem now is that for unknown reasons, my libaio.so does not provide io_getevents, but lvm2 needs io_getevents: nm -D libaio.so.1.0.1 w __cxa_finalize w __gmon_start__ 00000000000006e0 T io_destroy U io_getevents 0000000000000780 T io_queue_init 0000000000000770 T io_queue_release 0000000000000710 T io_queue_run 00000000000006f0 T io_setup 0000000000000700 T io_submit w _ITM_deregisterTMCloneTable w _ITM_registerTMCloneTable 0000000000000000 A LIBAIO_0.1 0000000000000000 A LIBAIO_0.4 lvm2 build log: [LN] liblvm2app.so.2.2 ../liblvm/liblvm2app.so: undefined reference to `io_getevents' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:92: lvm2_activation_generator_systemd_red_hat] Error 1 make[1]: Leaving directory '/var/portage/portage/sys-fs/lvm2-2.02.181/work/LVM2.2.02.181/scripts' make: *** [make.tmpl:358: scripts] Error 2 ... [CC] liblvm2cmd.so [LN] liblvm2cmd.so.2.02 ../lib/liblvm-internal.a(bcache.o): In function `_async_wait': bcache.c:(.text+0x265): undefined reference to `io_getevents' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:148: lvm] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory '/var/portage/portage/sys-fs/lvm2-2.02.181/work/LVM2.2.02.181/tools' make: *** [make.tmpl:358: tools] Error 2 * ERROR: sys-fs/lvm2-2.02.181::gentoo failed (compile phase): * emake failed
Sorry for the noise, not a problem of lvm2: libaio does not like lto. Everything's fine when emerging libaio no-lto.
*** This bug has been marked as a duplicate of bug 664738 ***