You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, although #12 is helpful, I encountered the same problem again after I installed autoconf-archive. I used ./build_with_liburing_src to build ubdsrv. But the linker could not find pthread. See:
It is reported that on some distributions ax_pthread.m4 in
autoconf-archive package doesn't work as expected.
Address issue #35.
Reported-by: ZiyangZhang <ZiyangZhang@linux.alibaba.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Hi, although #12 is helpful, I encountered the same problem again after I installed autoconf-archive. I used ./build_with_liburing_src to build ubdsrv. But the linker could not find pthread. See:
libtool: link: gcc -Wall -Werror -Wuninitialized -Wmaybe-uninitialized -Wno-sign-compare -Wno-parentheses -Wvla -Wframe-larger-than=5000 -Wstack-usage=10000 -pthread -I/root/liburing-liburing-2.2/src/include -g -O0 -o .libs/demo_event demo_event-demo_event.o -L/root/liburing-liburing-2.2/src lib/.libs/libublksrv.so -L/usr/lib -luring -pthread -Wl,-rpath -Wl,/usr/local/lib
mv -f qcow2/.deps/ublk-qcow2_flush_meta.Tpo qcow2/.deps/ublk-qcow2_flush_meta.Po
/bin/sh ./libtool --tag=CXX --mode=link g++ -fcoroutines -std=c++20 -I/root/liburing-liburing-2.2/src/include -g -O0 -L/root/liburing-liburing-2.2/src -o ublk ublk-ublksrv_tgt.o ublk-tgt_null.o ublk-tgt_loop.o qcow2/ublk-tgt_qcow2.o qcow2/ublk-qcow2.o qcow2/ublk-qcow2_meta.o qcow2/ublk-utils.o qcow2/ublk-qcow2_flush_meta.o lib/libublksrv.la -L/usr/lib -luring
libtool: link: g++ -fcoroutines -std=c++20 -I/root/liburing-liburing-2.2/src/include -g -O0 -o .libs/ublk ublk-ublksrv_tgt.o ublk-tgt_null.o ublk-tgt_loop.o qcow2/ublk-tgt_qcow2.o qcow2/ublk-qcow2.o qcow2/ublk-qcow2_meta.o qcow2/ublk-utils.o qcow2/ublk-qcow2_flush_meta.o -L/root/liburing-liburing-2.2/src lib/.libs/libublksrv.so -L/usr/lib -luring -Wl,-rpath -Wl,/usr/local/lib
/usr/bin/ld: ublk-ublksrv_tgt.o: in function
ublksrv_drain_fetch_commands(ublksrv_dev*, ublksrv_queue_info*)': /root/ubdsrv/ublksrv_tgt.cpp:262: undefined reference to
pthread_join'/usr/bin/ld: ublk-ublksrv_tgt.o: in function
ublksrv_io_handler(void*)': /root/ubdsrv/ublksrv_tgt.cpp:298: undefined reference to
pthread_create'/usr/bin/ld: lib/.libs/libublksrv.so: undefined reference to
pthread_spin_init' /usr/bin/ld: lib/.libs/libublksrv.so: undefined reference to
pthread_spin_unlock'/usr/bin/ld: lib/.libs/libublksrv.so: undefined reference to
pthread_spin_lock' /usr/bin/ld: lib/.libs/libublksrv.so: undefined reference to
pthread_setaffinity_np'collect2: error: ld returned 1 exit status
Looks like -lpthread is missing. So I edited build_with_liburing_src:
LDFLAGS="-L${LIBURING_DIR}/src -lpthread"
Then I ran build_with_liburing_src again. And the build succeeded.
The text was updated successfully, but these errors were encountered: