Closed Bug 1204425 Opened 9 years ago Closed 9 years ago

[B2G][Emulator] Failed to build emulator-kk / x86-kk on Mac OS X

Categories

(Firefox OS Graveyard :: Emulator, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: freesamael, Assigned: freesamael)

References

Details

Attachments

(1 file)

Error message:
> external/qemu/telephony/android_modem.c: In function ‘format_inet_addr’:
> external/qemu/telephony/android_modem.c:813: error: ‘struct in6_addr’ has no member named ‘s6_addr32’
> external/qemu/telephony/android_modem.c: In function ‘amodem_init_rmnets’:
> external/qemu/telephony/android_modem.c:853: error: ‘struct in6_addr’ has no member named ‘s6_addr32’
> external/qemu/telephony/android_modem.c:854: error: ‘struct in6_addr’ has no member named ‘s6_addr32’
> external/qemu/telephony/android_modem.c:855: error: ‘struct in6_addr’ has no member named ‘s6_addr32’
> external/qemu/telephony/android_modem.c:859: error: ‘struct in6_addr’ has no member named ‘s6_addr32’
> external/qemu/telephony/android_modem.c:865: error: ‘struct in6_addr’ has no member named ‘s6_addr32’

Checked the definition of struct in6_addr on Mac (/usr/include/netinet6/in6.h)
> 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

In comparison the Linux version is:
> #if __UAPI_DEF_IN6_ADDR
> struct in6_addr {
>         union {
>                 __u8            u6_addr8[16];
> #if __UAPI_DEF_IN6_ADDR_ALT
>                 __be16          u6_addr16[8];
>                 __be32          u6_addr32[4];
> #endif
>         } in6_u;
> #define s6_addr                 in6_u.u6_addr8
> #if __UAPI_DEF_IN6_ADDR_ALT
> #define s6_addr16               in6_u.u6_addr16
> #define s6_addr32               in6_u.u6_addr32
> #endif
> };
> #endif /* __UAPI_DEF_IN6_ADDR */

It looks to me we should use "s6_addr32" directly instead of "in6_addr.s6_addr32", and maybe we need this when the target is darwin:
> #define s6_addr32               in6_u.__u6_addr32
Addition:

According to the POSIX standard [1], the 8 bits variant is the only safe / portable option:

> [IP6] [Option Start] The <netinet/in.h> header shall define the in6_addr structure that contains at least > the following member:
> 
> uint8_t s6_addr[16]

Suggest not to use the 32bits variant.

[1] http://pubs.opengroup.org/onlinepubs/000095399/basedefs/netinet/in.h.html
Blocks: 978071
Assignee: nobody → sawang
Comment on attachment 8662161 [details] [review]
Use s6_addr instead of s6_addr32.

Hi Edgar,

Would you help to review the pull request?
Attachment #8662161 - Flags: review?(echen)
Comment on attachment 8662161 [details] [review]
Use s6_addr instead of s6_addr32.

r=me with the comments on github addressed. Thanks for the fix.
Attachment #8662161 - Flags: review?(echen) → review+
Thank you.

b2g-kitkat:
https://github.com/mozilla-b2g/platform_external_qemu/commit/b2773dbc3cb24e70cff2b05522e9c959250400ac
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: