I'm trying to build QEMU 1.2.0 with --static:
LINK qemu-ga /usr/bin/ld: cannot find -lgthread-2.0 /usr/bin/ld: cannot find -lglib-2.0 qemu-sockets.o: In function `inet_listen_opts': /home/ashutosh/man-builds/qemu-1.2.0/qemu-sockets.c:141: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking collect2: error: ld returned 1 exit status make: *** [qemu-ga] Error 1
But as far as I can see, everything is fine with glib-2.0 and gthread-2.0:
# pacman -Qs glib2 local/glib2 2.32.4-1 # ld --verbose | grep /usr/lib SEARCH_DIR("/usr/x86_64-unknown-linux-gnu/lib64"); SEARCH_DIR("/usr/x86_64-unknown-linux-gnu/lib"); SEARCH_DIR("/usr/lib"); SEARCH_DIR("/usr/local/lib"); # ls /usr/lib/libgthread-2.0.so* /usr/lib/libgthread-2.0.so /usr/lib/libgthread-2.0.so.0.3200.4 /usr/lib/libgthread-2.0.so.0 # ls /usr/lib/libglib-2.0.so* /usr/lib/libglib-2.0.so /usr/lib/libglib-2.0.so.0.3200.4 /usr/lib/libglib-2.0.so.0
I can build QEMU without --static though. Any ideas are welcome!
Maybe it is looking for statically linked versions of the libraries? I'm pretty sure that .so on Linux just are dynamically linked versions of libraries i.e. I think that's what the .so extension indicates. Definitely e.g. libglib-2.0.so is dynamically linked (check with ldd).
Had the same problem, rebuilt glib2 with --enable-static flag in ./configure and it worked.