#19066: netifd fails to build with musl
---------------------------+----------------------------------
Reporter: daniel.petre | Owner: developers
Type: defect | Status: new
Priority: high | Milestone: Chaos Calmer (trunk)
Component: base system | Version: Trunk
Resolution: | Keywords: netifd,musl
---------------------------+----------------------------------
Comment (by anonymous):
I worked around this issue by adding the following code:
{{{
#ifndef __GLIBC__
#define __GLIBC__
#endif
}}}
just after
{{{
#include <arpa/inet.h>
#include <netinet/in.h>
}}}
in netifd-2015-02-17/system-linux.c
This works because the kernel headers check for previous libc definitions
by including include/linux/libc-compat.h.
IOW in that header you will find:
{{{
/* We have included glibc headers... */
#if defined(__GLIBC__)
/* Coordinate with glibc netinet/in.h header. */
#if defined(_NETINET_IN_H)
/* GLIBC headers included first so don't define anything
* that would already be defined. */
#define __UAPI_DEF_IN6_ADDR 0
/* The exception is the in6_addr macros which must be defined
* if the glibc code didn't define them. This guard matches
* the guard in glibc/inet/netinet/in.h which defines the
* additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
#if defined(__USE_MISC) || defined (__USE_GNU)
#define __UAPI_DEF_IN6_ADDR_ALT 0
#else
#define __UAPI_DEF_IN6_ADDR_ALT 1
#endif
#define __UAPI_DEF_SOCKADDR_IN6 0
#define __UAPI_DEF_IPV6_MREQ 0
#define __UAPI_DEF_IPPROTO_V6 0
#define __UAPI_DEF_IPV6_OPTIONS 0
...
}}}
--
Ticket URL: <https://dev.openwrt.org/ticket/19066#comment:1>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets