Hi,
I'm trying to compile libvirt on ubuntu machine.
I installed meson 0.59.1 using pip.
Then installed a few more packages that were required by meson build:
sudo apt-get install libxml2-utils xsltproc libpciaccess-dev ninja-build
Finally, I followed the simple instructions over here:
https://libvirt.org/compiling.html
xz -dc libvirt-7.7.0.tar.xz | tar xvf -
cd libvirt-7.7.0
meson build
ninja -C build
The last command fails with:
FAILED: src/libvirt-admin.so.0.7007.0
cc -o src/libvirt-admin.so.0.7007.0 src/libvirt_probes.o
src/libvirt-admin.so.0.7007.0.p/meson-generated_.._admin_admin_protocol.c.o
src/libvirt-admin.so.0.7007.0.p/admin_libvirt-admin.c.o
src/libvirt-admin.so.0.7007.0.p/datatypes.c.o -Wl,--as-needed -Wl,--no-undefined
-shared -fPIC -Wl,--start-group -Wl,-soname,libvirt-admin.so.0
'-Wl,-rpath,$ORIGIN/:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
-Wl,-rpath-link,/home/oro/ozeri/libvirt-7.7.0/build/src src/libvirt.so.0.7007.0
-Wl,--version-script=/home/oro/ozeri/libvirt-7.7.0/build/src/admin/libvirt_admin.syms
-Wl,-z,nodelete /usr/lib/x86_64-linux-gnu/libcap-ng.so
/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libdevmapper.so
/usr/lib/x86_64-linux-gnu/libgnutls.so -Wl,-z,relro -Wl,-z,now
-Wl,--no-copy-dt-needed-entries /usr/lib/x86_64-linux-gnu/libglib-2.0.so
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so
/usr/lib/x86_64-linux-gnu/libgio-2.0.so /usr/lib/x86_64-linux-gnu/libxml2.so
/usr/lib/x86_64-linux-gnu/libyajl.so -Wl,--end-group
/usr/bin/ld: src/libvirt-admin.so.0.7007.0.p/admin_libvirt-admin.c.o: in
function `callFull':
/home/oro/ozeri/libvirt-7.7.0/build/../src/admin/admin_remote.c:99: undefined
reference to `virNetClientProgramCall'
/usr/bin/ld: src/libvirt-admin.so.0.7007.0.p/admin_libvirt-admin.c.o: in
function `remoteAdminConnectClose':
/home/oro/ozeri/libvirt-7.7.0/build/../src/admin/admin_remote.c:197: undefined
reference to `virNetClientSetCloseCallback'
/usr/bin/ld:
/home/oro/ozeri/libvirt-7.7.0/build/../src/admin/admin_remote.c:199: undefined
reference to `virNetClientClose'
/usr/bin/ld: src/libvirt-admin.so.0.7007.0.p/admin_libvirt-admin.c.o: in
function `remoteAdminPrivNew':
/home/oro/ozeri/libvirt-7.7.0/build/../src/admin/admin_remote.c:225: undefined
reference to `virNetClientNewUNIX'
/usr/bin/ld:
/home/oro/ozeri/libvirt-7.7.0/build/../src/admin/admin_remote.c:228: undefined
reference to `virNetClientProgramNew'
/usr/bin/ld:
/home/oro/ozeri/libvirt-7.7.0/build/../src/admin/admin_remote.c:233: undefined
reference to `virNetClientAddProgram'
/usr/bin/ld: src/libvirt-admin.so.0.7007.0.p/admin_libvirt-admin.c.o: in
function `remoteAdminConnectOpen':
/home/oro/ozeri/libvirt-7.7.0/build/../src/admin/admin_remote.c:159: undefined
reference to `virNetClientRegisterAsyncIO'
/usr/bin/ld:
/home/oro/ozeri/libvirt-7.7.0/build/../src/admin/admin_remote.c:166: undefined
reference to `virNetClientSetCloseCallback'
/usr/bin/ld: src/libvirt-admin.so.0.7007.0.p/admin_libvirt-admin.c.o: in
function `virAdmConnectIsAlive':
/home/oro/ozeri/libvirt-7.7.0/build/../src/admin/libvirt-admin.c:397: undefined
reference to `virNetClientIsOpen'
collect2: error: ld returned 1 exit status
[2/11] Linking target tests/virsystemdtest
FAILED: tests/virsystemdtest
cc -o tests/virsystemdtest src/libvirt_probes.o
tests/virsystemdtest.p/virsystemdtest.c.o -Wl,--as-needed -Wl,--no-undefined
-Wl,-export-dynamic -pie -Wl,--whole-archive -Wl,--start-group
tests/libtest_utils.a -Wl,--no-whole-archive '-Wl,-rpath,$ORIGIN/../src'
-Wl,-rpath-link,/home/oro/ozeri/libvirt-7.7.0/build/src src/libvirt.so.0.7007.0
-Wl,--no-copy-dt-needed-entries -Wl,-export-dynamic -ldl
/usr/lib/x86_64-linux-gnu/libglib-2.0.so
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so
/usr/lib/x86_64-linux-gnu/libgio-2.0.so /usr/lib/x86_64-linux-gnu/libgnutls.so
/lib/x86_64-linux-gnu/libnl-3.so /usr/lib/x86_64-linux-gnu/libnl-route-3.so
/usr/lib/x86_64-linux-gnu/libxml2.so
/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libselinux.so
/usr/lib/x86_64-linux-gnu/libyajl.so -Wl,--end-group -Wl,-export-dynamic
/usr/bin/ld: tests/virsystemdtest.p/virsystemdtest.c.o: in function
`testActivationCreateFDs':
/home/oro/ozeri/libvirt-7.7.0/build/../tests/virsystemdtest.c:506: undefined
reference to `virNetSocketNewListenUNIX'
/usr/bin/ld: /home/oro/ozeri/libvirt-7.7.0/build/../tests/virsystemdtest.c:513:
undefined reference to `virNetSocketNewListenTCP'
/usr/bin/ld: tests/virsystemdtest.p/virsystemdtest.c.o: in function
`testActivation':
/home/oro/ozeri/libvirt-7.7.0/build/../tests/virsystemdtest.c:548: undefined
reference to `virNetSocketGetPath'
/usr/bin/ld: /home/oro/ozeri/libvirt-7.7.0/build/../tests/virsystemdtest.c:570:
undefined reference to `virNetSocketGetPort'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
I verified that these functions do exist inside libvirt.so.0.7007.0, but for
some reason the linker fails.
What am I doing wrong here?
Thanks,
Or