25.05.2013 15:38, Andreas Färber wrote: > Am 25.05.2013 06:25, schrieb Michael Tokarev: [] >> Here, it is interesting to note that pkg-config does not actually do >> the right thing in this case. Because practically, it should have >> one extra flag, something like --static-libs (or --libs --static), >> and it should actually be different from plain --libs. > > $pkg_config should already contain --static for static builds, so I see > nothing wrong with this patch,
Hmm. I didn't know. Okay. On my system pkg-config does the same thing for ncurses, be it with --static or without -- in both cases it prints `-lncurses -ltinfo', so after this patch, qemu executable itself will be linked with a library it does not use directly. Definitely not a big deal, because it is used by -lncurses anyway (indirectly) and so both libs are actually required. When qemu is built on debian, we include --as-needed flag for the linker as well, in order to get rid of all those extra but unused libs, so it does not matter for us anyway. And since apparenlty this is how ncurses is supposed to work/used, I guess nothing is wrong with that at all ;) > Reviewed-by: Andreas Färber <afaer...@suse.de> > > but maybe I'm missing something? I don't think so. The only by concern was that the new (which is apparently correct, and if not, we should complain to ncurses not qemu) is the extra unnecessary library which is being linked to qemu directly when doing non-static build. > One thing to note is that in an unfortunate layering violation unicore32 > uses curses, so static libs and their potential need to link in > additional dependencies may be more than just a theoretical concern. How unicore32 is different from everything else? It definitely is not a theorerical concern, -- for example, debian build static binaries for all user targets, to simplify usage of "foreign chroots", -- you install a foreign system in a chroot, drop the right qemu-$arch-static binary into its usr/bin, and just chroot to it. So static building is needed and used, but with that, configure finds right libs anyway, because it tries -lncurses which fails without -ltinfo, and next it tries stuff from pkg-config which works. With this --static flag to pkg-config, things become instantly correct too. I'll apply it on top of my configure changes. Thanks! /mjt