[libvirt] Linker error in gnulib test-binary-io.c

I get the following error on Ubuntu 11.04 with current libvirt git HEAD: $ make check [...] CC test-binary-io.o test-binary-io.c: In function 'main': test-binary-io.c:54:7: warning: implicit declaration of function 'set_binary_mode' CCLD test-binary-io test-binary-io.o: In function `main': [...]/test-binary-io.c:54: undefined reference to `set_binary_mode' collect2: ld returned 1 exit status -- Matthias Bolte http://photron.blogspot.com

2012/6/17 Matthias Bolte <matthias.bolte@googlemail.com>:
I get the following error on Ubuntu 11.04 with current libvirt git HEAD:
$ make check [...] CC test-binary-io.o test-binary-io.c: In function 'main': test-binary-io.c:54:7: warning: implicit declaration of function 'set_binary_mode' CCLD test-binary-io test-binary-io.o: In function `main': [...]/test-binary-io.c:54: undefined reference to `set_binary_mode' collect2: ld returned 1 exit status
A more detailed look revealed that have a broken version of binary-io.h in the tests directory which didn't belong there. Removing this file fixed the issue. I've no clue how the broken version of binary-io.h got there. -- Matthias Bolte http://photron.blogspot.com

On 06/17/2012 03:46 AM, Matthias Bolte wrote:
I get the following error on Ubuntu 11.04 with current libvirt git HEAD:
$ make check [...] CC test-binary-io.o test-binary-io.c: In function 'main': test-binary-io.c:54:7: warning: implicit declaration of function 'set_binary_mode'
Known pitfall of incremental development, and I think it happens if you build libvirt.git prior to libvirt commit e925ea31 (although I could be wrong, maybe libvirt commit db835b7 was the culprit), then do an incremental update. What happens is that prior to the problem point, gnulib-tool was installing binary-io.h in the test directory, as it was a dependency for tests but not for files used directly by libvirt. After the problem point, one of our gnulib updates picked up some dependency changes that graduated binary-io.h into our normal include space, for use as part of libvirt (or at least as part of the gnulib modules compiled directly into libvirt and not just the testsuite). Meanwhile, version skew between the two versions of binary-io.h mean that if you pick up the wrong version, you get a compilation failure. Nuke the file in gnulib/tests/ to proceed. That can be done with a clean build, rather than an incremental build. I'm cc'ing bug-gnulib, though, in case there is a way to make 'gnulib-tool --update' (and/or ./bootstrap) remove old files from the tests directory once they have been graduated into the main directory as a result of some other module dependency change. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Matthias Bolte