Re: [libvirt] Entering freeze for libvirt-0.10.0
On Tue, Aug 28, 2012 at 4:19 AM, Peter Krempa wrote: > On 08/27/12 23:09, Eric Blake wrote: >> On 08/24/2012 10:19 AM, Eric Blake wrote: >> >>> Ah, that rings a bell, I knew I'd seen this issue before. I'm actually >>> surprised it STILL hasn't been fixed in Ubuntu, and maybe it's time to >>> apply the workaround below as a build-breaker fix (I think I've posted >>> it on list before, but never committed it). >>> >> >>> >>> diff --git i/src/util/virnetlink.h w/src/util/virnetlink.h >>> index 1982dae..82154de 100644 >>> --- i/src/util/virnetlink.h >>> +++ w/src/util/virnetlink.h >>> @@ -26,7 +26,11 @@ >>> >>> # if defined(__linux__) && defined(HAVE_LIBNL) >>> >>> +/* Work around a bug where older libnl-1 headers expected older gcc >>> + * semantics of 'extern inline' that conflict with C99 semantics. */ >>> +# define inline >>> # include >>> +# undef inline >> >> I've now pushed this under the build-breaker rule. >> > > This breaks the build with libnl3: > > CC libvirt_util_la-virnetdevbridge.lo > cc1: warnings being treated as errors > /usr/include/libnl3/netlink/list.h:21:20: error: 'NL_INIT_LIST_HEAD' defined > but not used [-Wunused-function] > /usr/include/libnl3/netlink/list.h:37:20: error: 'nl_list_add_tail' defined > but not used [-Wunused-function] > /usr/include/libnl3/netlink/list.h:43:20: error: 'nl_list_add_head' defined > but not used [-Wunused-function] > /usr/include/libnl3/netlink/list.h:49:20: error: 'nl_list_del' defined but > not used [-Wunused-function] > /usr/include/libnl3/netlink/list.h:55:19: error: 'nl_list_empty' defined but > not used [-Wunused-function] > /usr/include/libnl3/netlink/object.h:60:23: error: 'nl_object_priv' defined > but not used [-Wunused-function] > cc1: error: unrecognized command line option "-Wno-suggest-attribute=const" > cc1: error: unrecognized command line option "-Wno-suggest-attribute=pure" > make[3]: *** [libvirt_util_la-virnetdev.lo] Error 1 > > That annoying libnl-1 bug exists also in other distros that for some reason > refuse to fix it (e.g. gentoo) but upgrading to libnl3 helps and libvirt > compiles cleanly. > > Libnl3 unfortunately has some inline functions in the header files where > removing the inline keyword is catastrophic. I vote for reverting this patch > and have distros apply that long-known trivial patch that fixes libnl-1 > headers > rather than breaking libnl3 support. > > Peter > > Erm. Gentoo doesn't have the issue. I mentioned that Gentoo has the same fix that Fedora had which was the commit from upstream applied. The broken distro was Ubuntu 10.04, which I believe is a LTS release. The other mention of Gentoo I made was that we put libnl3 headers in the same path that Fedora does to support parallel installs of libnl1 and libnl3. -- Doug Goldstein -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Entering freeze for libvirt-0.10.0
On 08/27/12 23:09, Eric Blake wrote: > On 08/24/2012 10:19 AM, Eric Blake wrote: > >> Ah, that rings a bell, I knew I'd seen this issue before. I'm actually >> surprised it STILL hasn't been fixed in Ubuntu, and maybe it's time to >> apply the workaround below as a build-breaker fix (I think I've posted >> it on list before, but never committed it). >> > >> >> diff --git i/src/util/virnetlink.h w/src/util/virnetlink.h >> index 1982dae..82154de 100644 >> --- i/src/util/virnetlink.h >> +++ w/src/util/virnetlink.h >> @@ -26,7 +26,11 @@ >> >> # if defined(__linux__) && defined(HAVE_LIBNL) >> >> +/* Work around a bug where older libnl-1 headers expected older gcc >> + * semantics of 'extern inline' that conflict with C99 semantics. */ >> +# define inline >> # include >> +# undef inline > > I've now pushed this under the build-breaker rule. > This breaks the build with libnl3: CC libvirt_util_la-virnetdevbridge.lo cc1: warnings being treated as errors /usr/include/libnl3/netlink/list.h:21:20: error: 'NL_INIT_LIST_HEAD' defined but not used [-Wunused-function] /usr/include/libnl3/netlink/list.h:37:20: error: 'nl_list_add_tail' defined but not used [-Wunused-function] /usr/include/libnl3/netlink/list.h:43:20: error: 'nl_list_add_head' defined but not used [-Wunused-function] /usr/include/libnl3/netlink/list.h:49:20: error: 'nl_list_del' defined but not used [-Wunused-function] /usr/include/libnl3/netlink/list.h:55:19: error: 'nl_list_empty' defined but not used [-Wunused-function] /usr/include/libnl3/netlink/object.h:60:23: error: 'nl_object_priv' defined but not used [-Wunused-function] cc1: error: unrecognized command line option "-Wno-suggest-attribute=const" cc1: error: unrecognized command line option "-Wno-suggest-attribute=pure" make[3]: *** [libvirt_util_la-virnetdev.lo] Error 1 That annoying libnl-1 bug exists also in other distros that for some reason refuse to fix it (e.g. gentoo) but upgrading to libnl3 helps and libvirt compiles cleanly. Libnl3 unfortunately has some inline functions in the header files where removing the inline keyword is catastrophic. I vote for reverting this patch and have distros apply that long-known trivial patch that fixes libnl-1 headers rather than breaking libnl3 support. Peter -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Entering freeze for libvirt-0.10.0
On 08/24/2012 10:19 AM, Eric Blake wrote: > Ah, that rings a bell, I knew I'd seen this issue before. I'm actually > surprised it STILL hasn't been fixed in Ubuntu, and maybe it's time to > apply the workaround below as a build-breaker fix (I think I've posted > it on list before, but never committed it). > > > diff --git i/src/util/virnetlink.h w/src/util/virnetlink.h > index 1982dae..82154de 100644 > --- i/src/util/virnetlink.h > +++ w/src/util/virnetlink.h > @@ -26,7 +26,11 @@ > > # if defined(__linux__) && defined(HAVE_LIBNL) > > +/* Work around a bug where older libnl-1 headers expected older gcc > + * semantics of 'extern inline' that conflict with C99 semantics. */ > +# define inline > # include > +# undef inline I've now pushed this under the build-breaker rule. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Entering freeze for libvirt-0.10.0
On 08/24/2012 04:02 PM, Eric Blake wrote: > On 08/24/2012 01:54 PM, Laine Stump wrote: Thomas, do you have any info on the libnl version used in Ubuntu 10.04, and/or what might be the cause of this warning. >>> It's a static inline which I guess is the problem here. Laine, you >>> are probably using a libnl version which does not include the commit >>> below. >> I'm using libnl-devel-1.1-15.fc17.x86_64 >> >> For fun, I just installed libnl3-devel (which has the inlined >> nl_object_priv(), reconfigured to switch to using libnl3, and it also >> compiled without problems on F17. So I guess it's completely related to >> the gcc version. > Not just the gcc version, but _how_ the function is declared. 'static > inline' is okay, 'extern inline' without a later body is where you run > into problems. The bug exists in older libnl headers, and has been > fixed upstream for libnl3; but while Fedora 17 ships libnl with a F17 actually has two different headers - one for libnl-1.1 (which doesn't declare it inline) and one for libnl-3 (which does). Apparently Ubuntu 10.0.4 is somewhere in between. > patched header, Ubuntu 10.04 did not. > -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Entering freeze for libvirt-0.10.0
On 08/24/2012 01:54 PM, Laine Stump wrote: >>> Thomas, do you have any info on the libnl version used in Ubuntu 10.04, >>> and/or what might be the cause of this warning. >> It's a static inline which I guess is the problem here. Laine, you >> are probably using a libnl version which does not include the commit >> below. > > I'm using libnl-devel-1.1-15.fc17.x86_64 > > For fun, I just installed libnl3-devel (which has the inlined > nl_object_priv(), reconfigured to switch to using libnl3, and it also > compiled without problems on F17. So I guess it's completely related to > the gcc version. Not just the gcc version, but _how_ the function is declared. 'static inline' is okay, 'extern inline' without a later body is where you run into problems. The bug exists in older libnl headers, and has been fixed upstream for libnl3; but while Fedora 17 ships libnl with a patched header, Ubuntu 10.04 did not. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Entering freeze for libvirt-0.10.0
On 08/24/2012 11:49 AM, Thomas Graf wrote: > On Fri, Aug 24, 2012 at 11:30:44AM -0400, Laine Stump wrote: >> On 08/24/2012 10:28 AM, Viktor Mihajlovski wrote: >>> fwiw ... with the current GIT level I get the following build error on >>> Ubuntu 10.04 32-bit >>> >>> CC libvirt_util_la-virnetdev.lo >>> cc1: warnings being treated as errors >>> /usr/include/netlink/object.h:58: error: inline function 'nl_object_priv' >>> declared but never defined >> libvirt itself never uses that function. Also, in the version of >> /usr/include/netlink/object.h I'm working with (on Fedora 17) that >> function isn't declared as inline. >> >> Thomas, do you have any info on the libnl version used in Ubuntu 10.04, >> and/or what might be the cause of this warning. > It's a static inline which I guess is the problem here. Laine, you > are probably using a libnl version which does not include the commit > below. I'm using libnl-devel-1.1-15.fc17.x86_64 For fun, I just installed libnl3-devel (which has the inlined nl_object_priv(), reconfigured to switch to using libnl3, and it also compiled without problems on F17. So I guess it's completely related to the gcc version. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Entering freeze for libvirt-0.10.0
On 08/24/2012 09:49 AM, Thomas Graf wrote: > It's a static inline which I guess is the problem here. Laine, you Actually, Viktor hit the problem; Laine couldn't reproduce, so it is probably Viktor with the older header. > are probably using a libnl version which does not include the commit > below. Ah, that rings a bell, I knew I'd seen this issue before. I'm actually surprised it STILL hasn't been fixed in Ubuntu, and maybe it's time to apply the workaround below as a build-breaker fix (I think I've posted it on list before, but never committed it). > > Why is the compiler not OK with this? Because C99 changed the meaning of 'extern inline' from what it used to be in older gcc compilers. You are using a libnl so old that it expects the older gcc semantics > -extern inline void * nl_object_priv(struct nl_object *); where 'extern inline' meant that the function must always be inlined, but on a system with newer gcc, you get C99 semantics. C99 6.7.4 p. 6 states that requires that "For a function with external linkage, the following restrictions apply: If a function is declared with an inline function specifier, then it shall also be defined in the same translation unit.", which means a forward declaration of an 'extern inline' function without a corresponding function body is a violation that the compiler must diagnose. diff --git i/src/util/virnetlink.h w/src/util/virnetlink.h index 1982dae..82154de 100644 --- i/src/util/virnetlink.h +++ w/src/util/virnetlink.h @@ -26,7 +26,11 @@ # if defined(__linux__) && defined(HAVE_LIBNL) +/* Work around a bug where older libnl-1 headers expected older gcc + * semantics of 'extern inline' that conflict with C99 semantics. */ +# define inline # include +# undef inline # else -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Entering freeze for libvirt-0.10.0
On Fri, Aug 24, 2012 at 11:30:44AM -0400, Laine Stump wrote: > On 08/24/2012 10:28 AM, Viktor Mihajlovski wrote: > > > > fwiw ... with the current GIT level I get the following build error on > > Ubuntu 10.04 32-bit > > > > CC libvirt_util_la-virnetdev.lo > > cc1: warnings being treated as errors > > /usr/include/netlink/object.h:58: error: inline function 'nl_object_priv' > > declared but never defined > > libvirt itself never uses that function. Also, in the version of > /usr/include/netlink/object.h I'm working with (on Fedora 17) that > function isn't declared as inline. > > Thomas, do you have any info on the libnl version used in Ubuntu 10.04, > and/or what might be the cause of this warning. It's a static inline which I guess is the problem here. Laine, you are probably using a libnl version which does not include the commit below. Why is the compiler not OK with this? commit a8cd7b62c86127e2c946373d50efac9d2ed8da38 Author: Pavel Roskin Date: Tue Apr 7 17:04:04 2009 -0400 nl_object_priv() is inline, so define it in the header diff --git a/include/netlink/object.h b/include/netlink/object.h index bae2bf4..ef1ed9f 100644 --- a/include/netlink/object.h +++ b/include/netlink/object.h @@ -56,7 +56,11 @@ extern int nl_object_is_marked(struct nl_object *); /* Access Functions */ extern int nl_object_get_refcnt(struct nl_object *); extern struct nl_cache * nl_object_get_cache(struct nl_object *); -extern inline void * nl_object_priv(struct nl_object *); +static inline void * nl_object_priv(struct nl_object *obj) +{ + return obj; +} + #ifdef __cplusplus } -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Entering freeze for libvirt-0.10.0
On 08/24/2012 10:28 AM, Viktor Mihajlovski wrote: > > fwiw ... with the current GIT level I get the following build error on Ubuntu > 10.04 32-bit > > CC libvirt_util_la-virnetdev.lo > cc1: warnings being treated as errors > /usr/include/netlink/object.h:58: error: inline function 'nl_object_priv' > declared but never defined libvirt itself never uses that function. Also, in the version of /usr/include/netlink/object.h I'm working with (on Fedora 17) that function isn't declared as inline. Thomas, do you have any info on the libnl version used in Ubuntu 10.04, and/or what might be the cause of this warning. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Entering freeze for libvirt-0.10.0
On 08/24/2012 08:28 AM, Viktor Mihajlovski wrote: > fwiw ... with the current GIT level I get the following build error on Ubuntu > 10.04 32-bit > > CC libvirt_util_la-virnetdev.lo > cc1: warnings being treated as errors > /usr/include/netlink/object.h:58: error: inline function 'nl_object_priv' > declared but never defined Please report that as a bug in Ubuntu's system headers. Also, can you please show us more context from that broken header, and determine the chain of include files that reached it from virnetdev.c, to see if we might be able to work around it by some temporary #defines around the inclusion of the broken header? -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Entering freeze for libvirt-0.10.0
On 08/22/2012 01:51 PM, Daniel Veillard wrote: >As planned, I just tagged 0.10.0 release candidate 1 in git and > pushed a tarball and rpms to the usual place: > ftp://libvirt.org/libvirt/ > > I gave it a try locally and things seems to work as expected, but > that's far from an extensive testing :-) > >So please try it, try to compile it on various platforms and > send feedback to the list. My schedule is to make an rc2 probably for > the week-end and ideally a final release a week from now, > >thanks in advance ! > > Daniel > fwiw ... with the current GIT level I get the following build error on Ubuntu 10.04 32-bit CC libvirt_util_la-virnetdev.lo cc1: warnings being treated as errors /usr/include/netlink/object.h:58: error: inline function 'nl_object_priv' declared but never defined cc1: error: unrecognized command line option "-Wno-suggest-attribute=const" cc1: error: unrecognized command line option "-Wno-suggest-attribute=pure" make[3]: *** [libvirt_util_la-virnetdev.lo] Error 1 it doesn't bother me too much, though as my target platform (s390x) builds and works fine... -- Mit freundlichen Grüßen/Kind Regards Viktor Mihajlovski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list