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 <netlink/msg.h>
>> +#  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

Reply via email to