Re: [libvirt] OSX 10.6 build failures

----- "Justin Clift" <jclift@redhat.com> wrote:
From: "Justin Clift" <jclift@redhat.com> To: "Libvirt Developers Mailing List" <libvir-list@redhat.com> Sent: Wednesday, September 15, 2010 7:42:48 AM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi Subject: [libvirt] OSX 10.6 build failures
Hi us,
Going through the process of getting libvirt to compile on OSX, making
notes of the failures on the way through (from a clean system) to be fixed.
a) libtool -> glibtool libtoolize -> glibtoolize
It turns out that autogen.sh is hard coded to use "libtool", and wants the GNU version.
OSX supplies has it's own version, without a --version option, so autogen.sh fails.
Installing GNU libtool through MacPorts, makes it available as glibtool, with libtoolize being glibtoolize.
Adjusting autogen.sh to detect that, then set LIBTOOL and LIBTOOLIZE appropriately was fairly trivial.
Will submit a patch to fix that in a bit.
b) pkg-config
The next thing to barf was autoconf, complaining about AC_MSG_ERROR not being a defined macro.
Googling with some persistence showed this is caused by pkg-config not being installed. Fixed that.
Will submit a patch for that too. Probably "pkg-config --version" based, copying the approach used for the other autogen.sh checks.
c) This is a compilation failure, one I don't readily know how to fix:
... Making all in src make all-am CC libvirt_util_la-network.lo util/network.c: In function 'getIPv6Addr': util/network.c:50: error: 'struct in6_addr' has no member named 's6_addr16' util/network.c:50: error: 'struct in6_addr' has no member named 's6_addr16' util/network.c:50: error: 'struct in6_addr' has no member named 's6_addr16' util/network.c:50: error: 'struct in6_addr' has no member named 's6_addr16' make[3]: *** [libvirt_util_la-network.lo] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 $
They're the only problems so far, though most things have been disabled on the ./configure line so it's only the client libraries being built.
Anyone know how to address that third one?
% man ipv6 Address Format struct sockaddr_in6 { sa_family_t sin6_family; /* AF_INET6 */ in_port_t sin6_port; /* port number */ uint32_t sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ uint32_t sin6_scope_id; /* Scope ID (new in 2.4) */ }; struct in6_addr { unsigned char s6_addr[16]; /* IPv6 address */ }; % vim libvirt/src/util/network.c 43 static int getIPv6Addr(virSocketAddrPtr addr, virIPv6AddrPtr tab) { 44 int i; 45 46 if ((addr == NULL) || (tab == NULL) || (addr->stor.ss_family != AF_INET6 )) 47 return(-1); 48 49 for (i = 0;i < 8;i++) { 50 (*tab)[i] = ntohs(addr->inet6.sin6_addr.s6_addr16[i]); 51 } 52 53 return(0); 54 } I guess it's a typo, should be "addr->inet6.sin6_addr.s6_addr[i]", but not "addr->inet6.sin6_addr.s6_addr16[i]".. :-) - Osier
Regards and best wishes,
Justin Clift
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

----- "Osier" <jyang@redhat.com> wrote:
From: "Osier" <jyang@redhat.com> To: "Justin Clift" <jclift@redhat.com> Cc: "Libvirt Developers Mailing List" <libvir-list@redhat.com> Sent: Wednesday, September 15, 2010 8:45:20 AM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi Subject: Re: [libvirt] OSX 10.6 build failures
----- "Justin Clift" <jclift@redhat.com> wrote:
From: "Justin Clift" <jclift@redhat.com> To: "Libvirt Developers Mailing List" <libvir-list@redhat.com> Sent: Wednesday, September 15, 2010 7:42:48 AM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi Subject: [libvirt] OSX 10.6 build failures
Hi us,
Going through the process of getting libvirt to compile on OSX, making
notes of the failures on the way through (from a clean system) to be fixed.
a) libtool -> glibtool libtoolize -> glibtoolize
It turns out that autogen.sh is hard coded to use "libtool", and wants the GNU version.
OSX supplies has it's own version, without a --version option, so autogen.sh fails.
Installing GNU libtool through MacPorts, makes it available as glibtool, with libtoolize being glibtoolize.
Adjusting autogen.sh to detect that, then set LIBTOOL and LIBTOOLIZE appropriately was fairly trivial.
Will submit a patch to fix that in a bit.
b) pkg-config
The next thing to barf was autoconf, complaining about AC_MSG_ERROR not being a defined macro.
Googling with some persistence showed this is caused by pkg-config not being installed. Fixed that.
Will submit a patch for that too. Probably "pkg-config --version" based, copying the approach used for the other autogen.sh checks.
c) This is a compilation failure, one I don't readily know how to fix:
... Making all in src make all-am CC libvirt_util_la-network.lo util/network.c: In function 'getIPv6Addr': util/network.c:50: error: 'struct in6_addr' has no member named
's6_addr16' util/network.c:50: error: 'struct in6_addr' has no member named
's6_addr16' util/network.c:50: error: 'struct in6_addr' has no member named
's6_addr16' util/network.c:50: error: 'struct in6_addr' has no member named
's6_addr16' make[3]: *** [libvirt_util_la-network.lo] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 $
They're the only problems so far, though most things have been disabled on the ./configure line so it's only the client libraries being built.
Anyone know how to address that third one?
% man ipv6
Address Format struct sockaddr_in6 { sa_family_t sin6_family; /* AF_INET6 */ in_port_t sin6_port; /* port number */ uint32_t sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ uint32_t sin6_scope_id; /* Scope ID (new in 2.4) */ };
struct in6_addr { unsigned char s6_addr[16]; /* IPv6 address */ };
% vim libvirt/src/util/network.c
43 static int getIPv6Addr(virSocketAddrPtr addr, virIPv6AddrPtr tab) { 44 int i; 45 46 if ((addr == NULL) || (tab == NULL) || (addr->stor.ss_family != AF_INET6 )) 47 return(-1); 48 49 for (i = 0;i < 8;i++) { 50 (*tab)[i] = ntohs(addr->inet6.sin6_addr.s6_addr16[i]); 51 } 52 53 return(0); 54 }
I guess it's a typo, should be "addr->inet6.sin6_addr.s6_addr[i]", but not "addr->inet6.sin6_addr.s6_addr16[i]".. :-)
BTW: Got it under Linux, not sure if the ipv6 implementation is same on OSX. :-)
- Osier
Regards and best wishes,
Justin Clift
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Tue, Sep 14, 2010 at 7:57 PM, Osier <jyang@redhat.com> wrote:
----- "Osier" <jyang@redhat.com> wrote:
From: "Osier" <jyang@redhat.com> To: "Justin Clift" <jclift@redhat.com> Cc: "Libvirt Developers Mailing List" <libvir-list@redhat.com> Sent: Wednesday, September 15, 2010 8:45:20 AM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi Subject: Re: [libvirt] OSX 10.6 build failures
----- "Justin Clift" <jclift@redhat.com> wrote:
From: "Justin Clift" <jclift@redhat.com> To: "Libvirt Developers Mailing List" <libvir-list@redhat.com> Sent: Wednesday, September 15, 2010 7:42:48 AM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi Subject: [libvirt] OSX 10.6 build failures
Hi us,
Going through the process of getting libvirt to compile on OSX, making
notes of the failures on the way through (from a clean system) to be fixed.
a) libtool -> glibtool libtoolize -> glibtoolize
It turns out that autogen.sh is hard coded to use "libtool", and wants the GNU version.
OSX supplies has it's own version, without a --version option, so autogen.sh fails.
Installing GNU libtool through MacPorts, makes it available as glibtool, with libtoolize being glibtoolize.
Adjusting autogen.sh to detect that, then set LIBTOOL and LIBTOOLIZE appropriately was fairly trivial.
Will submit a patch to fix that in a bit.
b) pkg-config
The next thing to barf was autoconf, complaining about AC_MSG_ERROR not being a defined macro.
Googling with some persistence showed this is caused by pkg-config not being installed. Fixed that.
Will submit a patch for that too. Probably "pkg-config --version" based, copying the approach used for the other autogen.sh checks.
c) This is a compilation failure, one I don't readily know how to fix:
... Making all in src make all-am CC libvirt_util_la-network.lo util/network.c: In function 'getIPv6Addr': util/network.c:50: error: 'struct in6_addr' has no member named
's6_addr16' util/network.c:50: error: 'struct in6_addr' has no member named
's6_addr16' util/network.c:50: error: 'struct in6_addr' has no member named
's6_addr16' util/network.c:50: error: 'struct in6_addr' has no member named
's6_addr16' make[3]: *** [libvirt_util_la-network.lo] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 $
They're the only problems so far, though most things have been disabled on the ./configure line so it's only the client libraries being built.
Anyone know how to address that third one?
% man ipv6
Address Format struct sockaddr_in6 { sa_family_t sin6_family; /* AF_INET6 */ in_port_t sin6_port; /* port number */ uint32_t sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ uint32_t sin6_scope_id; /* Scope ID (new in 2.4) */ };
struct in6_addr { unsigned char s6_addr[16]; /* IPv6 address */ };
% vim libvirt/src/util/network.c
43 static int getIPv6Addr(virSocketAddrPtr addr, virIPv6AddrPtr tab) { 44 int i; 45 46 if ((addr == NULL) || (tab == NULL) || (addr->stor.ss_family != AF_INET6 )) 47 return(-1); 48 49 for (i = 0;i < 8;i++) { 50 (*tab)[i] = ntohs(addr->inet6.sin6_addr.s6_addr16[i]); 51 } 52 53 return(0); 54 }
I guess it's a typo, should be "addr->inet6.sin6_addr.s6_addr[i]", but not "addr->inet6.sin6_addr.s6_addr16[i]".. :-)
BTW: Got it under Linux, not sure if the ipv6 implementation is same on OSX. :-)
Yep. Just checked my OS X 10.6 box.. Here's the relevant snippet. /* * IPv6 address */ struct in6_addr { union { __uint8_t __u6_addr8[16]; __uint16_t __u6_addr16[8]; __uint32_t __u6_addr32[4]; } __u6_addr; /* 128-bit IP6 address */ }; #define s6_addr __u6_addr.__u6_addr8 -- Doug Goldstein

