On 1/17/19 12:07 PM, Peter Maydell wrote: > On Thu, 17 Jan 2019 at 17:14, Thomas Huth <th...@redhat.com> wrote: >> >> On Linux (and maybe some BSDs), we require libutil for the openpty() >> function. However, this library is not available on some other systems, so >> we currently use a fragile if-statement in the configure script to check >> whether we need the library or not. Unfortunately, we also hard-coded a >> "-lutil" in the tests/Makefile.include file, so this breaks the build on >> Solaris, for example (see buglink below). To fix the issue, add the "-lutil" >> to "libs_tools" in the configure script instead, then this gets properly >> propagated to the tests, too. > > It also gets propagated to every tool binary we build even if > it doesn't use openpty(), but I guess that's not a big deal.
Statically linking against libraries only pulls in symbols that the library provides but which have not been satisfied earlier in the link line. For programs which do not use openpty(), and where no other unsatisfied symbols remain which -lutil would satisfy in a shadowing effect on symbols normally provided by remaining libraries on the command line, then yeah, it shouldn't change the compiled size of those binaries. Dynamic linking might change the binary slightly because of tracking that the library was linked, but again the behavior shouldn't change. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature