You are not logged in.

#1 2012-09-22 14:37:37

Registered: 2011-06-08
Posts: 41

Static QEMU Build fails

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/*
/usr/lib/    /usr/lib/

# ls /usr/lib/*
/usr/lib/    /usr/lib/

I can build QEMU without --static though. Any ideas are welcome! smile


#2 2012-09-23 01:06:54

From: Cymru
Registered: 2011-11-27
Posts: 6,082

Re: Static QEMU Build fails

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. is dynamically linked (check with ldd).

How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Corporation Wireless 8265 / 8275 | US keyboard with Euro | 512G NVMe INTEL SSDPEKKF512G7L


#3 2012-10-17 22:06:32

Registered: 2008-05-19
Posts: 61

Re: Static QEMU Build fails

Had the same problem, rebuilt glib2 with --enable-static flag in ./configure and it worked.


Board footer

Powered by FluxBB