On Tue, Sep 14, 2010 at 09:10:46PM -0500, Doug Goldstein wrote:
On Tue, Sep 14, 2010 at 7:57 PM, Osier <jyang@redhat.com> wrote:
% man ipv6
Address Format struct sockaddr_in6 { sa_family_t sin6_family; /* AF_INET6 */ in_port_t sin6_port; /* port number */ uint32_t sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ uint32_t sin6_scope_id; /* Scope ID (new in 2.4) */ };
struct in6_addr { unsigned char s6_addr[16]; /* IPv6 address */ };
Yep. Just checked my OS X 10.6 box.. Here's the relevant snippet.
/* * IPv6 address */ struct in6_addr { union { __uint8_t __u6_addr8[16]; __uint16_t __u6_addr16[8]; __uint32_t __u6_addr32[4]; } __u6_addr; /* 128-bit IP6 address */ };
#define s6_addr __u6_addr.__u6_addr8
The best thing about standards, is that there are so many to choose from :-) I just found this in cups/http.h .... /* * Oh, the wonderful world of IPv6 compatibility. Apparently some * implementations expose the (more logical) 32-bit address parts * to everyone, while others only expose it to kernel code... To * make supporting IPv6 even easier, each vendor chose different * core structure and union names, so the same defines or code * can't be used on all platforms. * * The following will likely need tweaking on new platforms that * support IPv6 - the "s6_addr32" define maps to the 32-bit integer * array in the in6_addr union, which is named differently on various * platforms. */ #if defined(AF_INET6) && !defined(s6_addr32) # if defined(__sun) # define s6_addr32 _S6_un._S6_u32 # elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__) # define s6_addr32 __u6_addr.__u6_addr32 # elif defined(__osf__) # define s6_addr32 s6_un.sa6_laddr # elif defined(WIN32) /* * Windows only defines byte and 16-bit word members of the union and * requires special casing of all raw address code... */ # define s6_addr32 error_need_win32_specific_code # endif /* __sun */ #endif /* AF_INET6 && !s6_addr32 */ I wonder if gnulib can help/save us here at all ? Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On 09/15/2010 10:45 AM, Osier wrote: <snip>
I guess it's a typo, should be "addr->inet6.sin6_addr.s6_addr[i]", but not "addr->inet6.sin6_addr.s6_addr16[i]".. :-)
Thanks Osier. Pretty sure it's not a typo, *but* it lets the code compile that part of things and keep on going, so I can look for other breakage. (hopefully not caused by this "probably dodgy" workaround) :)
participants (4)
-
Daniel P. Berrange
-
Doug Goldstein
-
Justin Clift
-
Osier