Re: [PATCH v2 2/2] examples: Avoid gnulib, have standalone examples

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/7/19 11:58 PM, Eric Blake wrote:
> Commit 0c6ad476 updated gnulib, which rearranged some of the
> conditions in gnulib wrapper headers such that compilation
> started failing on BSD systems when the normal system <unistd.h>
> tried to include another system header but instead got a
> gnulib wrapper header in an incomplete state; this is because
> gnulib headers only work if <config.h> is included first.
> 
> Commit b6f78259 papered over the symptoms of that by including
> <config.h> in all the examples.  But this logic is backwards -
> if our examples are truly meant to be stand-alone, they should
> NOT depend on how libvirt was configured, and should NOT
> depend on the gnulib fixes for system quirks.  In particular,
> if an example does not need to link against libgnulib.la,
> then it also does not need to use -Ignulib in its compile
> flags, and likewise does not need to include <config.h> since
> none of the gnulib wrapper headers should be interfering.
> 
> So, revert (most of) b6f78259 (except for the bogus pre-patch
> use of "config.h" in admin/logging.c: if config.h is included,
> it should be via <> rather than "", and must be before any
> system headers); then additionally nuke all mention of
> <config.h>, -Ignulib, and -lgnulib, making all of the examples
> truly standalone.

Apparently it's now too standalone - Travis complains that mingw now fails:

domtop/domtop.c: In function 'print_cpu_usage':
domtop/domtop.c:229:15: warning: unknown conversion type character 'l'
in format [-Wformat=]
         DEBUG("now_params=%llu then_params=%llu now=%llu then=%llu",
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
domtop/domtop.c: In function 'do_top':
domtop/domtop.c:268:22: error: storage size of 'action_stop' isn't known
     struct sigaction action_stop;
                      ^~~~~~~~~~~

so at least domtop.c was actually depending on gnulib fixing printf and
providing sigaction.  Rewriting the printf uses to favor PRIu64 might
help, but I'm not sure how to work around missing sigaction.  I'm trying
to reproduce the mingw cross-build locally, rather than iteratively
hammering through more Travis tests, and hope to post a fixup patch
later today.  It may be that I go back to my earlier plan where some of
the examples link against gnulib (but in that case, it will be just the
tests that need it, rather than all the tests).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux