[Libvir] [PATCH] A variety of fixes for Debian, old versions of GnuTLS

Attached is a patch to get libvirt working on Debian/stable again. (1) Add ./configure option --disable-stack-protector. The stack protector feature is still enabled by default, but it causes no end of problems when compiling on Debian systems, apparently because of bugs in their gcc. So Debian users would be well advised to try disabling it if they have problems building. (2) Adds support for GnuTLS 1.0.x by detecting this version and enabling some simple compatibility macros. (3) In qemudDispatchClientEvent, a prototype shadowed a global function name. A simple name change to a parameter fixes it. (4) Debian (and likely non-Linux systems also) don't have the SIOCBRADDBR and related ioctls. If these are missing, then I've changed this to runtime errors. This means that these systems won't be able to start the network daemon, but other (non-network) features of libvirt continue to work. (5) Removed a warning in src/qemu_conf.c. Rich. PS. You need to drop the file gnutls_1_0_compat.h into src/ subdirectory. Sorry this file isn't in the proper patch but I don't have write access to CVS from the testing machine. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Tue, Aug 07, 2007 at 12:56:39PM +0100, Richard W.M. Jones wrote:
Attached is a patch to get libvirt working on Debian/stable again.
(1) Add ./configure option --disable-stack-protector. The stack protector feature is still enabled by default, but it causes no end of problems when compiling on Debian systems, apparently because of bugs in their gcc. So Debian users would be well advised to try disabling it if they have problems building.
(2) Adds support for GnuTLS 1.0.x by detecting this version and enabling some simple compatibility macros.
(3) In qemudDispatchClientEvent, a prototype shadowed a global function name. A simple name change to a parameter fixes it.
(4) Debian (and likely non-Linux systems also) don't have the SIOCBRADDBR and related ioctls. If these are missing, then I've changed this to runtime errors. This means that these systems won't be able to start the network daemon, but other (non-network) features of libvirt continue to work.
(5) Removed a warning in src/qemu_conf.c.
Rich.
PS. You need to drop the file gnutls_1_0_compat.h into src/ subdirectory. Sorry this file isn't in the proper patch but I don't have write access to CVS from the testing machine.
Do we really need to have this as a separate file ? I'm wondering if those macros can't be merged into some kind of exsting internal header. But yeah that looks fine to me and fairly useful, we should try to get this fixed as earlier as possible, thanks ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Tue, Aug 07, 2007 at 12:56:39PM +0100, Richard W.M. Jones wrote:
Attached is a patch to get libvirt working on Debian/stable again.
(1) Add ./configure option --disable-stack-protector. The stack protector feature is still enabled by default, but it causes no end of problems when compiling on Debian systems, apparently because of bugs in their gcc. So Debian users would be well advised to try disabling it if they have problems building.
I'm a little puzzled why this change was needed. The configure script takes each compiler flag in turn & attempts to compile a test program. If this test fails it doesn't use the flag for main libvirt build. Any ideas why the configure test succeeeded, but libvirt build didn't ?
(2) Adds support for GnuTLS 1.0.x by detecting this version and enabling some simple compatibility macros.
Looks fine.
(3) In qemudDispatchClientEvent, a prototype shadowed a global function name. A simple name change to a parameter fixes it.
looks fine.
(4) Debian (and likely non-Linux systems also) don't have the SIOCBRADDBR and related ioctls. If these are missing, then I've changed this to runtime errors. This means that these systems won't be able to start the network daemon, but other (non-network) features of libvirt continue to work.
This is quite a long standing issue with kernel headers. Only very recently (Fedora 6) and later are the glibc kernel headers actually generated from the kernel sources. Prior to this pretty much every distro shipped kernel headers based on some ancient kernel version. This didn't have SIOCBRADDBR and friends, even though the kernel has had full support for this for years. Looking at the bridge-utils source code, they simply #define all the missing constants if they're not part of kernel headers. We could do the same and thus make bridging stuff work on Debian too. Regards, Dan -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

Daniel P. Berrange wrote:
On Tue, Aug 07, 2007 at 12:56:39PM +0100, Richard W.M. Jones wrote:
Attached is a patch to get libvirt working on Debian/stable again.
(1) Add ./configure option --disable-stack-protector. The stack protector feature is still enabled by default, but it causes no end of problems when compiling on Debian systems, apparently because of bugs in their gcc. So Debian users would be well advised to try disabling it if they have problems building.
I'm a little puzzled why this change was needed. The configure script takes each compiler flag in turn & attempts to compile a test program. If this test fails it doesn't use the flag for main libvirt build. Any ideas why the configure test succeeeded, but libvirt build didn't ?
I tried two different gcc's from Debian. The errors were: hidden symbol `__stack_chk_fail_local' in [...] is referenced by DSO /usr/bin/ld: final link failed: Nonrepresentable section on output and even wierder: /usr/lib/libc_nonshared.a(elf-init.oS)(.gnu.linkonce.t.__i686.get_pc_thunk.bx+0x0): In function `__i686.get_pc_thunk.bx': multiple definition of `__i686.get_pc_thunk.bx' Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Richard W.M. Jones