All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/17] powertop: Include right headers for timval struct
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-21 12:11   ` Burton, Ross
  2015-12-19 23:52 ` [PATCH 02/17] dhcp: Include sys/types.h for u_int* defs Khem Raj
                   ` (16 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...0001-include-rquired-headers-for-typedefs.patch | 45 ++++++++++++++++++++++
 meta/recipes-kernel/powertop/powertop_2.8.bb       |  4 +-
 2 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-kernel/powertop/powertop/0001-include-rquired-headers-for-typedefs.patch

diff --git a/meta/recipes-kernel/powertop/powertop/0001-include-rquired-headers-for-typedefs.patch b/meta/recipes-kernel/powertop/powertop/0001-include-rquired-headers-for-typedefs.patch
new file mode 100644
index 0000000..5df9961
--- /dev/null
+++ b/meta/recipes-kernel/powertop/powertop/0001-include-rquired-headers-for-typedefs.patch
@@ -0,0 +1,45 @@
+From 0856d8145d187a7e5a49625247abe43a13f95acc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 15 Sep 2015 19:36:28 +0000
+Subject: [PATCH] include rquired headers for typedefs
+
+timeval struct needs to include sys/time.h and sprintf() usage requires
+to include stdio.h headers from system
+
+Fixes
+src/perf/perf_bundle.cpp:141:2: error: use of undeclared identifier 'sprintf'; did you mean 'vswprintf'?
+src/devices/devfreq.h:35:18: error: field has incomplete type 'struct timeval'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/devices/devfreq.h    | 1 +
+ src/perf/perf_bundle.cpp | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/devices/devfreq.h b/src/devices/devfreq.h
+index 16a60fb..4bede7c 100644
+--- a/src/devices/devfreq.h
++++ b/src/devices/devfreq.h
+@@ -25,6 +25,7 @@
+ #ifndef _INCLUDE_GUARD_DEVFREQ_H
+ #define _INCLUDE_GUARD_DEVFREQ_H
+ 
++#include <sys/time.h>
+ #include "device.h"
+ #include "../parameters/parameters.h"
+ 
+diff --git a/src/perf/perf_bundle.cpp b/src/perf/perf_bundle.cpp
+index cf1ae11..232f894 100644
+--- a/src/perf/perf_bundle.cpp
++++ b/src/perf/perf_bundle.cpp
+@@ -27,6 +27,7 @@
+ #include <algorithm>
+ #include <string.h>
+ #include <stdint.h>
++#include <stdio.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+-- 
+2.5.2
+
diff --git a/meta/recipes-kernel/powertop/powertop_2.8.bb b/meta/recipes-kernel/powertop/powertop_2.8.bb
index a466067..1f2dfb8 100644
--- a/meta/recipes-kernel/powertop/powertop_2.8.bb
+++ b/meta/recipes-kernel/powertop/powertop_2.8.bb
@@ -6,7 +6,9 @@ DEPENDS = "ncurses libnl pciutils"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
 
-SRC_URI = "http://01.org/sites/default/files/downloads/powertop/powertop-${PV}.tar.gz"
+SRC_URI = "http://01.org/sites/default/files/downloads/powertop/powertop-${PV}.tar.gz \
+           file://0001-include-rquired-headers-for-typedefs.patch \
+"
 
 SRC_URI[md5sum] = "c55fedb69203e480801b18bd7b886241"
 SRC_URI[sha256sum] = "a87b563f73106babfa3e74dcf92f252938c061e309ace20a361358bbfa579c5a"
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 02/17] dhcp: Include sys/types.h for u_int* defs
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
  2015-12-19 23:52 ` [PATCH 01/17] powertop: Include right headers for timval struct Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-21 12:11   ` Burton, Ross
  2015-12-19 23:52 ` [PATCH 03/17] blktrace: Include <sys/types.h for dev_t Khem Raj
                   ` (15 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../dhcp/0001-include-missing-sys-types.h.patch    | 56 ++++++++++++++++++++++
 meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb       |  1 +
 2 files changed, 57 insertions(+)
 create mode 100644 meta/recipes-connectivity/dhcp/dhcp/0001-include-missing-sys-types.h.patch

diff --git a/meta/recipes-connectivity/dhcp/dhcp/0001-include-missing-sys-types.h.patch b/meta/recipes-connectivity/dhcp/dhcp/0001-include-missing-sys-types.h.patch
new file mode 100644
index 0000000..6d40290
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/0001-include-missing-sys-types.h.patch
@@ -0,0 +1,56 @@
+From 971491b6d7ab47d2f92f34269a129d0347fba15a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 14 Sep 2015 23:51:38 +0000
+Subject: [PATCH] include missing sys/types.h
+
+Code uses plain typedefs defines in this header but does not include it
+Fixes
+
+error: unknown type name 'u_int16_t'; did you mean 'uint16_t'?
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ dst/dst_api.c     | 1 +
+ dst/dst_support.c | 1 +
+ dst/hmac_link.c   | 1 +
+ 3 files changed, 3 insertions(+)
+
+diff --git a/dst/dst_api.c b/dst/dst_api.c
+index a77abd2..7885538 100644
+--- a/dst/dst_api.c
++++ b/dst/dst_api.c
+@@ -49,6 +49,7 @@
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
++#include <sys/types.h>
+ #include <netinet/in.h>
+ 
+ #include "cdefs.h"
+diff --git a/dst/dst_support.c b/dst/dst_support.c
+index 8e08a0c..f353ec6 100644
+--- a/dst/dst_support.c
++++ b/dst/dst_support.c
+@@ -25,6 +25,7 @@
+ #include <sys/stat.h>
+ #include <netinet/in.h>
+ #include <sys/socket.h>
++#include <sys/types.h>
+ 
+ #include "cdefs.h"
+ #include "osdep.h"
+diff --git a/dst/hmac_link.c b/dst/hmac_link.c
+index b812c1c..a7de622 100644
+--- a/dst/hmac_link.c
++++ b/dst/hmac_link.c
+@@ -31,6 +31,7 @@
+ #include <sys/time.h>
+ #include <netinet/in.h>
+ #include <sys/socket.h>
++#include <sys/types.h>
+ 
+ #include "cdefs.h"
+ #include "osdep.h"
+-- 
+2.5.2
+
diff --git a/meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb b/meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb
index b4a05fc..436a32e 100644
--- a/meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb
+++ b/meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb
@@ -6,6 +6,7 @@ SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
             file://fixsepbuild.patch \
             file://dhclient-script-drop-resolv.conf.dhclient.patch \
             file://replace-ifconfig-route.patch \
+            file://0001-include-missing-sys-types.h.patch \
            "
 
 SRC_URI[md5sum] = "5a284875dd2c12ddd388416d69156a67"
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 03/17] blktrace: Include <sys/types.h for dev_t
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
  2015-12-19 23:52 ` [PATCH 01/17] powertop: Include right headers for timval struct Khem Raj
  2015-12-19 23:52 ` [PATCH 02/17] dhcp: Include sys/types.h for u_int* defs Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-21 12:12   ` Burton, Ross
  2015-12-19 23:52 ` [PATCH 04/17] ppp: Fix build with musl Khem Raj
                   ` (14 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...-include-sys-types.h-for-dev_t-definition.patch | 30 ++++++++++++++++++++++
 meta/recipes-kernel/blktrace/blktrace_git.bb       |  4 ++-
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-kernel/blktrace/blktrace/0001-include-sys-types.h-for-dev_t-definition.patch

diff --git a/meta/recipes-kernel/blktrace/blktrace/0001-include-sys-types.h-for-dev_t-definition.patch b/meta/recipes-kernel/blktrace/blktrace/0001-include-sys-types.h-for-dev_t-definition.patch
new file mode 100644
index 0000000..f63868f
--- /dev/null
+++ b/meta/recipes-kernel/blktrace/blktrace/0001-include-sys-types.h-for-dev_t-definition.patch
@@ -0,0 +1,30 @@
+From 6b5bbdfaac7f216fe8a02c4cf29e5eb2aee5a409 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 15 Sep 2015 00:01:00 +0000
+Subject: [PATCH] include sys/types.h for dev_t definition
+
+Avoids the build failures when sys/types.h does not get included
+indirectly through other headers.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Status: Submitted
+
+ blktrace.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/blktrace.h b/blktrace.h
+index 380aec7..944fc08 100644
+--- a/blktrace.h
++++ b/blktrace.h
+@@ -5,6 +5,7 @@
+ #include <limits.h>
+ #include <byteswap.h>
+ #include <endian.h>
++#include <sys/types.h>
+ 
+ #include "blktrace_api.h"
+ #include "rbtree.h"
+-- 
+2.5.2
+
diff --git a/meta/recipes-kernel/blktrace/blktrace_git.bb b/meta/recipes-kernel/blktrace/blktrace_git.bb
index 5b0be42..957cb70 100644
--- a/meta/recipes-kernel/blktrace/blktrace_git.bb
+++ b/meta/recipes-kernel/blktrace/blktrace_git.bb
@@ -9,7 +9,9 @@ SRCREV = "43fc870ce04e963def45dfc0d1ed4ea21ef10d4b"
 PV = "1.1.0+git${SRCPV}"
 
 SRC_URI = "git://git.kernel.dk/blktrace.git \
-           file://ldflags.patch"
+           file://ldflags.patch \
+           file://0001-include-sys-types.h-for-dev_t-definition.patch \
+"
 
 S = "${WORKDIR}/git"
 
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 04/17] ppp: Fix build with musl
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (2 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 03/17] blktrace: Include <sys/types.h for dev_t Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-19 23:52 ` [PATCH 05/17] tcp-wrappers: " Khem Raj
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

Therer are assumptions about glibc headers and features which needs to
be addressed for musl

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../ppp/ppp/0001-Fix-build-with-musl.patch         | 163 +++++++++++++++++++++
 meta/recipes-connectivity/ppp/ppp_2.4.7.bb         |   3 +
 2 files changed, 166 insertions(+)
 create mode 100644 meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch

diff --git a/meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch b/meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch
new file mode 100644
index 0000000..763e374
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch
@@ -0,0 +1,163 @@
+From 52a1e41d7541b2c936285844c59bd1be21797860 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 May 2015 14:57:05 -0700
+Subject: [PATCH] Fix build with musl
+
+There are several assumption about glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ include/net/ppp_defs.h                  | 2 ++
+ pppd/Makefile.linux                     | 2 +-
+ pppd/magic.h                            | 6 +++---
+ pppd/plugins/rp-pppoe/config.h          | 5 ++++-
+ pppd/plugins/rp-pppoe/plugin.c          | 1 -
+ pppd/plugins/rp-pppoe/pppoe-discovery.c | 8 ++++----
+ pppd/plugins/rp-pppoe/pppoe.h           | 2 +-
+ pppd/sys-linux.c                        | 3 ++-
+ 8 files changed, 17 insertions(+), 12 deletions(-)
+
+diff --git a/include/net/ppp_defs.h b/include/net/ppp_defs.h
+index b06eda5..dafa36c 100644
+--- a/include/net/ppp_defs.h
++++ b/include/net/ppp_defs.h
+@@ -38,6 +38,8 @@
+ #ifndef _PPP_DEFS_H_
+ #define _PPP_DEFS_H_
+ 
++#include <sys/time.h>
++
+ /*
+  * The basic PPP frame.
+  */
+diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
+index 8ab2102..d7e2564 100644
+--- a/pppd/Makefile.linux
++++ b/pppd/Makefile.linux
+@@ -126,7 +126,7 @@ LIBS	+= -lcrypt
+ #endif
+ 
+ ifdef USE_LIBUTIL
+-CFLAGS	+= -DHAVE_LOGWTMP=1
++#CFLAGS	+= -DHAVE_LOGWTMP=1
+ LIBS	+= -lutil
+ endif
+ 
+diff --git a/pppd/magic.h b/pppd/magic.h
+index c81213b..9d399e3 100644
+--- a/pppd/magic.h
++++ b/pppd/magic.h
+@@ -42,8 +42,8 @@
+  * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $
+  */
+ 
+-void magic_init __P((void));	/* Initialize the magic number generator */
+-u_int32_t magic __P((void));	/* Returns the next magic number */
++void magic_init (void);	/* Initialize the magic number generator */
++u_int32_t magic (void);	/* Returns the next magic number */
+ 
+ /* Fill buffer with random bytes */
+-void random_bytes __P((unsigned char *buf, int len));
++void random_bytes (unsigned char *buf, int len);
+diff --git a/pppd/plugins/rp-pppoe/config.h b/pppd/plugins/rp-pppoe/config.h
+index 5703087..fff032e 100644
+--- a/pppd/plugins/rp-pppoe/config.h
++++ b/pppd/plugins/rp-pppoe/config.h
+@@ -78,8 +78,9 @@
+ #define HAVE_NET_IF_ARP_H 1
+ 
+ /* Define if you have the <net/ethernet.h> header file.  */
++#ifdef __GLIBC__
+ #define HAVE_NET_ETHERNET_H 1
+-
++#endif
+ /* Define if you have the <net/if.h> header file.  */
+ #define HAVE_NET_IF_H 1
+ 
+@@ -102,7 +103,9 @@
+ #define HAVE_NETPACKET_PACKET_H 1
+ 
+ /* Define if you have the <sys/cdefs.h> header file.  */
++#ifdef __GLIBC__
+ #define HAVE_SYS_CDEFS_H 1
++#endif
+ 
+ /* Define if you have the <sys/dlpi.h> header file.  */
+ /* #undef HAVE_SYS_DLPI_H */
+diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
+index a8c2bb4..ca34d79 100644
+--- a/pppd/plugins/rp-pppoe/plugin.c
++++ b/pppd/plugins/rp-pppoe/plugin.c
+@@ -46,7 +46,6 @@ static char const RCSID[] =
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <signal.h>
+-#include <net/ethernet.h>
+ #include <net/if_arp.h>
+ #include <linux/ppp_defs.h>
+ #include <linux/if_pppox.h>
+diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c
+index 3d3bf4e..d42f619 100644
+--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
++++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
+@@ -27,10 +27,6 @@
+ #include <linux/if_packet.h>
+ #endif
+ 
+-#ifdef HAVE_NET_ETHERNET_H
+-#include <net/ethernet.h>
+-#endif
+-
+ #ifdef HAVE_ASM_TYPES_H
+ #include <asm/types.h>
+ #endif
+@@ -47,6 +43,10 @@
+ #include <net/if_arp.h>
+ #endif
+ 
++#ifndef __GLIBC__
++#define error(x...) fprintf(stderr, x)
++#endif
++
+ char *xstrdup(const char *s);
+ void usage(void);
+ 
+diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
+index 9ab2eee..75b9004 100644
+--- a/pppd/plugins/rp-pppoe/pppoe.h
++++ b/pppd/plugins/rp-pppoe/pppoe.h
+@@ -92,7 +92,7 @@ typedef unsigned long UINT32_t;
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
+-#ifndef HAVE_SYS_DLPI_H
++#if !defined HAVE_SYS_DLPI_H && defined HAVE_NET_ETHERNET_H
+ #include <netinet/if_ether.h>
+ #endif
+ #endif
+diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
+index a105505..49b0273 100644
+--- a/pppd/sys-linux.c
++++ b/pppd/sys-linux.c
+@@ -112,7 +112,7 @@
+ #include <linux/types.h>
+ #include <linux/if.h>
+ #include <linux/if_arp.h>
+-#include <linux/route.h>
++/* #include <linux/route.h> */
+ #include <linux/if_ether.h>
+ #endif
+ #include <netinet/in.h>
+@@ -145,6 +145,7 @@
+ #endif
+ 
+ #ifdef INET6
++#include <net/route.h>
+ #ifndef _LINUX_IN6_H
+ /*
+  *    This is in linux/include/net/ipv6.h.
+-- 
+2.1.4
+
diff --git a/meta/recipes-connectivity/ppp/ppp_2.4.7.bb b/meta/recipes-connectivity/ppp/ppp_2.4.7.bb
index 5f06034..4437b5c 100644
--- a/meta/recipes-connectivity/ppp/ppp_2.4.7.bb
+++ b/meta/recipes-connectivity/ppp/ppp_2.4.7.bb
@@ -32,6 +32,9 @@ SRC_URI = "http://ppp.samba.org/ftp/ppp/ppp-${PV}.tar.gz \
            file://fix-CVE-2015-3310.patch \
 "
 
+SRC_URI_append_libc-musl = "\
+           file://0001-Fix-build-with-musl.patch \
+"
 SRC_URI[md5sum] = "78818f40e6d33a1d1de68a1551f6595a"
 SRC_URI[sha256sum] = "02e0a3dd3e4799e33103f70ec7df75348c8540966ee7c948e4ed8a42bbccfb30"
 
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 00/17] musl fixes phase 2
@ 2015-12-19 23:52 Khem Raj
  2015-12-19 23:52 ` [PATCH 01/17] powertop: Include right headers for timval struct Khem Raj
                   ` (17 more replies)
  0 siblings, 18 replies; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

This set of fixes lets core-image-base/core-image-weston/core-image-sato
compile and boot using TCLIBC=musl

The following changes since commit e1a37899da56014693f08d1c39cb6ec0a4ed2bf4:

  buildstats-summary/toaster: Cope with removal of get_bn() (2015-12-18 13:50:54 +0000)

are available in the git repository at:

  git://github.com/kraj/openembedded-core kraj/musl-fixes
  https://github.com/kraj/openembedded-core/tree/kraj/musl-fixes

Khem Raj (17):
  powertop: Include right headers for timval struct
  dhcp: Include sys/types.h for u_int* defs
  blktrace: Include <sys/types.h for dev_t
  ppp: Fix build with musl
  tcp-wrappers: Fix build with musl
  tcmode-default: Use glibc for nativesdk version even on uclibc and
    musl
  libtirpc: Fix build for musl
  fts: Add recipe
  valgrind: Define __UCLIBC__ for uclibc based systems
  connman: include config.h for HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR
  libcgroup: Add dependency on fts when building on musl
  linux-libc-headers: Port patches for linux-headers for musl
  xserver-xorg: Fix build with musl
  gdk-pixbuf: Fix latent build  issue exposed by musl
  argp-standalone: Add recipe
  gnutls: Link with libargp on musl and depend on argp-standalone
  util-linux: Fix ptest builds on musl

 meta/conf/distro/include/tcmode-default.inc        |    4 +-
 .../0003-Fix-header-inclusions-for-musl.patch      |   79 +-
 .../dhcp/0001-include-missing-sys-types.h.patch    |   56 +
 meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb       |    1 +
 .../ppp/ppp/0001-Fix-build-with-musl.patch         |  163 ++
 meta/recipes-connectivity/ppp/ppp_2.4.7.bb         |    3 +
 meta/recipes-core/fts/fts.bb                       |   38 +
 .../fts/fts/fts-header-correctness.patch           |   20 +
 meta/recipes-core/fts/fts/fts-uclibc.patch         |   45 +
 meta/recipes-core/fts/fts/gcc5.patch               | 1363 +++++++++++++++
 meta/recipes-core/fts/fts/remove_cdefs.patch       |   64 +
 meta/recipes-core/fts/fts/stdint.patch             |   10 +
 .../libcgroup/libcgroup/musl-decls-compat.patch    |  235 +++
 meta/recipes-core/libcgroup/libcgroup_0.41.bb      |    4 +
 .../util-linux/uuid-test-error-api.patch           |   92 +
 meta/recipes-core/util-linux/util-linux_2.27.1.bb  |    1 +
 meta/recipes-devtools/valgrind/valgrind_3.10.1.bb  |    2 +
 ...rpcbynumber-and-getrpcbyname-if-those-are.patch |   89 +
 ...-use-of-internal-glibc-sys-cdefs.h-header.patch | 1754 ++++++++++++++++++++
 ...gure-option-to-disable-DES-authentication.patch |   99 ++
 ...-compile-error-IPPORT_RESERVED-undeclared.patch |   35 +
 ...0006-Define-struct-rpcent-on-non-GNU-libc.patch |   50 +
 .../libtirpc/libtirpc/0007-use-bsd-queue.patch     |  561 +++++++
 meta/recipes-extended/libtirpc/libtirpc/nis.h      |  545 ++++++
 meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb   |   14 +
 .../tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch |   31 +
 .../tcp-wrappers/tcp-wrappers_7.6.bb               |    4 +
 .../gdk-pixbuf/gdk-pixbuf/libc_memfuncs.patch      |   25 +
 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.1.bb |    1 +
 .../xserver-xorg/musl-arm-inb-outb.patch           |   18 +
 .../xorg-xserver/xserver-xorg_1.18.0.bb            |    4 +-
 ...-include-sys-types.h-for-dev_t-definition.patch |   30 +
 meta/recipes-kernel/blktrace/blktrace_git.bb       |    4 +-
 ...mpat.h-fix-some-issues-arising-from-in6.h.patch |   81 +
 ...t.h-prevent-redefinition-of-struct-ethhdr.patch |   58 +
 ...remove-inclusion-of-sysinfo.h-in-kernel.h.patch |   31 +
 .../linux-libc-headers/linux-libc-headers_4.1.bb   |    5 +
 ...0001-include-rquired-headers-for-typedefs.patch |   45 +
 meta/recipes-kernel/powertop/powertop_2.8.bb       |    4 +-
 .../argp-standalone/argp-standalone_1.3.bb         |   28 +
 .../files/0001-throw-in-funcdef.patch              |   84 +
 .../argp-standalone/files/0002-isprint.patch       |   51 +
 meta/recipes-support/gnutls/gnutls.inc             |    2 +
 43 files changed, 5805 insertions(+), 28 deletions(-)
 create mode 100644 meta/recipes-connectivity/dhcp/dhcp/0001-include-missing-sys-types.h.patch
 create mode 100644 meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch
 create mode 100644 meta/recipes-core/fts/fts.bb
 create mode 100644 meta/recipes-core/fts/fts/fts-header-correctness.patch
 create mode 100644 meta/recipes-core/fts/fts/fts-uclibc.patch
 create mode 100644 meta/recipes-core/fts/fts/gcc5.patch
 create mode 100644 meta/recipes-core/fts/fts/remove_cdefs.patch
 create mode 100644 meta/recipes-core/fts/fts/stdint.patch
 create mode 100644 meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0007-use-bsd-queue.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/nis.h
 create mode 100644 meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch
 create mode 100644 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/libc_memfuncs.patch
 create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch
 create mode 100644 meta/recipes-kernel/blktrace/blktrace/0001-include-sys-types.h-for-dev_t-definition.patch
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
 create mode 100644 meta/recipes-kernel/powertop/powertop/0001-include-rquired-headers-for-typedefs.patch
 create mode 100644 meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
 create mode 100644 meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch
 create mode 100644 meta/recipes-support/argp-standalone/files/0002-isprint.patch

-- 
2.6.4



^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 05/17] tcp-wrappers: Fix build with musl
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (3 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 04/17] ppp: Fix build with musl Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-19 23:52 ` [PATCH 06/17] tcmode-default: Use glibc for nativesdk version even on uclibc and musl Khem Raj
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch | 31 ++++++++++++++++++++++
 .../tcp-wrappers/tcp-wrappers_7.6.bb               |  4 +++
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch

diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch
new file mode 100644
index 0000000..eee640e
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch
@@ -0,0 +1,31 @@
+__BEGIN_DECLS/__END_DECLS are BSD specific and not defined in musl
+glibc and uclibc had sys/cdefs.h doing it.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: tcp_wrappers_7.6/tcpd.h
+===================================================================
+--- tcp_wrappers_7.6.orig/tcpd.h
++++ tcp_wrappers_7.6/tcpd.h
+@@ -11,7 +11,9 @@
+ #include <netinet/in.h>
+ #include <stdio.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /* Structure to describe one communications endpoint. */
+ 
+@@ -252,6 +254,8 @@ extern char *fix_strtok();
+ extern char *my_strtok();
+ #endif
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb b/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
index 2630478..5fdbbce 100644
--- a/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
@@ -43,6 +43,7 @@ SRC_URI = "ftp://ftp.porcupine.org/pub/security/tcp_wrappers_${PV}.tar.gz \
            file://try-from.8 \
            file://safe_finger.8 \
            file://makefile-fix-parallel.patch \
+           file://musl-decls.patch \
            "
 
 SRC_URI[md5sum] = "e6fa25f71226d090f34de3f6b122fb5a"
@@ -73,6 +74,9 @@ EXTRA_OEMAKE = "'CC=${CC}' \
 
 EXTRA_OEMAKE_NETGROUP = "-DNETGROUP -DUSE_GETDOMAIN"
 EXTRA_OEMAKE_NETGROUP_libc-uclibc = "-DUSE_GETDOMAIN"
+EXTRA_OEMAKE_NETGROUP_libc-musl = "-DUSE_GETDOMAIN"
+
+EXTRA_OEMAKE_append_libc-musl = " 'LIBS='"
 
 do_compile () {
 	oe_runmake 'TABLES=-DHOSTS_DENY=\"${sysconfdir}/hosts.deny\" -DHOSTS_ALLOW=\"${sysconfdir}/hosts.allow\"' \
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 06/17] tcmode-default: Use glibc for nativesdk version even on uclibc and musl
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (4 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 05/17] tcp-wrappers: " Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-19 23:52 ` [PATCH 07/17] libtirpc: Fix build for musl Khem Raj
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

We do not have musl or uclibc based systems for building OE itself. Most
of build servers run glibc, there will be other issues to build OE on a
uclibc based build system

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/conf/distro/include/tcmode-default.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
index 51be202..16507c4 100644
--- a/meta/conf/distro/include/tcmode-default.inc
+++ b/meta/conf/distro/include/tcmode-default.inc
@@ -17,9 +17,9 @@ PREFERRED_PROVIDER_virtual/${SDK_PREFIX}compilerlibs = "nativesdk-gcc-runtime"
 
 # Default libc config
 PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "${TCLIBC}"
-PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-for-gcc ?= "nativesdk-${TCLIBC}"
+PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-for-gcc ?= "nativesdk-glibc"
 PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-initial = "${TCLIBC}-initial"
-PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial = "nativesdk-${TCLIBC}-initial"
+PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial = "nativesdk-glibc-initial"
 PREFERRED_PROVIDER_virtual/gettext ??= "gettext"
 
 GCCVERSION ?= "5.%"
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 07/17] libtirpc: Fix build for musl
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (5 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 06/17] tcmode-default: Use glibc for nativesdk version even on uclibc and musl Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-29  1:17   ` Khem Raj
  2015-12-19 23:52 ` [PATCH 08/17] fts: Add recipe Khem Raj
                   ` (10 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

NIS support is really not there in musl and some fixes
are break the linux = glibc assumption

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...rpcbynumber-and-getrpcbyname-if-those-are.patch |   89 +
 ...-use-of-internal-glibc-sys-cdefs.h-header.patch | 1754 ++++++++++++++++++++
 ...gure-option-to-disable-DES-authentication.patch |   99 ++
 ...-compile-error-IPPORT_RESERVED-undeclared.patch |   35 +
 ...0006-Define-struct-rpcent-on-non-GNU-libc.patch |   50 +
 .../libtirpc/libtirpc/0007-use-bsd-queue.patch     |  561 +++++++
 meta/recipes-extended/libtirpc/libtirpc/nis.h      |  545 ++++++
 meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb   |   14 +
 8 files changed, 3147 insertions(+)
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0007-use-bsd-queue.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/nis.h

diff --git a/meta/recipes-extended/libtirpc/libtirpc/0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch b/meta/recipes-extended/libtirpc/libtirpc/0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
new file mode 100644
index 0000000..93149b9
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc/0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
@@ -0,0 +1,89 @@
+From fe103d60b2d4c71f11095232dadc8352c6c096da Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 24 Apr 2014 09:19:45 +0200
+Subject: [PATCH 2/9] Provide getrpcbynumber and getrpcbyname if those are
+ missing
+
+We enable the config.h again and check if getrpcbynumber and
+getrpcbyname exists on the building patform. If it does not exist, then
+provide those functions.
+
+This is needed for musl libc.
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+Upstream-Status: Pending
+
+ configure.ac    |  6 ++++--
+ src/getrpcent.c | 10 ++++++++--
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 10d17ea..0180801 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -24,14 +24,16 @@ if test "x$enable_ipv6" != xno; then
+ fi
+ 
+ AC_PROG_CC
+-m4_pattern_allow(AM_CONFIG_HEADERS(config.h))
++AC_CONFIG_HEADERS([config.h])
+ AC_PROG_LIBTOOL
+ AC_HEADER_DIRENT
+ AC_PREFIX_DEFAULT(/usr)
+ AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h])
+ AC_CHECK_LIB([pthread], [pthread_create])
+ AC_CHECK_LIB([nsl], [yp_get_default_domain])
+-
++AC_CHECK_FUNCS([getrpcbyname getrpcbynumber])
+ 
+ AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile])
+ AC_OUTPUT(libtirpc.pc)
++
++
+diff --git a/src/getrpcent.c b/src/getrpcent.c
+index 1b54b6d..6da006a 100644
+--- a/src/getrpcent.c
++++ b/src/getrpcent.c
+@@ -50,6 +50,10 @@
+ #include <libc_private.h>
+ #endif
+ 
++#if HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ /*
+  * Internet version.
+  */
+@@ -89,7 +93,7 @@ _rpcdata()
+ 	return (d);
+ }
+ 
+-#ifdef GQ
++#if !HAVE_GETRPCBYNYMBER
+ struct rpcent *
+ getrpcbynumber(number)
+ 	int number;
+@@ -135,7 +139,9 @@ no_yp:
+ 	endrpcent();
+ 	return (p);
+ }
++#endif /* !HAVE_GETRPCBYNUMBER */
+ 
++#if !HAVE_GETRPCBYNAME
+ struct rpcent *
+ getrpcbyname(name)
+ 	const char *name;
+@@ -158,7 +164,7 @@ done:
+ 	endrpcent();
+ 	return (rpc);
+ }
+-#endif /* GQ */
++#endif /* !HAVE_GETRPCBYNAME */
+ 
+ void
+ setrpcent(f)
+-- 
+2.2.0
+
diff --git a/meta/recipes-extended/libtirpc/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch b/meta/recipes-extended/libtirpc/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
new file mode 100644
index 0000000..5585d7a
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
@@ -0,0 +1,1754 @@
+From d859292140e52c055b2a51ded67cbb966531ac4c Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 15 Dec 2014 09:29:32 +0100
+Subject: [PATCH 3/9] Avoid use of internal glibc sys/cdefs.h header
+
+This header was never intended to be used by programs.
+
+Expand the macros used, __BEGIN_CDECLS, __END_CDECLS and __P()
+
+The __THROW macro is a non-portable hint for optimization so we simply
+remove those.
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+Upstream-Status: Pending
+
+ src/auth_des.c        |  2 --
+ src/auth_none.c       |  1 -
+ src/auth_time.c       |  1 -
+ src/auth_unix.c       |  1 -
+ src/authdes_prot.c    |  1 -
+ src/authunix_prot.c   |  1 -
+ src/bindresvport.c    |  1 -
+ src/clnt_bcast.c      |  1 -
+ src/clnt_perror.c     |  3 --
+ src/clnt_simple.c     |  1 -
+ src/crypt_client.c    |  1 -
+ src/des_crypt.c       |  1 -
+ src/getnetconfig.c    |  1 -
+ src/getnetpath.c      |  2 --
+ src/getpeereid.c      |  1 -
+ src/getpublickey.c    |  3 --
+ src/key_call.c        |  1 -
+ src/key_prot_xdr.c    |  1 -
+ src/mt_misc.c         |  1 -
+ src/pmap_clnt.c       |  1 -
+ src/pmap_getmaps.c    |  1 -
+ src/rpc_com.h         |  9 ++++--
+ src/rpc_generic.c     |  1 -
+ src/rpcb_st_xdr.c     |  1 -
+ src/rpcdname.c        |  1 -
+ src/svc_dg.c          |  1 -
+ src/svc_simple.c      |  1 -
+ src/svc_vc.c          |  1 -
+ src/xdr.c             |  1 -
+ src/xdr_array.c       |  1 -
+ src/xdr_float.c       |  1 -
+ src/xdr_mem.c         |  1 -
+ src/xdr_rec.c         |  2 --
+ src/xdr_reference.c   |  2 --
+ src/xdr_sizeof.c      |  1 -
+ src/xdr_stdio.c       |  1 -
+ tirpc/netconfig.h     |  8 +++--
+ tirpc/rpc/auth.h      | 89 ++++++++++++++++++++++++++++++++++++++-------------
+ tirpc/rpc/auth_des.h  | 16 ++++++---
+ tirpc/rpc/auth_gss.h  | 47 ++++++++++++++-------------
+ tirpc/rpc/auth_unix.h |  9 ++++--
+ tirpc/rpc/clnt.h      | 57 ++++++++++++++++++++++++---------
+ tirpc/rpc/clnt_soc.h  | 33 +++++++++++++------
+ tirpc/rpc/des_crypt.h | 25 +++++++++++----
+ tirpc/rpc/nettype.h   |  8 +++--
+ tirpc/rpc/pmap_clnt.h |  9 ++++--
+ tirpc/rpc/pmap_prot.h |  9 ++++--
+ tirpc/rpc/pmap_rmt.h  |  9 ++++--
+ tirpc/rpc/rpc.h       | 18 ++++++++---
+ tirpc/rpc/rpc_com.h   |  9 ++++--
+ tirpc/rpc/rpc_msg.h   |  8 +++--
+ tirpc/rpc/rpcb_clnt.h |  8 +++--
+ tirpc/rpc/rpcent.h    | 12 ++++---
+ tirpc/rpc/svc.h       | 65 +++++++++++++++++++++++++++----------
+ tirpc/rpc/svc_auth.h  |  8 +++--
+ tirpc/rpc/svc_soc.h   | 49 ++++++++++++++++++++--------
+ tirpc/rpc/xdr.h       | 17 +++++++---
+ 57 files changed, 369 insertions(+), 196 deletions(-)
+
+diff --git a/src/auth_des.c b/src/auth_des.c
+index cff777c..1ccbf28 100644
+--- a/src/auth_des.c
++++ b/src/auth_des.c
+@@ -38,7 +38,6 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+-#include <sys/cdefs.h>
+ #include <rpc/des_crypt.h>
+ #include <syslog.h>
+ #include <rpc/types.h>
+@@ -52,7 +51,6 @@
+ 
+ #if defined(LIBC_SCCS) && !defined(lint)
+ #endif
+-#include <sys/cdefs.h>
+ 
+ #include "debug.h"
+ 
+diff --git a/src/auth_none.c b/src/auth_none.c
+index affc92b..0b0bbd1 100644
+--- a/src/auth_none.c
++++ b/src/auth_none.c
+@@ -31,7 +31,6 @@
+ static char *sccsid = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro";
+ static char *sccsid = "@(#)auth_none.c	2.1 88/07/29 4.0 RPCSRC";
+ #endif
+-#include <sys/cdefs.h>
+ __FBSDID("$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.12 2002/03/22 23:18:35 obrien Exp $");
+ */
+ 
+diff --git a/src/auth_time.c b/src/auth_time.c
+index 7cfbb7e..ace86bf 100644
+--- a/src/auth_time.c
++++ b/src/auth_time.c
+@@ -25,7 +25,6 @@
+  *	needed to deal with TCP connections.
+  */
+ 
+-#include <sys/cdefs.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+diff --git a/src/auth_unix.c b/src/auth_unix.c
+index 4b9b13f..3009543 100644
+--- a/src/auth_unix.c
++++ b/src/auth_unix.c
+@@ -26,7 +26,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * auth_unix.c, Implements UNIX style authentication parameters.
+diff --git a/src/authdes_prot.c b/src/authdes_prot.c
+index ed061a5..227d08a 100644
+--- a/src/authdes_prot.c
++++ b/src/authdes_prot.c
+@@ -1,4 +1,3 @@
+-#include <sys/cdefs.h>
+ /*
+  * Copyright (c) 2009, Sun Microsystems, Inc.
+  * All rights reserved.
+diff --git a/src/authunix_prot.c b/src/authunix_prot.c
+index bf76a9d..0a04336 100644
+--- a/src/authunix_prot.c
++++ b/src/authunix_prot.c
+@@ -26,7 +26,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * authunix_prot.c
+diff --git a/src/bindresvport.c b/src/bindresvport.c
+index d6d9c14..950fbd1 100644
+--- a/src/bindresvport.c
++++ b/src/bindresvport.c
+@@ -26,7 +26,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * Copyright (c) 1987 by Sun Microsystems, Inc.
+diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c
+index 373d8a5..be05af4 100644
+--- a/src/clnt_bcast.c
++++ b/src/clnt_bcast.c
+@@ -28,7 +28,6 @@
+ /*
+  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
+  */
+-#include <sys/cdefs.h>
+ 
+ /*
+  * clnt_bcast.c
+diff --git a/src/clnt_perror.c b/src/clnt_perror.c
+index bcd8af8..fb7fb80 100644
+--- a/src/clnt_perror.c
++++ b/src/clnt_perror.c
+@@ -27,9 +27,6 @@
+  */
+ 
+ /*
+-#include <sys/cdefs.h>
+-*/
+-/*
+  * clnt_perror.c
+  *
+  * Copyright (C) 1984, Sun Microsystems, Inc.
+diff --git a/src/clnt_simple.c b/src/clnt_simple.c
+index 7ee9542..1700060 100644
+--- a/src/clnt_simple.c
++++ b/src/clnt_simple.c
+@@ -29,7 +29,6 @@
+  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * clnt_simple.c
+diff --git a/src/crypt_client.c b/src/crypt_client.c
+index 670b253..f393926 100644
+--- a/src/crypt_client.c
++++ b/src/crypt_client.c
+@@ -30,7 +30,6 @@
+  * SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ #include <err.h>
+ #include <sys/types.h>
+diff --git a/src/des_crypt.c b/src/des_crypt.c
+index 37a1022..980a6cb 100644
+--- a/src/des_crypt.c
++++ b/src/des_crypt.c
+@@ -39,7 +39,6 @@
+ static char sccsid[] = "@(#)des_crypt.c	2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02/08 SMI";
+ #endif
+ #endif
+-#include <sys/cdefs.h>
+ 
+ static int common_crypt( char *, char *, unsigned, unsigned, struct desparams * );
+ int (*__des_crypt_LOCAL)() = 0;
+diff --git a/src/getnetconfig.c b/src/getnetconfig.c
+index 635c03a..92e7c43 100644
+--- a/src/getnetconfig.c
++++ b/src/getnetconfig.c
+@@ -32,7 +32,6 @@
+  
+ #include <pthread.h>
+ #include <reentrant.h>
+-#include <sys/cdefs.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <netconfig.h>
+diff --git a/src/getnetpath.c b/src/getnetpath.c
+index cd80dca..7c19932 100644
+--- a/src/getnetpath.c
++++ b/src/getnetpath.c
+@@ -25,13 +25,11 @@
+  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+-#include <sys/cdefs.h>
+ 
+ /*
+  * Copyright (c) 1989 by Sun Microsystems, Inc.
+  */
+ 
+-#include <sys/cdefs.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <netconfig.h>
+diff --git a/src/getpeereid.c b/src/getpeereid.c
+index 57ee197..dd85270 100644
+--- a/src/getpeereid.c
++++ b/src/getpeereid.c
+@@ -24,7 +24,6 @@
+  * SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ #include <sys/param.h>
+ #include <sys/socket.h>
+diff --git a/src/getpublickey.c b/src/getpublickey.c
+index 85935d8..764a5f9 100644
+--- a/src/getpublickey.c
++++ b/src/getpublickey.c
+@@ -25,9 +25,6 @@
+  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+-/*
+-#include <sys/cdefs.h>
+-*/
+ 
+ /*
+  * publickey.c
+diff --git a/src/key_call.c b/src/key_call.c
+index 8b9f388..1a6430b 100644
+--- a/src/key_call.c
++++ b/src/key_call.c
+@@ -30,7 +30,6 @@
+  */
+ 
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * key_call.c, Interface to keyserver
+diff --git a/src/key_prot_xdr.c b/src/key_prot_xdr.c
+index df2842f..772f582 100644
+--- a/src/key_prot_xdr.c
++++ b/src/key_prot_xdr.c
+@@ -33,7 +33,6 @@
+  */
+ /* Copyright (c)  1990, 1991 Sun Microsystems, Inc. */
+ 
+-#include <sys/cdefs.h>
+ 
+ /* 
+  * Compiled from key_prot.x using rpcgen.
+diff --git a/src/mt_misc.c b/src/mt_misc.c
+index 093086e..a50f385 100644
+--- a/src/mt_misc.c
++++ b/src/mt_misc.c
+@@ -1,5 +1,4 @@
+ 
+-#include <sys/cdefs.h>
+ #include <pthread.h>
+ #include <reentrant.h>
+ #include <rpc/rpc.h>
+diff --git a/src/pmap_clnt.c b/src/pmap_clnt.c
+index 1d5d153..4b5fd85 100644
+--- a/src/pmap_clnt.c
++++ b/src/pmap_clnt.c
+@@ -26,7 +26,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * pmap_clnt.c
+diff --git a/src/pmap_getmaps.c b/src/pmap_getmaps.c
+index 54338f7..853f724 100644
+--- a/src/pmap_getmaps.c
++++ b/src/pmap_getmaps.c
+@@ -26,7 +26,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * pmap_getmap.c
+diff --git a/src/rpc_com.h b/src/rpc_com.h
+index 38c2cfe..52a8c48 100644
+--- a/src/rpc_com.h
++++ b/src/rpc_com.h
+@@ -40,7 +40,6 @@
+ #ifndef _TIRPC_RPCCOM_H
+ #define	_TIRPC_RPCCOM_H
+ 
+-#include <sys/cdefs.h>
+ 
+ /* #pragma ident	"@(#)rpc_com.h	1.11	93/07/05 SMI" */
+ 
+@@ -54,7 +53,9 @@
+ #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
+     (u_int32_t)(now)->tv_usec)
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern u_int __rpc_get_a_size(int);
+ extern int __rpc_dtbsize(void);
+ extern struct netconfig * __rpcgettp(int);
+@@ -90,6 +91,8 @@ void __xprt_set_raddr(SVCXPRT *, const struct sockaddr_storage *);
+ SVCXPRT **__svc_xports;
+ int __svc_maxrec;
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _TIRPC_RPCCOM_H */
+diff --git a/src/rpc_generic.c b/src/rpc_generic.c
+index a43906c..0ceadb4 100644
+--- a/src/rpc_generic.c
++++ b/src/rpc_generic.c
+@@ -29,7 +29,6 @@
+  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * rpc_generic.c, Miscl routines for RPC.
+diff --git a/src/rpcb_st_xdr.c b/src/rpcb_st_xdr.c
+index c5d3575..08db745 100644
+--- a/src/rpcb_st_xdr.c
++++ b/src/rpcb_st_xdr.c
+@@ -35,7 +35,6 @@
+  * routines used with the rpcbind stats facility.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ #include <rpc/rpc.h>
+ 
+diff --git a/src/rpcdname.c b/src/rpcdname.c
+index 094cea3..3e6a988 100644
+--- a/src/rpcdname.c
++++ b/src/rpcdname.c
+@@ -25,7 +25,6 @@
+  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+-#include <sys/cdefs.h>
+ 
+ /*
+  * rpcdname.c
+diff --git a/src/svc_dg.c b/src/svc_dg.c
+index f8255cc..1fd6f92 100644
+--- a/src/svc_dg.c
++++ b/src/svc_dg.c
+@@ -31,7 +31,6 @@
+  * Copyright (c) 1986-1991 by Sun Microsystems Inc.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * svc_dg.c, Server side for connectionless RPC.
+diff --git a/src/svc_simple.c b/src/svc_simple.c
+index b6c371e..cb58002 100644
+--- a/src/svc_simple.c
++++ b/src/svc_simple.c
+@@ -29,7 +29,6 @@
+  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * svc_simple.c
+diff --git a/src/svc_vc.c b/src/svc_vc.c
+index 4d3ea51..9dba72a 100644
+--- a/src/svc_vc.c
++++ b/src/svc_vc.c
+@@ -27,7 +27,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * svc_vc.c, Server side for Connection Oriented based RPC. 
+diff --git a/src/xdr.c b/src/xdr.c
+index 1142a88..f3fb9ad 100644
+--- a/src/xdr.c
++++ b/src/xdr.c
+@@ -26,7 +26,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * xdr.c, Generic XDR routines implementation.
+diff --git a/src/xdr_array.c b/src/xdr_array.c
+index 216173d..7fc8fb8 100644
+--- a/src/xdr_array.c
++++ b/src/xdr_array.c
+@@ -27,7 +27,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * xdr_array.c, Generic XDR routines impelmentation.
+diff --git a/src/xdr_float.c b/src/xdr_float.c
+index 90daf3f..26bc865 100644
+--- a/src/xdr_float.c
++++ b/src/xdr_float.c
+@@ -27,7 +27,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * xdr_float.c, Generic XDR routines implementation.
+diff --git a/src/xdr_mem.c b/src/xdr_mem.c
+index bd86f00..ecdc932 100644
+--- a/src/xdr_mem.c
++++ b/src/xdr_mem.c
+@@ -26,7 +26,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * xdr_mem.h, XDR implementation using memory buffers.
+diff --git a/src/xdr_rec.c b/src/xdr_rec.c
+index 2aca623..7d535cf 100644
+--- a/src/xdr_rec.c
++++ b/src/xdr_rec.c
+@@ -27,8 +27,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+-#include <sys/cdefs.h>
+ 
+ /*
+  * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking"
+diff --git a/src/xdr_reference.c b/src/xdr_reference.c
+index affe19e..13f6410 100644
+--- a/src/xdr_reference.c
++++ b/src/xdr_reference.c
+@@ -26,8 +26,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+-#include <sys/cdefs.h>
+ 
+ /*
+  * xdr_reference.c, Generic XDR routines impelmentation.
+diff --git a/src/xdr_sizeof.c b/src/xdr_sizeof.c
+index a805e31..cc5414b 100644
+--- a/src/xdr_sizeof.c
++++ b/src/xdr_sizeof.c
+@@ -34,7 +34,6 @@
+  * when serialized using XDR.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ #include <rpc/types.h>
+ #include <rpc/xdr.h>
+diff --git a/src/xdr_stdio.c b/src/xdr_stdio.c
+index 45b1150..4410262 100644
+--- a/src/xdr_stdio.c
++++ b/src/xdr_stdio.c
+@@ -26,7 +26,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ /*
+  * xdr_stdio.c, XDR implementation on standard i/o file.
+diff --git a/tirpc/netconfig.h b/tirpc/netconfig.h
+index 7d6c2bc..c25788c 100644
+--- a/tirpc/netconfig.h
++++ b/tirpc/netconfig.h
+@@ -74,7 +74,9 @@ typedef struct {
+ #define NC_UDP		"udp"
+ #define NC_ICMP		"icmp"
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ extern void *setnetconfig (void);
+ extern struct netconfig *getnetconfig (void *);
+@@ -89,6 +91,8 @@ extern int endnetpath (void *);
+ extern void nc_perror (const char *);
+ extern char *nc_sperror (void);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _NETCONFIG_H_ */
+diff --git a/tirpc/rpc/auth.h b/tirpc/rpc/auth.h
+index 7c8f813..434d35c 100644
+--- a/tirpc/rpc/auth.h
++++ b/tirpc/rpc/auth.h
+@@ -48,7 +48,6 @@
+ 
+ #include <rpc/xdr.h>
+ #include <rpc/clnt_stat.h>
+-#include <sys/cdefs.h>
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ 
+@@ -164,9 +163,13 @@ union des_block {
+ 	char c[8];
+ };
+ typedef union des_block des_block;
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t xdr_des_block(XDR *, des_block *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Authentication info.  Opaque to client.
+@@ -277,9 +280,13 @@ auth_put(AUTH *auth)
+ 		xfunc, xwhere))
+ 
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern struct opaque_auth _null_auth;
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Any style authentication.  These routines can be used by any
+@@ -300,11 +307,15 @@ int authany_wrap(void), authany_unwrap(void);
+  *	int len;
+  *	int *aup_gids;
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern AUTH *authunix_create(char *, uid_t, uid_t, int, uid_t *);
+ extern AUTH *authunix_create_default(void);	/* takes no parameters */
+ extern AUTH *authnone_create(void);		/* takes no parameters */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ /*
+  * DES style authentication
+  * AUTH *authsecdes_create(servername, window, timehost, ckey)
+@@ -313,15 +324,23 @@ __END_DECLS
+  * 	const char *timehost;			- optional hostname to sync with
+  * 	des_block *ckey;		- optional conversation key to use
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *);
+ extern AUTH *authdes_seccreate (const char *, const u_int, const  char *,
+     const  des_block *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t xdr_opaque_auth		(XDR *, struct opaque_auth *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
+ #define authsys_create_default() authunix_create_default()
+@@ -329,36 +348,48 @@ __END_DECLS
+ /*
+  * Netname manipulation routines.
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int getnetname(char *);
+ extern int host2netname(char *, const char *, const char *);
+ extern int user2netname(char *, const uid_t, const char *);
+ extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *);
+ extern int netname2host(char *, char *, const int);
+ extern void passwd2des ( char *, char * );
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  *
+  * These routines interface to the keyserv daemon
+  *
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int key_decryptsession(const char *, des_block *);
+ extern int key_encryptsession(const char *, des_block *);
+ extern int key_gendes(des_block *);
+ extern int key_setsecret(const char *);
+ extern int key_secretkey_is_set(void);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Publickey routines.
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int getpublickey (const char *, char *);
+ extern int getpublicandprivatekey (char *, char *);
+ extern int getsecretkey (char *, char *, char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #ifdef KERBEROS
+ /*
+@@ -371,10 +402,14 @@ __END_DECLS
+  *	const char *timehost;			- optional hostname to sync with
+  *	int *status;				- kerberos status returned
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern AUTH	*authkerb_seccreate(const char *, const char *, const  char *,
+ 		    const u_int, const char *, int *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Map a kerberos credential into a unix cred.
+@@ -387,20 +422,28 @@ __END_DECLS
+  *	int *groups;
+  *
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int	authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *,
+ 		    short *, int * */);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ #endif /* KERBEROS */
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ struct svc_req;
+ struct rpc_msg;
+ enum auth_stat _svcauth_none (struct svc_req *, struct rpc_msg *);
+ enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *);
+ enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *);
+ enum auth_stat _svcauth_gss (struct svc_req *, struct rpc_msg *, bool_t *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #define AUTH_NONE	0		/* no authentication */
+ #define	AUTH_NULL	0		/* backward compatibility */
+diff --git a/tirpc/rpc/auth_des.h b/tirpc/rpc/auth_des.h
+index 39b5332..77e169d 100644
+--- a/tirpc/rpc/auth_des.h
++++ b/tirpc/rpc/auth_des.h
+@@ -114,17 +114,25 @@ struct authdes_verf {
+  * Map a des credential into a unix cred.
+  *
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int authdes_getucred( struct authdes_cred *, uid_t *, gid_t *, int *, gid_t * );
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t	xdr_authdes_cred(XDR *, struct authdes_cred *);
+ extern bool_t	xdr_authdes_verf(XDR *, struct authdes_verf *);
+ extern int	rtime(dev_t, struct netbuf *, int, struct timeval *,
+ 		    struct timeval *);
+ extern void	kgetnetname(char *);
+ extern enum auth_stat _svcauth_des(struct svc_req *, struct rpc_msg *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* ndef _TI_AUTH_DES_ */
+diff --git a/tirpc/rpc/auth_gss.h b/tirpc/rpc/auth_gss.h
+index d6f2bbd..a17b34b 100644
+--- a/tirpc/rpc/auth_gss.h
++++ b/tirpc/rpc/auth_gss.h
+@@ -104,28 +104,29 @@ struct rpc_gss_init_res {
+ #define MAXSEQ		0x80000000
+ 
+ /* Prototypes. */
+-__BEGIN_DECLS
+-bool_t	xdr_rpc_gss_cred	__P((XDR *xdrs, struct rpc_gss_cred *p));
+-bool_t	xdr_rpc_gss_init_args	__P((XDR *xdrs, gss_buffer_desc *p));
+-bool_t	xdr_rpc_gss_init_res	__P((XDR *xdrs, struct rpc_gss_init_res *p));
+-bool_t	xdr_rpc_gss_data	__P((XDR *xdrs, xdrproc_t xdr_func,
+-				     caddr_t xdr_ptr, gss_ctx_id_t ctx,
+-				     gss_qop_t qop, rpc_gss_svc_t svc,
+-				     u_int seq));
+-
+-AUTH   *authgss_create		__P((CLIENT *, gss_name_t,
+-				     struct rpc_gss_sec *));
+-AUTH   *authgss_create_default	__P((CLIENT *, char *, struct rpc_gss_sec *));
+-bool_t authgss_service		__P((AUTH *auth, int svc));
+-bool_t authgss_get_private_data	__P((AUTH *auth,
+-	    			     struct authgss_private_data *));
+-bool_t authgss_free_private_data __P((struct authgss_private_data *));
+-
+-void	gss_log_debug		__P((const char *fmt, ...));
+-void	gss_log_status		__P((char *m, OM_uint32 major,
+-				     OM_uint32 minor));
+-void	gss_log_hexdump		__P((const u_char *buf, int len, int offset));
+-
+-__END_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
++bool_t	xdr_rpc_gss_cred	(XDR *xdrs, struct rpc_gss_cred *p);
++bool_t	xdr_rpc_gss_init_args	(XDR *xdrs, gss_buffer_desc *p);
++bool_t	xdr_rpc_gss_init_res	(XDR *xdrs, struct rpc_gss_init_res *p);
++bool_t	xdr_rpc_gss_data	(XDR *xdrs, xdrproc_t xdr_func,
++				 caddr_t xdr_ptr, gss_ctx_id_t ctx,
++				 gss_qop_t qop, rpc_gss_svc_t svc,
++				 u_int seq);
++
++AUTH   *authgss_create		(CLIENT *, gss_name_t, struct rpc_gss_sec *);
++AUTH   *authgss_create_default	(CLIENT *, char *, struct rpc_gss_sec *);
++bool_t authgss_service		(AUTH *auth, int svc);
++bool_t authgss_get_private_data	(AUTH *auth, struct authgss_private_data *);
++bool_t authgss_free_private_data (struct authgss_private_data *);
++
++void	gss_log_debug		(const char *fmt, ...);
++void	gss_log_status		(char *m, OM_uint32 major, OM_uint32 minor);
++void	gss_log_hexdump		(const u_char *buf, int len, int offset);
++
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* !_TIRPC_AUTH_GSS_H */
+diff --git a/tirpc/rpc/auth_unix.h b/tirpc/rpc/auth_unix.h
+index 602889b..b10e71d 100644
+--- a/tirpc/rpc/auth_unix.h
++++ b/tirpc/rpc/auth_unix.h
+@@ -45,7 +45,6 @@
+ 
+ #ifndef _TIRPC_AUTH_UNIX_H
+ #define _TIRPC_AUTH_UNIX_H
+-#include <sys/cdefs.h>
+ 
+ /* The machine name is part of a credential; it may not exceed 255 bytes */
+ #define MAX_MACHINE_NAME 255
+@@ -67,9 +66,13 @@ struct authunix_parms {
+ 
+ #define authsys_parms authunix_parms
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * If a response verifier has flavor AUTH_SHORT,
+diff --git a/tirpc/rpc/clnt.h b/tirpc/rpc/clnt.h
+index 9ee619e..05f2215 100644
+--- a/tirpc/rpc/clnt.h
++++ b/tirpc/rpc/clnt.h
+@@ -42,7 +42,6 @@
+ #include <rpc/clnt_stat.h>
+ #include <rpc/auth.h>
+ 
+-#include <sys/cdefs.h>
+ #include <netconfig.h>
+ #include <sys/un.h>
+ 
+@@ -267,7 +266,9 @@ struct rpc_timers {
+  * Generic client creation routine. Supported protocols are those that
+  * belong to the nettype namespace (/etc/netconfig).
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
+ 			   const char *);
+ /*
+@@ -414,32 +415,46 @@ extern CLIENT *clnt_dg_create(const int, const struct netbuf *,
+  */
+ extern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ 
+ /*
+  * Print why creation failed
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void clnt_pcreateerror(const char *);			/* stderr */
+ extern char *clnt_spcreateerror(const char *);			/* string */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Like clnt_perror(), but is more verbose in its output
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void clnt_perrno(enum clnt_stat);		/* stderr */
+ extern char *clnt_sperrno(enum clnt_stat);		/* string */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Print an English error message, given the client error code
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void clnt_perror(CLIENT *, const char *);	 	/* stderr */
+ extern char *clnt_sperror(CLIENT *, const char *);		/* string */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ 
+ /*
+@@ -450,9 +465,13 @@ struct rpc_createerr {
+ 	struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
+ };
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern struct rpc_createerr	*__rpc_createerr(void);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ #define get_rpc_createerr()	(*(__rpc_createerr()))
+ #define rpc_createerr		(*(__rpc_createerr()))
+ 
+@@ -469,12 +488,16 @@ __END_DECLS
+  *	char *out;
+  *	const char *nettype;
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern enum clnt_stat rpc_call(const char *, const rpcprog_t,
+ 			       const rpcvers_t, const rpcproc_t,
+ 			       const xdrproc_t, const char *,
+ 			       const xdrproc_t, char *, const char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * RPC broadcast interface
+@@ -522,7 +545,9 @@ __END_DECLS
+ 
+ typedef bool_t (*resultproc_t)(caddr_t, ...);
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t,
+ 				    const rpcproc_t, const xdrproc_t,
+ 				    caddr_t, const xdrproc_t, caddr_t,
+@@ -532,7 +557,9 @@ extern enum clnt_stat rpc_broadcast_exp(const rpcprog_t, const rpcvers_t,
+ 					caddr_t, const xdrproc_t, caddr_t,
+ 					const resultproc_t, const int,
+ 					const int, const char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /* For backward compatibility */
+ #include <rpc/clnt_soc.h>
+diff --git a/tirpc/rpc/clnt_soc.h b/tirpc/rpc/clnt_soc.h
+index 82330a3..6ec545c 100644
+--- a/tirpc/rpc/clnt_soc.h
++++ b/tirpc/rpc/clnt_soc.h
+@@ -46,7 +46,6 @@
+  * with TS-RPC.
+  */
+ 
+-#include <sys/cdefs.h>
+ 
+ #define UDPMSGSIZE      8800    /* rpc imposed limit on udp msg size */  
+ 
+@@ -61,27 +60,39 @@
+  *	u_int sendsz;
+  *	u_int recvsz;
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern CLIENT *clnttcp_create(struct sockaddr_in *, u_long, u_long, int *,
+ 			      u_int, u_int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Raw (memory) rpc.
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern CLIENT *clntraw_create(u_long, u_long);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ 
+ /*
+ IPv6 socket version 
+ */
+ #ifdef INET6
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern CLIENT *clnttcp6_create(struct sockaddr_in6 *, u_long, u_long, int *,
+ 			      u_int, u_int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ #endif
+ 
+ /*
+@@ -105,7 +116,9 @@ __END_DECLS
+  *	u_int sendsz;
+  *	u_int recvsz;
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern CLIENT *clntudp_create(struct sockaddr_in *, u_long, u_long, 
+ 			      struct timeval, int *);
+ extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, u_long, u_long,
+@@ -116,7 +129,9 @@ extern CLIENT *clntudp6_create(struct sockaddr_in6 *, u_long, u_long,
+ extern CLIENT *clntudp6_bufcreate(struct sockaddr_in6 *, u_long, u_long,
+ 				 struct timeval, int *, u_int, u_int);
+ #endif
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ 
+ #endif /* _RPC_CLNT_SOC_H */
+diff --git a/tirpc/rpc/des_crypt.h b/tirpc/rpc/des_crypt.h
+index 837088c..2358960 100644
+--- a/tirpc/rpc/des_crypt.h
++++ b/tirpc/rpc/des_crypt.h
+@@ -43,7 +43,6 @@
+ #ifndef _DES_DES_CRYPT_H
+ #define _DES_DES_CRYPT_H
+ 
+-#include <sys/cdefs.h>
+ #include <rpc/rpc.h>
+ 
+ #define DES_MAXDATA 8192	/* max bytes encrypted in one call */
+@@ -83,23 +82,35 @@
+ /*
+  * Cipher Block Chaining mode
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ int cbc_crypt( char *, char *, unsigned int, unsigned int, char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Electronic Code Book mode
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ int ecb_crypt( char *, char *, unsigned int, unsigned int );
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /* 
+  * Set des parity for a key.
+  * DES parity is odd and in the low bit of each byte
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ void des_setparity( char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif  /* _DES_DES_CRYPT_H */
+diff --git a/tirpc/rpc/nettype.h b/tirpc/rpc/nettype.h
+index 92063c6..926797a 100644
+--- a/tirpc/rpc/nettype.h
++++ b/tirpc/rpc/nettype.h
+@@ -53,11 +53,15 @@
+ #define	_RPC_TCP	7
+ #define	_RPC_UDP	8
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void *__rpc_setconf(const char *);
+ extern void __rpc_endconf(void *);
+ extern struct netconfig *__rpc_getconf(void *);
+ extern struct netconfig *__rpc_getconfip(const char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif	/* !_TIRPC_NETTYPE_H */
+diff --git a/tirpc/rpc/pmap_clnt.h b/tirpc/rpc/pmap_clnt.h
+index 0d23908..6abd583 100644
+--- a/tirpc/rpc/pmap_clnt.h
++++ b/tirpc/rpc/pmap_clnt.h
+@@ -63,9 +63,10 @@
+ 
+ #ifndef _RPC_PMAP_CLNT_H_
+ #define _RPC_PMAP_CLNT_H_
+-#include <sys/cdefs.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t		pmap_set(u_long, u_long, int, int);
+ extern bool_t		pmap_unset(u_long, u_long);
+ extern struct pmaplist	*pmap_getmaps(struct sockaddr_in *);
+@@ -80,6 +81,8 @@ extern enum clnt_stat	clnt_broadcast(u_long, u_long, u_long,
+ 				       resultproc_t);
+ extern u_short		pmap_getport(struct sockaddr_in *,
+ 				     u_long, u_long, u_int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* !_RPC_PMAP_CLNT_H_ */
+diff --git a/tirpc/rpc/pmap_prot.h b/tirpc/rpc/pmap_prot.h
+index c1a2546..75354ce 100644
+--- a/tirpc/rpc/pmap_prot.h
++++ b/tirpc/rpc/pmap_prot.h
+@@ -71,7 +71,6 @@
+ 
+ #ifndef _RPC_PMAP_PROT_H
+ #define _RPC_PMAP_PROT_H
+-#include <sys/cdefs.h>
+ 
+ #define PMAPPORT		((u_short)111)
+ #define PMAPPROG		((u_long)100000)
+@@ -97,10 +96,14 @@ struct pmaplist {
+ 	struct pmaplist *pml_next;
+ };
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t xdr_pmap(XDR *, struct pmap *);
+ extern bool_t xdr_pmaplist(XDR *, struct pmaplist **);
+ extern bool_t xdr_pmaplist_ptr(XDR *, struct pmaplist *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* !_RPC_PMAP_PROT_H */
+diff --git a/tirpc/rpc/pmap_rmt.h b/tirpc/rpc/pmap_rmt.h
+index dd59a15..2a385e7 100644
+--- a/tirpc/rpc/pmap_rmt.h
++++ b/tirpc/rpc/pmap_rmt.h
+@@ -41,7 +41,6 @@
+ 
+ #ifndef _RPC_PMAP_RMT_H
+ #define _RPC_PMAP_RMT_H
+-#include <sys/cdefs.h>
+ 
+ struct rmtcallargs {
+ 	u_long prog, vers, proc, arglen;
+@@ -56,9 +55,13 @@ struct rmtcallres {
+ 	xdrproc_t xdr_results;
+ };
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t xdr_rmtcall_args(XDR *, struct rmtcallargs *);
+ extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* !_RPC_PMAP_RMT_H */
+diff --git a/tirpc/rpc/rpc.h b/tirpc/rpc/rpc.h
+index 6c0222e..fac2fa9 100644
+--- a/tirpc/rpc/rpc.h
++++ b/tirpc/rpc/rpc.h
+@@ -79,9 +79,11 @@
+ #define UDPMSGSIZE 8800
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int get_myaddress(struct sockaddr_in *);
+-extern int bindresvport(int, struct sockaddr_in *) __THROW;
++extern int bindresvport(int, struct sockaddr_in *);
+ extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
+     xdrproc_t, xdrproc_t);
+ extern int callrpc(const char *, int, int, int, xdrproc_t, void *,
+@@ -93,18 +95,24 @@ struct netbuf *uaddr2taddr(const struct netconfig *, const char *);
+ 
+ struct sockaddr;
+ extern int bindresvport_sa(int, struct sockaddr *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * The following are not exported interfaces, they are for internal library
+  * and rpcbind use only. Do not use, they may change without notice.
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ int __rpc_nconf2fd(const struct netconfig *);
+ int __rpc_nconf2fd_flags(const struct netconfig *, int);
+ int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);
+ int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *);
+ u_int __rpc_get_t_size(int, int, int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* !_RPC_RPC_H */
+diff --git a/tirpc/rpc/rpc_com.h b/tirpc/rpc/rpc_com.h
+index cb3bbbb..236fcee 100644
+--- a/tirpc/rpc/rpc_com.h
++++ b/tirpc/rpc/rpc_com.h
+@@ -41,7 +41,6 @@
+ #ifndef _RPC_RPCCOM_H
+ #define	_RPC_RPCCOM_H
+ 
+-#include <sys/cdefs.h>
+ 
+ /* #pragma ident	"@(#)rpc_com.h	1.11	93/07/05 SMI" */
+ 
+@@ -55,7 +54,9 @@
+ #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
+     (u_int32_t)(now)->tv_usec)
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern u_int __rpc_get_a_size(int);
+ extern int __rpc_dtbsize(void);
+ extern int _rpc_dtablesize(void);
+@@ -77,6 +78,8 @@ bool_t rpc_control(int,void *);
+ 
+ char *_get_next_token(char *, int);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _RPC_RPCCOM_H */
+diff --git a/tirpc/rpc/rpc_msg.h b/tirpc/rpc/rpc_msg.h
+index 16d8eef..f7aabd8 100644
+--- a/tirpc/rpc/rpc_msg.h
++++ b/tirpc/rpc/rpc_msg.h
+@@ -161,7 +161,9 @@ struct rpc_msg {
+ #define	acpted_rply	ru.RM_rmb.ru.RP_ar
+ #define	rjcted_rply	ru.RM_rmb.ru.RP_dr
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ /*
+  * XDR routine to handle a rpc message.
+  * xdr_callmsg(xdrs, cmsg)
+@@ -210,6 +212,8 @@ extern bool_t	xdr_rejected_reply(XDR *, struct rejected_reply *);
+  * 	struct rpc_err *error;
+  */
+ extern void	_seterr_reply(struct rpc_msg *, struct rpc_err *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* !_TIRPC_RPC_MSG_H */
+diff --git a/tirpc/rpc/rpcb_clnt.h b/tirpc/rpc/rpcb_clnt.h
+index 7e64f8f..86d81f6 100644
+--- a/tirpc/rpc/rpcb_clnt.h
++++ b/tirpc/rpc/rpcb_clnt.h
+@@ -59,7 +59,9 @@
+ 
+ #include <rpc/types.h>
+ #include <rpc/rpcb_prot.h>
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t,
+ 		       const struct netconfig  *, const struct netbuf *);
+ extern bool_t rpcb_unset(const rpcprog_t, const rpcvers_t,
+@@ -78,6 +80,8 @@ extern bool_t rpcb_getaddr(const rpcprog_t, const rpcvers_t,
+ extern bool_t rpcb_gettime(const char *, time_t *);
+ extern char *rpcb_taddr2uaddr(struct netconfig *, struct netbuf *);
+ extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif	/* !_RPC_RPCB_CLNT_H */
+diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
+index c865e51..6619cd3 100644
+--- a/tirpc/rpc/rpcent.h
++++ b/tirpc/rpc/rpcent.h
+@@ -44,7 +44,9 @@
+ /*	#pragma ident "@(#)rpcent.h   1.13    94/04/25 SMI"	*/
+ /*      @(#)rpcent.h 1.1 88/12/06 SMI   */
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /* These are defined in /usr/include/rpc/netdb.h */
+ #if 0
+@@ -60,8 +62,10 @@ extern struct rpcent *getrpcbynumber(int);
+ extern struct rpcent *getrpcent(void);
+ #endif
+ 
+-extern void setrpcent(int) __THROW;
+-extern void endrpcent(void) __THROW;
+-__END_DECLS
++extern void setrpcent(int);
++extern void endrpcent(void);
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* !_RPC_CENT_H */
+diff --git a/tirpc/rpc/svc.h b/tirpc/rpc/svc.h
+index b9691a8..8273c95 100644
+--- a/tirpc/rpc/svc.h
++++ b/tirpc/rpc/svc.h
+@@ -40,7 +40,6 @@
+ 
+ #ifndef _TIRPC_SVC_H
+ #define _TIRPC_SVC_H
+-#include <sys/cdefs.h>
+ 
+ /*
+  * This interface must manage two items concerning remote procedure calling:
+@@ -200,11 +199,15 @@ struct svc_req {
+  *	const struct netconfig *nconf;
+  */
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t	svc_reg(SVCXPRT *, const rpcprog_t, const rpcvers_t,
+ 			void (*)(struct svc_req *, SVCXPRT *),
+ 			const struct netconfig *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Service un-registration
+@@ -214,9 +217,13 @@ __END_DECLS
+  *	const rpcvers_t vers;
+  */
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void	svc_unreg(const rpcprog_t, const rpcvers_t);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Transport registration.
+@@ -224,9 +231,13 @@ __END_DECLS
+  * xprt_register(xprt)
+  *	SVCXPRT *xprt;
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void	xprt_register(SVCXPRT *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Transport un-register
+@@ -234,9 +245,13 @@ __END_DECLS
+  * xprt_unregister(xprt)
+  *	SVCXPRT *xprt;
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void	xprt_unregister(SVCXPRT *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ 
+ /*
+@@ -265,7 +280,9 @@ __END_DECLS
+  * deadlock the caller and server processes!
+  */
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t	svc_sendreply(SVCXPRT *, xdrproc_t, void *);
+ extern void	svcerr_decode(SVCXPRT *);
+ extern void	svcerr_weakauth(SVCXPRT *);
+@@ -277,7 +294,9 @@ extern void	svcerr_systemerr(SVCXPRT *);
+ extern int	rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t,
+ 			char *(*)(char *), xdrproc_t, xdrproc_t,
+ 			char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Lowest level dispatching -OR- who owns this process anyway.
+@@ -306,11 +325,17 @@ extern int svc_fds;
+  * a small program implemented by the svc_rpc implementation itself;
+  * also see clnt.h for protocol numbers.
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void rpctest_service(void);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void	svc_getreq(int);
+ extern void	svc_getreqset(fd_set *);
+ extern void	svc_getreq_common(int);
+@@ -319,7 +344,9 @@ extern void	svc_getreq_poll(struct pollfd *, int);
+ 
+ extern void	svc_run(void);
+ extern void	svc_exit(void);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Socket to use on svcxxx_create call to get default socket
+@@ -331,7 +358,9 @@ __END_DECLS
+  * These are the existing service side transport implementations
+  */
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ /*
+  * Transport independent svc_create routine.
+  */
+@@ -427,7 +456,9 @@ int svc_dg_enablecache(SVCXPRT *, const u_int);
+ 
+ int __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ 
+ /* for backward compatibility */
+diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h
+index 723c989..67608d0 100644
+--- a/tirpc/rpc/svc_auth.h
++++ b/tirpc/rpc/svc_auth.h
+@@ -65,13 +65,17 @@ typedef struct SVCAUTH {
+ /*
+  * Server side authenticator
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern enum auth_stat _gss_authenticate(struct svc_req *, struct rpc_msg *,
+ 		bool_t *);
+ extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *);
+ extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *,
+ 			  struct rpc_msg *));
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* !_RPC_SVC_AUTH_H */
+diff --git a/tirpc/rpc/svc_soc.h b/tirpc/rpc/svc_soc.h
+index 6148d7b..9b7befa 100644
+--- a/tirpc/rpc/svc_soc.h
++++ b/tirpc/rpc/svc_soc.h
+@@ -38,7 +38,6 @@
+ 
+ #ifndef _RPC_SVC_SOC_H
+ #define _RPC_SVC_SOC_H
+-#include <sys/cdefs.h>
+ 
+ /* #pragma ident   "@(#)svc_soc.h  1.11    94/04/25 SMI" */
+ /*      svc_soc.h 1.8 89/05/01 SMI      */
+@@ -64,10 +63,14 @@
+  *	void (*dispatch)();
+  *	int protocol;    like TCP or UDP, zero means do not register 
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t	svc_register(SVCXPRT *, u_long, u_long,
+ 		    void (*)(struct svc_req *, SVCXPRT *), int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Service un-registration
+@@ -76,44 +79,64 @@ __END_DECLS
+  *	u_long prog;
+  *	u_long vers;
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void	svc_unregister(u_long, u_long);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ 
+ /*
+  * Memory based rpc for testing and timing.
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern SVCXPRT *svcraw_create(void);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ 
+ /*
+  * Udp based rpc.
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern SVCXPRT *svcudp_create(int);
+ extern SVCXPRT *svcudp_bufcreate(int, u_int, u_int);
+ extern int svcudp_enablecache(SVCXPRT *, u_long);
+ extern SVCXPRT *svcudp6_create(int);
+ extern SVCXPRT *svcudp6_bufcreate(int, u_int, u_int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ 
+ /*
+  * Tcp based rpc.
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern SVCXPRT *svctcp_create(int, u_int, u_int);
+ extern SVCXPRT *svctcp6_create(int, u_int, u_int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Fd based rpc.
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern SVCXPRT *svcfd_create(int, u_int, u_int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* !_RPC_SVC_SOC_H */
+diff --git a/tirpc/rpc/xdr.h b/tirpc/rpc/xdr.h
+index 613fab0..917c067 100644
+--- a/tirpc/rpc/xdr.h
++++ b/tirpc/rpc/xdr.h
+@@ -40,7 +40,6 @@
+ 
+ #ifndef _TIRPC_XDR_H
+ #define _TIRPC_XDR_H
+-#include <sys/cdefs.h>
+ #include <stdio.h>
+ #include <netinet/in.h>
+ 
+@@ -287,7 +286,9 @@ struct xdr_discrim {
+ /*
+  * These are the "generic" xdr routines.
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t	xdr_void(void);
+ extern bool_t	xdr_int(XDR *, int *);
+ extern bool_t	xdr_u_int(XDR *, u_int *);
+@@ -330,7 +331,9 @@ extern bool_t	xdr_hyper(XDR *, quad_t *);
+ extern bool_t	xdr_u_hyper(XDR *, u_quad_t *);
+ extern bool_t	xdr_longlong_t(XDR *, quad_t *);
+ extern bool_t	xdr_u_longlong_t(XDR *, u_quad_t *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ /*
+  * Common opaque bytes objects used by many rpc protocols;
+@@ -348,7 +351,9 @@ extern bool_t   xdr_netobj(XDR *, struct netobj *);
+  * These are the public routines for the various implementations of
+  * xdr streams.
+  */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ /* XDR using memory buffers */
+ extern void   xdrmem_create(XDR *, char *, u_int, enum xdr_op);
+ 
+@@ -369,6 +374,8 @@ extern bool_t xdrrec_skiprecord(XDR *);
+ /* true if no more input */
+ extern bool_t xdrrec_eof(XDR *);
+ extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* !_TIRPC_XDR_H */
+-- 
+2.2.0
+
diff --git a/meta/recipes-extended/libtirpc/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch b/meta/recipes-extended/libtirpc/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch
new file mode 100644
index 0000000..4957ac8
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch
@@ -0,0 +1,99 @@
+From 5aff70a8fc06163c4ed5fcc45df4a734447000bd Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 15 Dec 2014 11:40:20 +0100
+Subject: [PATCH 4/9] Add configure option to disable DES authentication
+
+DES is not good for encryption anymore and some C libraries does not
+even implement it. We add a --disable-authdes to optionally disable
+it, but let it be enabled by default for compatibility.
+
+This is needed for musl libc.
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+Upstream-Status: Pending
+
+ configure.ac    |  6 ++++++
+ src/Makefile.am | 12 ++++++++++--
+ src/rpc_soc.c   |  2 ++
+ 3 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0180801..e6d3df5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -15,6 +15,12 @@ if test x$enable_gssapi = xyes; then
+ 	AC_SUBST([GSSAPI_CFLAGS])
+ 	AC_SUBST([GSSAPI_LIBS])
+ fi
++
++AC_ARG_ENABLE(authdes,
++	[AC_HELP_STRING([--disable-authdes], [Disable DES authentication @<:@default=no@:>@])],
++      [],[enable_authdes=yes])
++AM_CONDITIONAL(AUTHDES, test x$enable_authdes = xyes)
++
+ AC_ARG_ENABLE(ipv6,
+ 	[AC_HELP_STRING([--disable-ipv6], [Disable IPv6 support @<:@default=no@:>@])],
+ 	[],[enable_ipv6=yes])
+diff --git a/src/Makefile.am b/src/Makefile.am
+index de57c8f..26ccbdf 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -42,6 +42,7 @@ lib_LTLIBRARIES = libtirpc.la
+ # misunderstanding of the purpose of library versions."
+ #
+ libtirpc_la_LDFLAGS = -lpthread -version-info 1:10:0
++libtirpc_la_CFLAGS =
+ 
+ libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c clnt_bcast.c \
+         clnt_dg.c clnt_generic.c clnt_perror.c clnt_raw.c clnt_simple.c \
+@@ -51,7 +52,7 @@ libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c cln
+         rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
+         rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
+         svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
+-        auth_time.c auth_des.c authdes_prot.c debug.c
++        auth_time.c debug.c
+ 
+ ## XDR
+ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c
+@@ -60,9 +61,16 @@ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_ref
+ if GSS
+     libtirpc_la_SOURCES += auth_gss.c authgss_prot.c svc_auth_gss.c
+     libtirpc_la_LDFLAGS += $(GSSAPI_LIBS)
+-    libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
++    libtirpc_la_CFLAGS += -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
+ endif
+ 
++## DES authentication
++if AUTHDES
++    libtirpc_la_SOURCES += auth_des.c authdes_prot.c
++    libtirpc_la_CFLAGS += -DHAVE_AUTHDES
++endif
++
++
+ ## libtirpc_a_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
+ ## libtirpc_a_SOURCES += netname.c netnamer.c rpcdname.c \
+ ## libtirpc_a_SOURCES += rtime.c \
+diff --git a/src/rpc_soc.c b/src/rpc_soc.c
+index 338edbb..b12b116 100644
+--- a/src/rpc_soc.c
++++ b/src/rpc_soc.c
+@@ -520,6 +520,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
+ 	    (resultproc_t) rpc_wrap_bcast, "udp");
+ }
+ 
++#if HAVE_AUTHDES
+ /*
+  * Create the client des authentication object. Obsoleted by
+  * authdes_seccreate().
+@@ -551,6 +552,7 @@ fallback:
+ 	dummy = authdes_seccreate(servername, window, NULL, ckey);
+ 	return (dummy);
+ }
++#endif
+ 
+ /*
+  * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
+-- 
+2.2.0
+
diff --git a/meta/recipes-extended/libtirpc/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch b/meta/recipes-extended/libtirpc/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
new file mode 100644
index 0000000..f76678b
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
@@ -0,0 +1,35 @@
+From 90c2dea527d8fd95065e2a10147d050f978fe8a5 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 24 Apr 2014 08:58:20 +0200
+Subject: [PATCH 5/9] Fix compile error: 'IPPORT_RESERVED' undeclared
+
+The IPPORT_RESERVED is declared in netdb.h. This fixes the following
+compile error with musl libc:
+
+bindresvport.c: In function 'bindresvport_sa':
+bindresvport.c:67:18: error: 'IPPORT_RESERVED' undeclared (first use in
+this function)
+ #define ENDPORT (IPPORT_RESERVED - 1)
+                   ^
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+Upstream-Status: Pending
+
+ src/bindresvport.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/bindresvport.c b/src/bindresvport.c
+index 950fbd1..2d8f2bc 100644
+--- a/src/bindresvport.c
++++ b/src/bindresvport.c
+@@ -36,6 +36,7 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ 
++#include <netdb.h>
+ #include <netinet/in.h>
+ 
+ #include <errno.h>
+-- 
+2.2.0
+
diff --git a/meta/recipes-extended/libtirpc/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch b/meta/recipes-extended/libtirpc/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch
new file mode 100644
index 0000000..21911f5
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch
@@ -0,0 +1,50 @@
+From 182305b99d3a63b6caf72fe5abba3fb88ebea679 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 15 Dec 2014 14:55:37 +0100
+Subject: [PATCH 6/9] Define struct rpcent on non GNU libc
+
+This fixes the following compile error with musl libc:
+getrpcent.c:65:16: error: field 'rpc' has incomplete type
+  struct rpcent rpc;
+                ^
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+Upstream-Status: Pending
+
+This patch could probably be better. It assumes that only GNU libc has
+the rpcent struct defined, but the BSDs probably has it too.
+
+I am not sure if uClibc has it, but uClibc does define __GLIBC__ so it
+might be broken there too.
+
+I looked into using AC_CHECK_MEMBER but I don't think it is a good idea
+so depend on config.h since this is a header that will be installed on
+the system.
+
+I also found out that struct rpcent is also defined in
+/usr/include/gssrpc/netdb.h but I am unsure if we can depend on that
+too since GSS is optional.
+
+So I am a bit in doubt what the proper fix is. Meanwhile, this works
+for musl libc.
+
+ tirpc/rpc/rpcent.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
+index 6619cd3..147f909 100644
+--- a/tirpc/rpc/rpcent.h
++++ b/tirpc/rpc/rpcent.h
+@@ -49,7 +49,7 @@ extern "C" {
+ #endif
+ 
+ /* These are defined in /usr/include/rpc/netdb.h */
+-#if 0
++#if !defined(__GLIBC__)
+ struct rpcent {
+ 	char	*r_name;	/* name of server for this rpc program */
+ 	char	**r_aliases;	/* alias list */
+-- 
+2.2.0
+
diff --git a/meta/recipes-extended/libtirpc/libtirpc/0007-use-bsd-queue.patch b/meta/recipes-extended/libtirpc/libtirpc/0007-use-bsd-queue.patch
new file mode 100644
index 0000000..d717de7
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc/0007-use-bsd-queue.patch
@@ -0,0 +1,561 @@
+Add missing file from musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: libtirpc-0.2.5/src/bsdqueue.h
+===================================================================
+--- /dev/null
++++ libtirpc-0.2.5/src/bsdqueue.h
+@@ -0,0 +1,531 @@
++/*	$OpenBSD: queue.h,v 1.31 2005/11/25 08:06:25 otto Exp $	*/
++/*	$NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $	*/
++
++/*
++ * Copyright (c) 1991, 1993
++ *	The Regents of the University of California.  All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the University nor the names of its contributors
++ *    may be used to endorse or promote products derived from this software
++ *    without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ *	@(#)queue.h	8.5 (Berkeley) 8/20/94
++ */
++
++#ifndef	_SYS_QUEUE_H_
++#define	_SYS_QUEUE_H_
++
++/*
++ * This file defines five types of data structures: singly-linked lists,
++ * lists, simple queues, tail queues, and circular queues.
++ *
++ *
++ * A singly-linked list is headed by a single forward pointer. The elements
++ * are singly linked for minimum space and pointer manipulation overhead at
++ * the expense of O(n) removal for arbitrary elements. New elements can be
++ * added to the list after an existing element or at the head of the list.
++ * Elements being removed from the head of the list should use the explicit
++ * macro for this purpose for optimum efficiency. A singly-linked list may
++ * only be traversed in the forward direction.  Singly-linked lists are ideal
++ * for applications with large datasets and few or no removals or for
++ * implementing a LIFO queue.
++ *
++ * A list is headed by a single forward pointer (or an array of forward
++ * pointers for a hash table header). The elements are doubly linked
++ * so that an arbitrary element can be removed without a need to
++ * traverse the list. New elements can be added to the list before
++ * or after an existing element or at the head of the list. A list
++ * may only be traversed in the forward direction.
++ *
++ * A simple queue is headed by a pair of pointers, one the head of the
++ * list and the other to the tail of the list. The elements are singly
++ * linked to save space, so elements can only be removed from the
++ * head of the list. New elements can be added to the list before or after
++ * an existing element, at the head of the list, or at the end of the
++ * list. A simple queue may only be traversed in the forward direction.
++ *
++ * A tail queue is headed by a pair of pointers, one to the head of the
++ * list and the other to the tail of the list. The elements are doubly
++ * linked so that an arbitrary element can be removed without a need to
++ * traverse the list. New elements can be added to the list before or
++ * after an existing element, at the head of the list, or at the end of
++ * the list. A tail queue may be traversed in either direction.
++ *
++ * A circle queue is headed by a pair of pointers, one to the head of the
++ * list and the other to the tail of the list. The elements are doubly
++ * linked so that an arbitrary element can be removed without a need to
++ * traverse the list. New elements can be added to the list before or after
++ * an existing element, at the head of the list, or at the end of the list.
++ * A circle queue may be traversed in either direction, but has a more
++ * complex end of list detection.
++ *
++ * For details on the use of these macros, see the queue(3) manual page.
++ */
++
++#ifdef QUEUE_MACRO_DEBUG
++#define _Q_INVALIDATE(a) (a) = ((void *)-1)
++#else
++#define _Q_INVALIDATE(a)
++#endif
++
++/*
++ * Singly-linked List definitions.
++ */
++#define SLIST_HEAD(name, type)						\
++struct name {								\
++	struct type *slh_first;	/* first element */			\
++}
++
++#define	SLIST_HEAD_INITIALIZER(head)					\
++	{ NULL }
++
++#ifdef SLIST_ENTRY
++#undef SLIST_ENTRY
++#endif
++
++#define SLIST_ENTRY(type)						\
++struct {								\
++	struct type *sle_next;	/* next element */			\
++}
++
++/*
++ * Singly-linked List access methods.
++ */
++#define	SLIST_FIRST(head)	((head)->slh_first)
++#define	SLIST_END(head)		NULL
++#define	SLIST_EMPTY(head)	(SLIST_FIRST(head) == SLIST_END(head))
++#define	SLIST_NEXT(elm, field)	((elm)->field.sle_next)
++
++#define	SLIST_FOREACH(var, head, field)					\
++	for((var) = SLIST_FIRST(head);					\
++	    (var) != SLIST_END(head);					\
++	    (var) = SLIST_NEXT(var, field))
++
++#define	SLIST_FOREACH_PREVPTR(var, varp, head, field)			\
++	for ((varp) = &SLIST_FIRST((head));				\
++	    ((var) = *(varp)) != SLIST_END(head);			\
++	    (varp) = &SLIST_NEXT((var), field))
++
++/*
++ * Singly-linked List functions.
++ */
++#define	SLIST_INIT(head) {						\
++	SLIST_FIRST(head) = SLIST_END(head);				\
++}
++
++#define	SLIST_INSERT_AFTER(slistelm, elm, field) do {			\
++	(elm)->field.sle_next = (slistelm)->field.sle_next;		\
++	(slistelm)->field.sle_next = (elm);				\
++} while (0)
++
++#define	SLIST_INSERT_HEAD(head, elm, field) do {			\
++	(elm)->field.sle_next = (head)->slh_first;			\
++	(head)->slh_first = (elm);					\
++} while (0)
++
++#define	SLIST_REMOVE_NEXT(head, elm, field) do {			\
++	(elm)->field.sle_next = (elm)->field.sle_next->field.sle_next;	\
++} while (0)
++
++#define	SLIST_REMOVE_HEAD(head, field) do {				\
++	(head)->slh_first = (head)->slh_first->field.sle_next;		\
++} while (0)
++
++#define SLIST_REMOVE(head, elm, type, field) do {			\
++	if ((head)->slh_first == (elm)) {				\
++		SLIST_REMOVE_HEAD((head), field);			\
++	} else {							\
++		struct type *curelm = (head)->slh_first;		\
++									\
++		while (curelm->field.sle_next != (elm))			\
++			curelm = curelm->field.sle_next;		\
++		curelm->field.sle_next =				\
++		    curelm->field.sle_next->field.sle_next;		\
++		_Q_INVALIDATE((elm)->field.sle_next);			\
++	}								\
++} while (0)
++
++/*
++ * List definitions.
++ */
++#define LIST_HEAD(name, type)						\
++struct name {								\
++	struct type *lh_first;	/* first element */			\
++}
++
++#define LIST_HEAD_INITIALIZER(head)					\
++	{ NULL }
++
++#define LIST_ENTRY(type)						\
++struct {								\
++	struct type *le_next;	/* next element */			\
++	struct type **le_prev;	/* address of previous next element */	\
++}
++
++/*
++ * List access methods
++ */
++#define	LIST_FIRST(head)		((head)->lh_first)
++#define	LIST_END(head)			NULL
++#define	LIST_EMPTY(head)		(LIST_FIRST(head) == LIST_END(head))
++#define	LIST_NEXT(elm, field)		((elm)->field.le_next)
++
++#define LIST_FOREACH(var, head, field)					\
++	for((var) = LIST_FIRST(head);					\
++	    (var)!= LIST_END(head);					\
++	    (var) = LIST_NEXT(var, field))
++
++/*
++ * List functions.
++ */
++#define	LIST_INIT(head) do {						\
++	LIST_FIRST(head) = LIST_END(head);				\
++} while (0)
++
++#define LIST_INSERT_AFTER(listelm, elm, field) do {			\
++	if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)	\
++		(listelm)->field.le_next->field.le_prev =		\
++		    &(elm)->field.le_next;				\
++	(listelm)->field.le_next = (elm);				\
++	(elm)->field.le_prev = &(listelm)->field.le_next;		\
++} while (0)
++
++#define	LIST_INSERT_BEFORE(listelm, elm, field) do {			\
++	(elm)->field.le_prev = (listelm)->field.le_prev;		\
++	(elm)->field.le_next = (listelm);				\
++	*(listelm)->field.le_prev = (elm);				\
++	(listelm)->field.le_prev = &(elm)->field.le_next;		\
++} while (0)
++
++#define LIST_INSERT_HEAD(head, elm, field) do {				\
++	if (((elm)->field.le_next = (head)->lh_first) != NULL)		\
++		(head)->lh_first->field.le_prev = &(elm)->field.le_next;\
++	(head)->lh_first = (elm);					\
++	(elm)->field.le_prev = &(head)->lh_first;			\
++} while (0)
++
++#define LIST_REMOVE(elm, field) do {					\
++	if ((elm)->field.le_next != NULL)				\
++		(elm)->field.le_next->field.le_prev =			\
++		    (elm)->field.le_prev;				\
++	*(elm)->field.le_prev = (elm)->field.le_next;			\
++	_Q_INVALIDATE((elm)->field.le_prev);				\
++	_Q_INVALIDATE((elm)->field.le_next);				\
++} while (0)
++
++#define LIST_REPLACE(elm, elm2, field) do {				\
++	if (((elm2)->field.le_next = (elm)->field.le_next) != NULL)	\
++		(elm2)->field.le_next->field.le_prev =			\
++		    &(elm2)->field.le_next;				\
++	(elm2)->field.le_prev = (elm)->field.le_prev;			\
++	*(elm2)->field.le_prev = (elm2);				\
++	_Q_INVALIDATE((elm)->field.le_prev);				\
++	_Q_INVALIDATE((elm)->field.le_next);				\
++} while (0)
++
++/*
++ * Simple queue definitions.
++ */
++#define SIMPLEQ_HEAD(name, type)					\
++struct name {								\
++	struct type *sqh_first;	/* first element */			\
++	struct type **sqh_last;	/* addr of last next element */		\
++}
++
++#define SIMPLEQ_HEAD_INITIALIZER(head)					\
++	{ NULL, &(head).sqh_first }
++
++#define SIMPLEQ_ENTRY(type)						\
++struct {								\
++	struct type *sqe_next;	/* next element */			\
++}
++
++/*
++ * Simple queue access methods.
++ */
++#define	SIMPLEQ_FIRST(head)	    ((head)->sqh_first)
++#define	SIMPLEQ_END(head)	    NULL
++#define	SIMPLEQ_EMPTY(head)	    (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head))
++#define	SIMPLEQ_NEXT(elm, field)    ((elm)->field.sqe_next)
++
++#define SIMPLEQ_FOREACH(var, head, field)				\
++	for((var) = SIMPLEQ_FIRST(head);				\
++	    (var) != SIMPLEQ_END(head);					\
++	    (var) = SIMPLEQ_NEXT(var, field))
++
++/*
++ * Simple queue functions.
++ */
++#define	SIMPLEQ_INIT(head) do {						\
++	(head)->sqh_first = NULL;					\
++	(head)->sqh_last = &(head)->sqh_first;				\
++} while (0)
++
++#define SIMPLEQ_INSERT_HEAD(head, elm, field) do {			\
++	if (((elm)->field.sqe_next = (head)->sqh_first) == NULL)	\
++		(head)->sqh_last = &(elm)->field.sqe_next;		\
++	(head)->sqh_first = (elm);					\
++} while (0)
++
++#define SIMPLEQ_INSERT_TAIL(head, elm, field) do {			\
++	(elm)->field.sqe_next = NULL;					\
++	*(head)->sqh_last = (elm);					\
++	(head)->sqh_last = &(elm)->field.sqe_next;			\
++} while (0)
++
++#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do {		\
++	if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
++		(head)->sqh_last = &(elm)->field.sqe_next;		\
++	(listelm)->field.sqe_next = (elm);				\
++} while (0)
++
++#define SIMPLEQ_REMOVE_HEAD(head, field) do {			\
++	if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
++		(head)->sqh_last = &(head)->sqh_first;			\
++} while (0)
++
++/*
++ * Tail queue definitions.
++ */
++#define TAILQ_HEAD(name, type)						\
++struct name {								\
++	struct type *tqh_first;	/* first element */			\
++	struct type **tqh_last;	/* addr of last next element */		\
++}
++
++#define TAILQ_HEAD_INITIALIZER(head)					\
++	{ NULL, &(head).tqh_first }
++
++#define TAILQ_ENTRY(type)						\
++struct {								\
++	struct type *tqe_next;	/* next element */			\
++	struct type **tqe_prev;	/* address of previous next element */	\
++}
++
++/*
++ * tail queue access methods
++ */
++#define	TAILQ_FIRST(head)		((head)->tqh_first)
++#define	TAILQ_END(head)			NULL
++#define	TAILQ_NEXT(elm, field)		((elm)->field.tqe_next)
++#define TAILQ_LAST(head, headname)					\
++	(*(((struct headname *)((head)->tqh_last))->tqh_last))
++/* XXX */
++#define TAILQ_PREV(elm, headname, field)				\
++	(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
++#define	TAILQ_EMPTY(head)						\
++	(TAILQ_FIRST(head) == TAILQ_END(head))
++
++#define TAILQ_FOREACH(var, head, field)					\
++	for((var) = TAILQ_FIRST(head);					\
++	    (var) != TAILQ_END(head);					\
++	    (var) = TAILQ_NEXT(var, field))
++
++#define TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
++	for((var) = TAILQ_LAST(head, headname);				\
++	    (var) != TAILQ_END(head);					\
++	    (var) = TAILQ_PREV(var, headname, field))
++
++/*
++ * Tail queue functions.
++ */
++#define	TAILQ_INIT(head) do {						\
++	(head)->tqh_first = NULL;					\
++	(head)->tqh_last = &(head)->tqh_first;				\
++} while (0)
++
++#define TAILQ_INSERT_HEAD(head, elm, field) do {			\
++	if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)	\
++		(head)->tqh_first->field.tqe_prev =			\
++		    &(elm)->field.tqe_next;				\
++	else								\
++		(head)->tqh_last = &(elm)->field.tqe_next;		\
++	(head)->tqh_first = (elm);					\
++	(elm)->field.tqe_prev = &(head)->tqh_first;			\
++} while (0)
++
++#define TAILQ_INSERT_TAIL(head, elm, field) do {			\
++	(elm)->field.tqe_next = NULL;					\
++	(elm)->field.tqe_prev = (head)->tqh_last;			\
++	*(head)->tqh_last = (elm);					\
++	(head)->tqh_last = &(elm)->field.tqe_next;			\
++} while (0)
++
++#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
++	if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
++		(elm)->field.tqe_next->field.tqe_prev =			\
++		    &(elm)->field.tqe_next;				\
++	else								\
++		(head)->tqh_last = &(elm)->field.tqe_next;		\
++	(listelm)->field.tqe_next = (elm);				\
++	(elm)->field.tqe_prev = &(listelm)->field.tqe_next;		\
++} while (0)
++
++#define	TAILQ_INSERT_BEFORE(listelm, elm, field) do {			\
++	(elm)->field.tqe_prev = (listelm)->field.tqe_prev;		\
++	(elm)->field.tqe_next = (listelm);				\
++	*(listelm)->field.tqe_prev = (elm);				\
++	(listelm)->field.tqe_prev = &(elm)->field.tqe_next;		\
++} while (0)
++
++#define TAILQ_REMOVE(head, elm, field) do {				\
++	if (((elm)->field.tqe_next) != NULL)				\
++		(elm)->field.tqe_next->field.tqe_prev =			\
++		    (elm)->field.tqe_prev;				\
++	else								\
++		(head)->tqh_last = (elm)->field.tqe_prev;		\
++	*(elm)->field.tqe_prev = (elm)->field.tqe_next;			\
++	_Q_INVALIDATE((elm)->field.tqe_prev);				\
++	_Q_INVALIDATE((elm)->field.tqe_next);				\
++} while (0)
++
++#define TAILQ_REPLACE(head, elm, elm2, field) do {			\
++	if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL)	\
++		(elm2)->field.tqe_next->field.tqe_prev =		\
++		    &(elm2)->field.tqe_next;				\
++	else								\
++		(head)->tqh_last = &(elm2)->field.tqe_next;		\
++	(elm2)->field.tqe_prev = (elm)->field.tqe_prev;			\
++	*(elm2)->field.tqe_prev = (elm2);				\
++	_Q_INVALIDATE((elm)->field.tqe_prev);				\
++	_Q_INVALIDATE((elm)->field.tqe_next);				\
++} while (0)
++
++/*
++ * Circular queue definitions.
++ */
++#define CIRCLEQ_HEAD(name, type)					\
++struct name {								\
++	struct type *cqh_first;		/* first element */		\
++	struct type *cqh_last;		/* last element */		\
++}
++
++#define CIRCLEQ_HEAD_INITIALIZER(head)					\
++	{ CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
++
++#define CIRCLEQ_ENTRY(type)						\
++struct {								\
++	struct type *cqe_next;		/* next element */		\
++	struct type *cqe_prev;		/* previous element */		\
++}
++
++/*
++ * Circular queue access methods
++ */
++#define	CIRCLEQ_FIRST(head)		((head)->cqh_first)
++#define	CIRCLEQ_LAST(head)		((head)->cqh_last)
++#define	CIRCLEQ_END(head)		((void *)(head))
++#define	CIRCLEQ_NEXT(elm, field)	((elm)->field.cqe_next)
++#define	CIRCLEQ_PREV(elm, field)	((elm)->field.cqe_prev)
++#define	CIRCLEQ_EMPTY(head)						\
++	(CIRCLEQ_FIRST(head) == CIRCLEQ_END(head))
++
++#define CIRCLEQ_FOREACH(var, head, field)				\
++	for((var) = CIRCLEQ_FIRST(head);				\
++	    (var) != CIRCLEQ_END(head);					\
++	    (var) = CIRCLEQ_NEXT(var, field))
++
++#define CIRCLEQ_FOREACH_REVERSE(var, head, field)			\
++	for((var) = CIRCLEQ_LAST(head);					\
++	    (var) != CIRCLEQ_END(head);					\
++	    (var) = CIRCLEQ_PREV(var, field))
++
++/*
++ * Circular queue functions.
++ */
++#define	CIRCLEQ_INIT(head) do {						\
++	(head)->cqh_first = CIRCLEQ_END(head);				\
++	(head)->cqh_last = CIRCLEQ_END(head);				\
++} while (0)
++
++#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do {		\
++	(elm)->field.cqe_next = (listelm)->field.cqe_next;		\
++	(elm)->field.cqe_prev = (listelm);				\
++	if ((listelm)->field.cqe_next == CIRCLEQ_END(head))		\
++		(head)->cqh_last = (elm);				\
++	else								\
++		(listelm)->field.cqe_next->field.cqe_prev = (elm);	\
++	(listelm)->field.cqe_next = (elm);				\
++} while (0)
++
++#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do {		\
++	(elm)->field.cqe_next = (listelm);				\
++	(elm)->field.cqe_prev = (listelm)->field.cqe_prev;		\
++	if ((listelm)->field.cqe_prev == CIRCLEQ_END(head))		\
++		(head)->cqh_first = (elm);				\
++	else								\
++		(listelm)->field.cqe_prev->field.cqe_next = (elm);	\
++	(listelm)->field.cqe_prev = (elm);				\
++} while (0)
++
++#define CIRCLEQ_INSERT_HEAD(head, elm, field) do {			\
++	(elm)->field.cqe_next = (head)->cqh_first;			\
++	(elm)->field.cqe_prev = CIRCLEQ_END(head);			\
++	if ((head)->cqh_last == CIRCLEQ_END(head))			\
++		(head)->cqh_last = (elm);				\
++	else								\
++		(head)->cqh_first->field.cqe_prev = (elm);		\
++	(head)->cqh_first = (elm);					\
++} while (0)
++
++#define CIRCLEQ_INSERT_TAIL(head, elm, field) do {			\
++	(elm)->field.cqe_next = CIRCLEQ_END(head);			\
++	(elm)->field.cqe_prev = (head)->cqh_last;			\
++	if ((head)->cqh_first == CIRCLEQ_END(head))			\
++		(head)->cqh_first = (elm);				\
++	else								\
++		(head)->cqh_last->field.cqe_next = (elm);		\
++	(head)->cqh_last = (elm);					\
++} while (0)
++
++#define	CIRCLEQ_REMOVE(head, elm, field) do {				\
++	if ((elm)->field.cqe_next == CIRCLEQ_END(head))			\
++		(head)->cqh_last = (elm)->field.cqe_prev;		\
++	else								\
++		(elm)->field.cqe_next->field.cqe_prev =			\
++		    (elm)->field.cqe_prev;				\
++	if ((elm)->field.cqe_prev == CIRCLEQ_END(head))			\
++		(head)->cqh_first = (elm)->field.cqe_next;		\
++	else								\
++		(elm)->field.cqe_prev->field.cqe_next =			\
++		    (elm)->field.cqe_next;				\
++	_Q_INVALIDATE((elm)->field.cqe_prev);				\
++	_Q_INVALIDATE((elm)->field.cqe_next);				\
++} while (0)
++
++#define CIRCLEQ_REPLACE(head, elm, elm2, field) do {			\
++	if (((elm2)->field.cqe_next = (elm)->field.cqe_next) ==		\
++	    CIRCLEQ_END(head))						\
++		(head).cqh_last = (elm2);				\
++	else								\
++		(elm2)->field.cqe_next->field.cqe_prev = (elm2);	\
++	if (((elm2)->field.cqe_prev = (elm)->field.cqe_prev) ==		\
++	    CIRCLEQ_END(head))						\
++		(head).cqh_first = (elm2);				\
++	else								\
++		(elm2)->field.cqe_prev->field.cqe_next = (elm2);	\
++	_Q_INVALIDATE((elm)->field.cqe_prev);				\
++	_Q_INVALIDATE((elm)->field.cqe_next);				\
++} while (0)
++
++#endif	/* !_SYS_QUEUE_H_ */
+Index: libtirpc-0.2.5/src/clnt_bcast.c
+===================================================================
+--- libtirpc-0.2.5.orig/src/clnt_bcast.c
++++ libtirpc-0.2.5/src/clnt_bcast.c
+@@ -40,7 +40,6 @@
+  */
+ #include <sys/socket.h>
+ #include <sys/types.h>
+-#include <sys/queue.h>
+ 
+ #include <net/if.h>
+ #include <netinet/in.h>
+@@ -64,6 +63,7 @@
+ 
+ #include "rpc_com.h"
+ #include "debug.h"
++#include "bsdqueue.h"
+ 
+ #define	MAXBCAST 20	/* Max no of broadcasting transports */
+ #define	INITTIME 4000	/* Time to wait initially */
diff --git a/meta/recipes-extended/libtirpc/libtirpc/nis.h b/meta/recipes-extended/libtirpc/libtirpc/nis.h
new file mode 100644
index 0000000..8e29596
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc/nis.h
@@ -0,0 +1,545 @@
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part.  Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user or with the express written consent of
+ * Sun Microsystems, Inc.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California  94043
+ */
+
+#ifndef _RPCSVC_NIS_H
+#define _RPCSVC_NIS_H 1
+
+#include <features.h>
+//#include <rpc/rpc.h>
+//#include <rpcsvc/nis_tags.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *	nis.h
+ *
+ *	This file is the main include file for NIS clients. It contains
+ *	both the client library function defines and the various data
+ * 	structures used by the NIS service. It includes the file nis_tags.h
+ *	which defines the tag values. This allows the tags to change without
+ *	having to change the nis.x file.
+ *
+ *	NOTE : THIS FILE IS NOT GENERATED WITH RPCGEN ! SO YOU HAVE TO
+ *             ADD ALL THE CHANGES ON nis_*.x FILES HERE AGAIN !
+ *
+ *      I have removed all the Solaris internal structs and variables,
+ *      because they are not supported, Sun changed them between various
+ *      releases and they shouldn't be used in user programs.
+ *                                              <kukuk@suse.de>
+ */
+
+
+#ifndef __nis_object_h
+#define __nis_object_h
+
+#define NIS_MAXSTRINGLEN 255
+#define NIS_MAXNAMELEN 1024
+#define NIS_MAXATTRNAME 32
+#define NIS_MAXATTRVAL 2048
+#define NIS_MAXCOLUMNS 64
+#define NIS_MAXATTR 16
+#define NIS_MAXPATH 1024
+#define NIS_MAXREPLICAS 128
+#define NIS_MAXLINKS 16
+#define NIS_PK_NONE 0
+#define NIS_PK_DH 1
+#define NIS_PK_RSA 2
+#define NIS_PK_KERB 3
+#define NIS_PK_DHEXT 4
+
+struct nis_attr {
+	char *zattr_ndx;
+	struct {
+		u_int zattr_val_len;
+		char *zattr_val_val;
+	} zattr_val;
+};
+typedef struct nis_attr nis_attr;
+
+typedef char *nis_name;
+
+enum zotypes {
+	BOGUS_OBJ = 0,
+	NO_OBJ = 1,
+	DIRECTORY_OBJ = 2,
+	GROUP_OBJ = 3,
+	TABLE_OBJ = 4,
+	ENTRY_OBJ = 5,
+	LINK_OBJ = 6,
+	PRIVATE_OBJ = 7,
+	NIS_BOGUS_OBJ = 0,
+	NIS_NO_OBJ = 1,
+	NIS_DIRECTORY_OBJ = 2,
+	NIS_GROUP_OBJ = 3,
+	NIS_TABLE_OBJ = 4,
+	NIS_ENTRY_OBJ = 5,
+	NIS_LINK_OBJ = 6,
+	NIS_PRIVATE_OBJ = 7
+};
+typedef enum zotypes zotypes;
+
+enum nstype {
+	UNKNOWN = 0,
+	NIS = 1,
+	SUNYP = 2,
+	IVY = 3,
+	DNS = 4,
+	X500 = 5,
+	DNANS = 6,
+	XCHS = 7,
+	CDS = 8,
+};
+typedef enum nstype nstype;
+
+struct oar_mask {
+        uint32_t oa_rights;
+        zotypes oa_otype;
+};
+typedef struct oar_mask oar_mask;
+
+struct endpoint {
+	char *uaddr;
+	char *family;
+	char *proto;
+};
+typedef struct endpoint endpoint;
+
+struct nis_server {
+	nis_name name;
+	struct {
+		u_int ep_len;
+		endpoint *ep_val;
+	} ep;
+	uint32_t key_type;
+	netobj pkey;
+};
+typedef struct nis_server nis_server;
+
+struct directory_obj {
+	nis_name do_name;
+	nstype do_type;
+	struct {
+		u_int do_servers_len;
+		nis_server *do_servers_val;
+	} do_servers;
+	uint32_t do_ttl;
+	struct {
+		u_int do_armask_len;
+		oar_mask *do_armask_val;
+	} do_armask;
+};
+typedef struct directory_obj directory_obj;
+
+#define EN_BINARY 1
+#define EN_CRYPT 2
+#define EN_XDR 4
+#define EN_MODIFIED 8
+#define EN_ASN1 64
+
+struct entry_col {
+	uint32_t ec_flags;
+	struct {
+		u_int ec_value_len;
+		char *ec_value_val;
+	} ec_value;
+};
+typedef struct entry_col entry_col;
+
+struct entry_obj {
+	char *en_type;
+	struct {
+		u_int en_cols_len;
+		entry_col *en_cols_val;
+	} en_cols;
+};
+typedef struct entry_obj entry_obj;
+
+struct group_obj {
+	uint32_t gr_flags;
+	struct {
+		u_int gr_members_len;
+		nis_name *gr_members_val;
+	} gr_members;
+};
+typedef struct group_obj group_obj;
+
+struct link_obj {
+	zotypes li_rtype;
+	struct {
+		u_int li_attrs_len;
+		nis_attr *li_attrs_val;
+	} li_attrs;
+	nis_name li_name;
+};
+typedef struct link_obj link_obj;
+
+#define TA_BINARY 1
+#define TA_CRYPT 2
+#define TA_XDR 4
+#define TA_SEARCHABLE 8
+#define TA_CASE 16
+#define TA_MODIFIED 32
+#define TA_ASN1 64
+
+struct table_col {
+	char *tc_name;
+	uint32_t tc_flags;
+	uint32_t tc_rights;
+};
+typedef struct table_col table_col;
+
+struct table_obj {
+	char *ta_type;
+	int ta_maxcol;
+	u_char ta_sep;
+	struct {
+		u_int ta_cols_len;
+		table_col *ta_cols_val;
+	} ta_cols;
+	char *ta_path;
+};
+typedef struct table_obj table_obj;
+
+struct objdata {
+	zotypes zo_type;
+	union {
+		struct directory_obj di_data;
+		struct group_obj gr_data;
+		struct table_obj ta_data;
+		struct entry_obj en_data;
+		struct link_obj li_data;
+		struct {
+			u_int po_data_len;
+			char *po_data_val;
+		} po_data;
+	} objdata_u;
+};
+typedef struct objdata objdata;
+
+struct nis_oid {
+	uint32_t ctime;
+	uint32_t mtime;
+};
+typedef struct nis_oid nis_oid;
+
+struct nis_object {
+	nis_oid zo_oid;
+	nis_name zo_name;
+	nis_name zo_owner;
+	nis_name zo_group;
+	nis_name zo_domain;
+	uint32_t zo_access;
+	uint32_t zo_ttl;
+	objdata zo_data;
+};
+typedef struct nis_object nis_object;
+
+#endif /* if __nis_object_h */
+
+enum nis_error {
+	NIS_SUCCESS = 0,
+	NIS_S_SUCCESS = 1,
+	NIS_NOTFOUND = 2,
+	NIS_S_NOTFOUND = 3,
+	NIS_CACHEEXPIRED = 4,
+	NIS_NAMEUNREACHABLE = 5,
+	NIS_UNKNOWNOBJ = 6,
+	NIS_TRYAGAIN = 7,
+	NIS_SYSTEMERROR = 8,
+	NIS_CHAINBROKEN = 9,
+	NIS_PERMISSION = 10,
+	NIS_NOTOWNER = 11,
+	NIS_NOT_ME = 12,
+	NIS_NOMEMORY = 13,
+	NIS_NAMEEXISTS = 14,
+	NIS_NOTMASTER = 15,
+	NIS_INVALIDOBJ = 16,
+	NIS_BADNAME = 17,
+	NIS_NOCALLBACK = 18,
+	NIS_CBRESULTS = 19,
+	NIS_NOSUCHNAME = 20,
+	NIS_NOTUNIQUE = 21,
+	NIS_IBMODERROR = 22,
+	NIS_NOSUCHTABLE = 23,
+	NIS_TYPEMISMATCH = 24,
+	NIS_LINKNAMEERROR = 25,
+	NIS_PARTIAL = 26,
+	NIS_TOOMANYATTRS = 27,
+	NIS_RPCERROR = 28,
+	NIS_BADATTRIBUTE = 29,
+	NIS_NOTSEARCHABLE = 30,
+	NIS_CBERROR = 31,
+	NIS_FOREIGNNS = 32,
+	NIS_BADOBJECT = 33,
+	NIS_NOTSAMEOBJ = 34,
+	NIS_MODFAIL = 35,
+	NIS_BADREQUEST = 36,
+	NIS_NOTEMPTY = 37,
+	NIS_COLDSTART_ERR = 38,
+	NIS_RESYNC = 39,
+	NIS_FAIL = 40,
+	NIS_UNAVAIL = 41,
+	NIS_RES2BIG = 42,
+	NIS_SRVAUTH = 43,
+	NIS_CLNTAUTH = 44,
+	NIS_NOFILESPACE = 45,
+	NIS_NOPROC = 46,
+	NIS_DUMPLATER = 47,
+};
+typedef enum nis_error nis_error;
+
+struct nis_result {
+	nis_error status;
+	struct {
+		u_int objects_len;
+		nis_object *objects_val;
+	} objects;
+	netobj cookie;
+	uint32_t zticks;
+	uint32_t dticks;
+	uint32_t aticks;
+	uint32_t cticks;
+};
+typedef struct nis_result nis_result;
+
+struct ns_request {
+	nis_name ns_name;
+	struct {
+		u_int ns_object_len;
+		nis_object *ns_object_val;
+	} ns_object;
+};
+typedef struct ns_request ns_request;
+
+struct ib_request {
+	nis_name ibr_name;
+	struct {
+		u_int ibr_srch_len;
+		nis_attr *ibr_srch_val;
+	} ibr_srch;
+	uint32_t ibr_flags;
+	struct {
+		u_int ibr_obj_len;
+		nis_object *ibr_obj_val;
+	} ibr_obj;
+	struct {
+		u_int ibr_cbhost_len;
+		nis_server *ibr_cbhost_val;
+	} ibr_cbhost;
+	u_int ibr_bufsize;
+	netobj ibr_cookie;
+};
+typedef struct ib_request ib_request;
+
+struct ping_args {
+	nis_name dir;
+	uint32_t stamp;
+};
+typedef struct ping_args ping_args;
+
+enum log_entry_t {
+	LOG_NOP = 0,
+	ADD_NAME = 1,
+	REM_NAME = 2,
+	MOD_NAME_OLD = 3,
+	MOD_NAME_NEW = 4,
+	ADD_IBASE = 5,
+	REM_IBASE = 6,
+	MOD_IBASE = 7,
+	UPD_STAMP = 8,
+};
+typedef enum log_entry_t log_entry_t;
+
+struct log_entry {
+	uint32_t le_time;
+	log_entry_t le_type;
+	nis_name le_princp;
+	nis_name le_name;
+	struct {
+		u_int le_attrs_len;
+		nis_attr *le_attrs_val;
+	} le_attrs;
+	nis_object le_object;
+};
+typedef struct log_entry log_entry;
+
+struct log_result {
+	nis_error lr_status;
+	netobj lr_cookie;
+	struct {
+		u_int lr_entries_len;
+		log_entry *lr_entries_val;
+	} lr_entries;
+};
+typedef struct log_result log_result;
+
+struct cp_result {
+	nis_error cp_status;
+	uint32_t cp_zticks;
+	uint32_t cp_dticks;
+};
+typedef struct cp_result cp_result;
+
+struct nis_tag {
+	uint32_t tag_type;
+	char *tag_val;
+};
+typedef struct nis_tag nis_tag;
+
+struct nis_taglist {
+	struct {
+		u_int tags_len;
+		nis_tag *tags_val;
+	} tags;
+};
+typedef struct nis_taglist nis_taglist;
+
+struct dump_args {
+	nis_name da_dir;
+	uint32_t da_time;
+	struct {
+		u_int da_cbhost_len;
+		nis_server *da_cbhost_val;
+	} da_cbhost;
+};
+typedef struct dump_args dump_args;
+
+struct fd_args {
+	nis_name dir_name;
+	nis_name requester;
+};
+typedef struct fd_args fd_args;
+
+struct fd_result {
+	nis_error status;
+	nis_name source;
+	struct {
+		u_int dir_data_len;
+		char *dir_data_val;
+	} dir_data;
+	struct {
+		u_int signature_len;
+		char *signature_val;
+	} signature;
+};
+typedef struct fd_result fd_result;
+
+/* Generic client creating flags */
+#define ZMH_VC		1
+#define ZMH_DG		2
+#define ZMH_AUTH	4
+
+/* Testing Access rights for objects */
+
+#define NIS_READ_ACC		1
+#define NIS_MODIFY_ACC		2
+#define NIS_CREATE_ACC		4
+#define NIS_DESTROY_ACC	8
+/* Test macros. a == access rights, m == desired rights. */
+#define NIS_WORLD(a, m)        (((a) & (m)) != 0)
+#define NIS_GROUP(a, m)        (((a) & ((m) << 8)) != 0)
+#define NIS_OWNER(a, m)        (((a) & ((m) << 16)) != 0)
+#define NIS_NOBODY(a, m)       (((a) & ((m) << 24)) != 0)
+/*
+ * EOL Alert - The following non-prefixed test macros are
+ * here for backward compatability, and will be not be present
+ * in future releases - use the NIS_*() macros above.
+ */
+#define WORLD(a, m)	(((a) & (m)) != 0)
+#define GROUP(a, m)	(((a) & ((m) << 8)) != 0)
+#define OWNER(a, m)	(((a) & ((m) << 16)) != 0)
+#define NOBODY(a, m)	(((a) & ((m) << 24)) != 0)
+
+#define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
+#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
+#define WORLD_DEFAULT (NIS_READ_ACC)
+#define GROUP_DEFAULT (NIS_READ_ACC << 8)
+#define OWNER_DEFAULT ((NIS_READ_ACC + NIS_MODIFY_ACC + NIS_CREATE_ACC +\
+			NIS_DESTROY_ACC) << 16)
+#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
+
+/* Result manipulation defines ... */
+#define NIS_RES_NUMOBJ(x)	((x)->objects.objects_len)
+#define NIS_RES_OBJECT(x)	((x)->objects.objects_val)
+#define NIS_RES_COOKIE(x)	((x)->cookie)
+#define NIS_RES_STATUS(x)	((x)->status)
+
+/* These defines make getting at the variant part of the object easier. */
+#define TA_data zo_data.objdata_u.ta_data
+#define EN_data zo_data.objdata_u.en_data
+#define DI_data zo_data.objdata_u.di_data
+#define LI_data zo_data.objdata_u.li_data
+#define GR_data zo_data.objdata_u.gr_data
+
+#define __type_of(o) ((o)->zo_data.zo_type)
+
+/* Declarations for the internal subroutines in nislib.c */
+enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME};
+typedef enum name_pos name_pos;
+
+/*
+ * Defines for getting at column data in entry objects. Because RPCGEN
+ * generates some rather wordy structures, we create some defines that
+ * collapse the needed keystrokes to access a particular value using
+ * these definitions they take an nis_object *, and an int and return
+ * a u_char * for Value, and an int for length.
+ */
+#define ENTRY_VAL(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
+#define ENTRY_LEN(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
+
+
+/* Prototypes, and extern declarations for the NIS library functions. */
+//#include <rpcsvc/nislib.h>
+#endif
+
+/*
+ * nis_3.h
+ *
+ * This file contains definitions that are only of interest to the actual
+ * service daemon and client stubs. Normal users of NIS will not include
+ * this file.
+ *
+ * NOTE : This include file is automatically created by a combination
+ * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
+ * and then remake this file.
+ */
+#ifndef __nis_3_h
+#define __nis_3_h
+
+#define NIS_PROG 100300
+#define NIS_VERSION 3
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ! _RPCSVC_NIS_H */
diff --git a/meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb b/meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb
index 330b829..9ee6570 100644
--- a/meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb
+++ b/meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb
@@ -19,6 +19,16 @@ SRC_URI_append_libc-uclibc = " file://remove-des-uclibc.patch \
                                file://va_list.patch \
                              "
 
+SRC_URI_append_libc-musl = "\
+            file://0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch \
+            file://0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch \
+            file://0004-Add-configure-option-to-disable-DES-authentication.patch \
+            file://0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch \
+            file://0006-Define-struct-rpcent-on-non-GNU-libc.patch \
+            file://0007-use-bsd-queue.patch \
+            file://nis.h \
+           "
+
 SRC_URI[libtirpc.md5sum] = "8cd41a5ef5a9b50d0fb6abb98af15368"
 SRC_URI[libtirpc.sha256sum] = "62f9de7c2c8686c568757730e1fef66502a0e00d6cacf33546d0267984e002db"
 SRC_URI[glibc-nfs.md5sum] = "5ae500b9d0b6b72cb875bc04944b9445"
@@ -27,11 +37,15 @@ SRC_URI[glibc-nfs.sha256sum] = "2677cfedf626f3f5a8f6e507aed5bb8f79a7453b589d684d
 inherit autotools pkgconfig
 
 EXTRA_OECONF = "--disable-gssapi"
+EXTRA_OECONF_append_libc-musl = " --disable-authdes"
 
 do_configure_prepend () {
         cp -r ${S}/../tirpc ${S}
 }
 
+do_configure_prepend_libc-musl () {
+        cp ${WORKDIR}/nis.h ${S}/../tirpc/rpcsvc/nis.h
+}
 do_install_append() {
         chown root:root ${D}${sysconfdir}/netconfig
 }
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 08/17] fts: Add recipe
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (6 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 07/17] libtirpc: Fix build for musl Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-21 12:15   ` Burton, Ross
  2015-12-19 23:52 ` [PATCH 09/17] valgrind: Define __UCLIBC__ for uclibc based systems Khem Raj
                   ` (9 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

fts is not implemented in musl but many packages depend on it
glibc implements it even though posix does not requir it to do so.
So provide an alternative provider for fts

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-core/fts/fts.bb                       |   38 +
 .../fts/fts/fts-header-correctness.patch           |   20 +
 meta/recipes-core/fts/fts/fts-uclibc.patch         |   45 +
 meta/recipes-core/fts/fts/gcc5.patch               | 1363 ++++++++++++++++++++
 meta/recipes-core/fts/fts/remove_cdefs.patch       |   64 +
 meta/recipes-core/fts/fts/stdint.patch             |   10 +
 6 files changed, 1540 insertions(+)
 create mode 100644 meta/recipes-core/fts/fts.bb
 create mode 100644 meta/recipes-core/fts/fts/fts-header-correctness.patch
 create mode 100644 meta/recipes-core/fts/fts/fts-uclibc.patch
 create mode 100644 meta/recipes-core/fts/fts/gcc5.patch
 create mode 100644 meta/recipes-core/fts/fts/remove_cdefs.patch
 create mode 100644 meta/recipes-core/fts/fts/stdint.patch

diff --git a/meta/recipes-core/fts/fts.bb b/meta/recipes-core/fts/fts.bb
new file mode 100644
index 0000000..56c7082
--- /dev/null
+++ b/meta/recipes-core/fts/fts.bb
@@ -0,0 +1,38 @@
+# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "keith bostic's POSIX file tree stream operations library"
+HOMEPAGE = "https://sites.google.com/a/bostic.com/keithbostic"
+LICENSE = "BSD"
+SECTION = "libs"
+
+SRC_URI = "https://sites.google.com/a/bostic.com/keithbostic/files/fts.tar.gz \
+           file://fts-header-correctness.patch \
+           file://fts-uclibc.patch \
+           file://remove_cdefs.patch \
+           file://stdint.patch \
+           file://gcc5.patch \
+"
+
+SRC_URI[md5sum] = "120c14715485ec6ced14f494d059d20a"
+SRC_URI[sha256sum] = "3df9b9b5a45aeaf16f33bb84e692a10dc662e22ec8a51748f98767d67fb6f342"
+
+S = "${WORKDIR}/${BPN}"
+
+do_configure[noexec] = "1"
+
+VER = "0"
+do_compile () {
+    ${CC} -I${S} -fPIC -shared -o libfts.so.${VER} -Wl,-soname,libfts.so.${VER} ${S}/fts.c
+}
+
+do_install() {
+    install -Dm755 ${B}/libfts.so.${VER} ${D}${libdir}/libfts.so.${VER}
+    ln -sf libfts.so.${VER} ${D}${libdir}/libfts.so
+    install -Dm644 ${S}/fts.h ${D}${includedir}/fts.h
+}
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
+
diff --git a/meta/recipes-core/fts/fts/fts-header-correctness.patch b/meta/recipes-core/fts/fts/fts-header-correctness.patch
new file mode 100644
index 0000000..59061bf
--- /dev/null
+++ b/meta/recipes-core/fts/fts/fts-header-correctness.patch
@@ -0,0 +1,20 @@
+--- fts.orig/fts.h
++++ fts/fts.h
+@@ -38,6 +38,17 @@
+ #ifndef	_FTS_H_
+ #define	_FTS_H_
+ 
++#include <sys/types.h>
++#include <sys/param.h>
++#include <sys/stat.h>
++
++#include <dirent.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++
+ typedef struct {
+ 	struct _ftsent *fts_cur;	/* current node */
+ 	struct _ftsent *fts_child;	/* linked list of children */
diff --git a/meta/recipes-core/fts/fts/fts-uclibc.patch b/meta/recipes-core/fts/fts/fts-uclibc.patch
new file mode 100644
index 0000000..3593530
--- /dev/null
+++ b/meta/recipes-core/fts/fts/fts-uclibc.patch
@@ -0,0 +1,45 @@
+--- fts.orig/fts.c
++++ fts/fts.c
+@@ -31,6 +31,10 @@
+  * SUCH DAMAGE.
+  */
+ 
++#define	alignof(TYPE)   ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2)
++#define	ALIGNBYTES	(alignof(long double) - 1)
++#define	ALIGN(p)	(((uintptr_t)(p) + ALIGNBYTES) & ~ALIGNBYTES) 
++
+ #if defined(LIBC_SCCS) && !defined(lint)
+ static char sccsid[] = "@(#)fts.c	8.6 (Berkeley) 8/14/94";
+ #endif /* LIBC_SCCS and not lint */
+@@ -652,10 +656,10 @@
+ 		if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
+ 			continue;
+ 
+-		if ((p = fts_alloc(sp, dp->d_name, (int)dp->d_namlen)) == NULL)
++		if ((p = fts_alloc(sp, dp->d_name, (int)dp->d_reclen)) == NULL)
+ 			goto mem1;
+-		if (dp->d_namlen > maxlen) {
+-			if (fts_palloc(sp, (size_t)dp->d_namlen)) {
++		if (dp->d_reclen > maxlen) {
++			if (fts_palloc(sp, (size_t)dp->d_reclen)) {
+ 				/*
+ 				 * No more memory for path or structures.  Save
+ 				 * errno, free up the current structure and the
+@@ -675,7 +679,7 @@
+ 			maxlen = sp->fts_pathlen - sp->fts_cur->fts_pathlen - 1;
+ 		}
+ 
+-		p->fts_pathlen = len + dp->d_namlen + 1;
++		p->fts_pathlen = len + dp->d_reclen + 1;
+ 		p->fts_parent = sp->fts_cur;
+ 		p->fts_level = level;
+ 
+@@ -784,7 +788,7 @@
+ 	/* If user needs stat info, stat buffer already allocated. */
+ 	sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
+ 
+-#ifdef DT_WHT
++#ifdef S_IFWHT
+ 	/*
+ 	 * Whited-out files don't really exist.  However, there's stat(2) file
+ 	 * mask for them, so we set it so that programs (i.e., find) don't have
diff --git a/meta/recipes-core/fts/fts/gcc5.patch b/meta/recipes-core/fts/fts/gcc5.patch
new file mode 100644
index 0000000..d61ae29
--- /dev/null
+++ b/meta/recipes-core/fts/fts/gcc5.patch
@@ -0,0 +1,1363 @@
+Index: fts/fts.c
+===================================================================
+--- fts.orig/fts.c
++++ fts/fts.c
+@@ -51,16 +51,6 @@ static char sccsid[] = "@(#)fts.c	8.6 (B
+ #include <string.h>
+ #include <unistd.h>
+ 
+-static FTSENT	*fts_alloc __P(FTS *, char *, int);
+-static FTSENT	*fts_build __P(FTS *, int);
+-static void	 fts_lfree __P(FTSENT *);
+-static void	 fts_load __P(FTS *, FTSENT *);
+-static size_t	 fts_maxarglen __P(char * const *);
+-static void	 fts_padjust __P(FTS *, void *);
+-static int	 fts_palloc __P(FTS *, size_t);
+-static FTSENT	*fts_sort __P(FTS *, FTSENT *, int);
+-static u_short	 fts_stat __P(FTS *, struct dirent *, FTSENT *, int);
+-
+ #define	ISDOT(a)	(a[0] == '.' && (!a[1] || a[1] == '.' && !a[2]))
+ 
+ #define	ISSET(opt)	(sp->fts_options & opt)
+@@ -73,119 +63,16 @@ static u_short	 fts_stat __P(FTS *, stru
+ #define	BCHILD		1		/* fts_children */
+ #define	BNAMES		2		/* fts_children, names only */
+ #define	BREAD		3		/* fts_read */
+-
+-FTS *
+-fts_open(argv, options, compar)
+-	char * const *argv;
+-	register int options;
+-	int (*compar)();
+-{
+-	register FTS *sp;
+-	register FTSENT *p, *root;
+-	register int nitems;
+-	FTSENT *parent, *tmp;
+-	int len;
+-
+-	/* Options check. */
+-	if (options & ~FTS_OPTIONMASK) {
+-		errno = EINVAL;
+-		return (NULL);
+-	}
+-
+-	/* Allocate/initialize the stream */
+-	if ((sp = malloc((u_int)sizeof(FTS))) == NULL)
+-		return (NULL);
+-	memset(sp, 0, sizeof(FTS));
+-	sp->fts_compar = compar;
+-	sp->fts_options = options;
+-
+-	/* Logical walks turn on NOCHDIR; symbolic links are too hard. */
+-	if (ISSET(FTS_LOGICAL))
+-		SET(FTS_NOCHDIR);
+-
+-	/*
+-	 * Start out with 1K of path space, and enough, in any case,
+-	 * to hold the user's paths.
+-	 */
+-	if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))
+-		goto mem1;
+-
+-	/* Allocate/initialize root's parent. */
+-	if ((parent = fts_alloc(sp, "", 0)) == NULL)
+-		goto mem2;
+-	parent->fts_level = FTS_ROOTPARENTLEVEL;
+-
+-	/* Allocate/initialize root(s). */
+-	for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) {
+-		/* Don't allow zero-length paths. */
+-		if ((len = strlen(*argv)) == 0) {
+-			errno = EINVAL;
+-			goto mem3;
+-		}
+-
+-		p = fts_alloc(sp, *argv, len);
+-		p->fts_level = FTS_ROOTLEVEL;
+-		p->fts_parent = parent;
+-		p->fts_accpath = p->fts_name;
+-		p->fts_info = fts_stat(sp, NULL, p, ISSET(FTS_COMFOLLOW));
+-
+-		/* Command-line "." and ".." are real directories. */
+-		if (p->fts_info == FTS_DOT)
+-			p->fts_info = FTS_D;
+-
+-		/*
+-		 * If comparison routine supplied, traverse in sorted
+-		 * order; otherwise traverse in the order specified.
+-		 */
+-		if (compar) {
+-			p->fts_link = root;
+-			root = p;
+-		} else {
+-			p->fts_link = NULL;
+-			if (root == NULL)
+-				tmp = root = p;
+-			else {
+-				tmp->fts_link = p;
+-				tmp = p;
+-			}
+-		}
+-	}
+-	if (compar && nitems > 1)
+-		root = fts_sort(sp, root, nitems);
+-
+-	/*
+-	 * Allocate a dummy pointer and make fts_read think that we've just
+-	 * finished the node before the root(s); set p->fts_info to FTS_INIT
+-	 * so that everything about the "current" node is ignored.
+-	 */
+-	if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
+-		goto mem3;
+-	sp->fts_cur->fts_link = root;
+-	sp->fts_cur->fts_info = FTS_INIT;
+-
+-	/*
+-	 * If using chdir(2), grab a file descriptor pointing to dot to insure
+-	 * that we can get back here; this could be avoided for some paths,
+-	 * but almost certainly not worth the effort.  Slashes, symbolic links,
+-	 * and ".." are all fairly nasty problems.  Note, if we can't get the
+-	 * descriptor we run anyway, just more slowly.
+-	 */
+-	if (!ISSET(FTS_NOCHDIR) && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0)
+-		SET(FTS_NOCHDIR);
+-
+-	return (sp);
+-
+-mem3:	fts_lfree(root);
+-	free(parent);
+-mem2:	free(sp->fts_path);
+-mem1:	free(sp);
+-	return (NULL);
+-}
++/*
++ * Special case a root of "/" so that slashes aren't appended which would
++ * cause paths to be written as "//foo".
++ */
++#define	NAPPEND(p)							\
++	(p->fts_level == FTS_ROOTLEVEL && p->fts_pathlen == 1 &&	\
++	    p->fts_path[0] == '/' ? 0 : p->fts_pathlen)
+ 
+ static void
+-fts_load(sp, p)
+-	FTS *sp;
+-	register FTSENT *p;
++fts_load(FTS *sp, register FTSENT *p)
+ {
+ 	register int len;
+ 	register char *cp;
+@@ -208,332 +95,214 @@ fts_load(sp, p)
+ 	sp->fts_dev = p->fts_dev;
+ }
+ 
+-int
+-fts_close(sp)
+-	FTS *sp;
++static void
++fts_lfree(register FTSENT *head)
+ {
+-	register FTSENT *freep, *p;
+-	int saved_errno;
++	register FTSENT *p;
+ 
+-	/*
+-	 * This still works if we haven't read anything -- the dummy structure
+-	 * points to the root list, so we step through to the end of the root
+-	 * list which has a valid parent pointer.
+-	 */
+-	if (sp->fts_cur) {
+-		for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
+-			freep = p;
+-			p = p->fts_link ? p->fts_link : p->fts_parent;
+-			free(freep);
+-		}
++	/* Free a linked list of structures. */
++	while (p = head) {
++		head = head->fts_link;
+ 		free(p);
+ 	}
++}
+ 
+-	/* Free up child linked list, sort array, path buffer. */
+-	if (sp->fts_child)
+-		fts_lfree(sp->fts_child);
+-	if (sp->fts_array)
+-		free(sp->fts_array);
+-	free(sp->fts_path);
++static size_t
++fts_maxarglen(char * const *argv)
++{
++	size_t len, max;
+ 
+-	/* Return to original directory, save errno if necessary. */
+-	if (!ISSET(FTS_NOCHDIR)) {
+-		saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
+-		(void)close(sp->fts_rfd);
+-	}
++	for (max = 0; *argv; ++argv)
++		if ((len = strlen(*argv)) > max)
++			max = len;
++	return (max);
++}
+ 
+-	/* Free up the stream pointer. */
+-	free(sp);
+ 
+-	/* Set errno and return. */
+-	if (!ISSET(FTS_NOCHDIR) && saved_errno) {
+-		errno = saved_errno;
+-		return (-1);
++/*
++ * When the path is realloc'd, have to fix all of the pointers in structures
++ * already returned.
++ */
++static void
++fts_padjust(FTS *sp, void *addr)
++{
++	FTSENT *p;
++
++#define	ADJUST(p) {							\
++	(p)->fts_accpath =						\
++	    (char *)addr + ((p)->fts_accpath - (p)->fts_path);		\
++	(p)->fts_path = addr;						\
++}
++	/* Adjust the current set of children. */
++	for (p = sp->fts_child; p; p = p->fts_link)
++		ADJUST(p);
++
++	/* Adjust the rest of the tree. */
++	for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
++		ADJUST(p);
++		p = p->fts_link ? p->fts_link : p->fts_parent;
+ 	}
+-	return (0);
+ }
+ 
+ /*
+- * Special case a root of "/" so that slashes aren't appended which would
+- * cause paths to be written as "//foo".
++ * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
++ * Most systems will allow creation of paths much longer than MAXPATHLEN, even
++ * though the kernel won't resolve them.  Add the size (not just what's needed)
++ * plus 256 bytes so don't realloc the path 2 bytes at a time.
+  */
+-#define	NAPPEND(p)							\
+-	(p->fts_level == FTS_ROOTLEVEL && p->fts_pathlen == 1 &&	\
+-	    p->fts_path[0] == '/' ? 0 : p->fts_pathlen)
++static int
++fts_palloc(FTS *sp, size_t more)
++{
++	sp->fts_pathlen += more + 256;
++	sp->fts_path = realloc(sp->fts_path, (size_t)sp->fts_pathlen);
++	return (sp->fts_path == NULL);
++}
+ 
+-FTSENT *
+-fts_read(sp)
+-	register FTS *sp;
++static FTSENT *
++fts_alloc(FTS *sp, char *name, register int namelen)
+ {
+-	register FTSENT *p, *tmp;
+-	register int instr;
+-	register char *t;
+-	int saved_errno;
++	register FTSENT *p;
++	size_t len;
+ 
+-	/* If finished or unrecoverable error, return NULL. */
+-	if (sp->fts_cur == NULL || ISSET(FTS_STOP))
++	/*
++	 * The file name is a variable length array and no stat structure is
++	 * necessary if the user has set the nostat bit.  Allocate the FTSENT
++	 * structure, the file name and the stat structure in one chunk, but
++	 * be careful that the stat structure is reasonably aligned.  Since the
++	 * fts_name field is declared to be of size 1, the fts_name pointer is
++	 * namelen + 2 before the first possible address of the stat structure.
++	 */
++	len = sizeof(FTSENT) + namelen;
++	if (!ISSET(FTS_NOSTAT))
++		len += sizeof(struct stat) + ALIGNBYTES;
++	if ((p = malloc(len)) == NULL)
+ 		return (NULL);
+ 
+-	/* Set current node pointer. */
+-	p = sp->fts_cur;
++	/* Copy the name plus the trailing NULL. */
++	memmove(p->fts_name, name, namelen + 1);
+ 
+-	/* Save and zero out user instructions. */
+-	instr = p->fts_instr;
++	if (!ISSET(FTS_NOSTAT))
++		p->fts_statp = (struct stat *)ALIGN(p->fts_name + namelen + 2);
++	p->fts_namelen = namelen;
++	p->fts_path = sp->fts_path;
++	p->fts_errno = 0;
++	p->fts_flags = 0;
+ 	p->fts_instr = FTS_NOINSTR;
++	p->fts_number = 0;
++	p->fts_pointer = NULL;
++	return (p);
++}
+ 
+-	/* Any type of file may be re-visited; re-stat and re-turn. */
+-	if (instr == FTS_AGAIN) {
+-		p->fts_info = fts_stat(sp, NULL, p, 0);
+-		return (p);
+-	}
+ 
++static u_short
++fts_stat(FTS *sp, register FTSENT *p, struct dirent *dp, int follow)
++{
++	register FTSENT *t;
++	register dev_t dev;
++	register ino_t ino;
++	struct stat *sbp, sb;
++	int saved_errno;
++
++	/* If user needs stat info, stat buffer already allocated. */
++	sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
++
++#ifdef S_IFWHT
+ 	/*
+-	 * Following a symlink -- SLNONE test allows application to see
+-	 * SLNONE and recover.  If indirecting through a symlink, have
+-	 * keep a pointer to current location.  If unable to get that
+-	 * pointer, follow fails.
+-	 */
+-	if (instr == FTS_FOLLOW &&
+-	    (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
+-		p->fts_info = fts_stat(sp, NULL, p, 1);
+-		if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR))
+-			if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
+-				p->fts_errno = errno;
+-				p->fts_info = FTS_ERR;
+-			} else
+-				p->fts_flags |= FTS_SYMFOLLOW;
+-		return (p);
++	 * Whited-out files don't really exist.  However, there's stat(2) file
++	 * mask for them, so we set it so that programs (i.e., find) don't have
++	 * to test FTS_W separately from other file types.
++	 */
++	if (dp != NULL && dp->d_type == DT_WHT) {
++		memset(sbp, 0, sizeof(struct stat));
++		sbp->st_mode = S_IFWHT;
++		return (FTS_W);
+ 	}
+-
+-	/* Directory in pre-order. */
+-	if (p->fts_info == FTS_D) {
+-		/* If skipped or crossed mount point, do post-order visit. */
+-		if (instr == FTS_SKIP ||
+-		    ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) {
+-			if (p->fts_flags & FTS_SYMFOLLOW)
+-				(void)close(p->fts_symfd);
+-			if (sp->fts_child) {
+-				fts_lfree(sp->fts_child);
+-				sp->fts_child = NULL;
+-			}
+-			p->fts_info = FTS_DP;
+-			return (p);
+-		} 
+-
+-		/* Rebuild if only read the names and now traversing. */
+-		if (sp->fts_child && sp->fts_options & FTS_NAMEONLY) {
+-			sp->fts_options &= ~FTS_NAMEONLY;
+-			fts_lfree(sp->fts_child);
+-			sp->fts_child = NULL;
+-		}
+-
+-		/*
+-		 * Cd to the subdirectory.
+-		 *
+-		 * If have already read and now fail to chdir, whack the list
+-		 * to make the names come out right, and set the parent errno
+-		 * so the application will eventually get an error condition.
+-		 * Set the FTS_DONTCHDIR flag so that when we logically change
+-		 * directories back to the parent we don't do a chdir.
+-		 *
+-		 * If haven't read do so.  If the read fails, fts_build sets
+-		 * FTS_STOP or the fts_info field of the node.
+-		 */
+-		if (sp->fts_child) {
+-			if (CHDIR(sp, p->fts_accpath)) {
+-				p->fts_errno = errno;
+-				p->fts_flags |= FTS_DONTCHDIR;
+-				for (p = sp->fts_child; p; p = p->fts_link)
+-					p->fts_accpath =
+-					    p->fts_parent->fts_accpath;
+-			}
+-		} else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
+-			if (ISSET(FTS_STOP))
+-				return (NULL);
+-			return (p);
++#endif
++
++	/*
++	 * If doing a logical walk, or application requested FTS_FOLLOW, do
++	 * a stat(2).  If that fails, check for a non-existent symlink.  If
++	 * fail, set the errno from the stat call.
++	 */
++	if (ISSET(FTS_LOGICAL) || follow) {
++		if (stat(p->fts_accpath, sbp)) {
++			saved_errno = errno;
++			if (!lstat(p->fts_accpath, sbp)) {
++				errno = 0;
++				return (FTS_SLNONE);
++			}
++			p->fts_errno = saved_errno;
++			goto err;
+ 		}
+-		p = sp->fts_child;
+-		sp->fts_child = NULL;
+-		goto name;
++	} else if (lstat(p->fts_accpath, sbp)) {
++		p->fts_errno = errno;
++err:		memset(sbp, 0, sizeof(struct stat));
++		return (FTS_NS);
+ 	}
+ 
+-	/* Move to the next node on this level. */
+-next:	tmp = p;
+-	if (p = p->fts_link) {
+-		free(tmp);
+-
+-		/*
+-		 * If reached the top, return to the original directory, and
+-		 * load the paths for the next root.
+-		 */
+-		if (p->fts_level == FTS_ROOTLEVEL) {
+-			if (!ISSET(FTS_NOCHDIR) && FCHDIR(sp, sp->fts_rfd)) {
+-				SET(FTS_STOP);
+-				return (NULL);
+-			}
+-			fts_load(sp, p);
+-			return (sp->fts_cur = p);
+-		}
+-
++	if (S_ISDIR(sbp->st_mode)) {
+ 		/*
+-		 * User may have called fts_set on the node.  If skipped,
+-		 * ignore.  If followed, get a file descriptor so we can
+-		 * get back if necessary.
++		 * Set the device/inode.  Used to find cycles and check for
++		 * crossing mount points.  Also remember the link count, used
++		 * in fts_build to limit the number of stat calls.  It is
++		 * understood that these fields are only referenced if fts_info
++		 * is set to FTS_D.
+ 		 */
+-		if (p->fts_instr == FTS_SKIP)
+-			goto next;
+-		if (p->fts_instr == FTS_FOLLOW) {
+-			p->fts_info = fts_stat(sp, NULL, p, 1);
+-			if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR))
+-				if ((p->fts_symfd =
+-				    open(".", O_RDONLY, 0)) < 0) {
+-					p->fts_errno = errno;
+-					p->fts_info = FTS_ERR;
+-				} else
+-					p->fts_flags |= FTS_SYMFOLLOW;
+-			p->fts_instr = FTS_NOINSTR;
+-		}
+-
+-name:		t = sp->fts_path + NAPPEND(p->fts_parent);
+-		*t++ = '/';
+-		memmove(t, p->fts_name, p->fts_namelen + 1);
+-		return (sp->fts_cur = p);
+-	}
++		dev = p->fts_dev = sbp->st_dev;
++		ino = p->fts_ino = sbp->st_ino;
++		p->fts_nlink = sbp->st_nlink;
+ 
+-	/* Move up to the parent node. */
+-	p = tmp->fts_parent;
+-	free(tmp);
++		if (ISDOT(p->fts_name))
++			return (FTS_DOT);
+ 
+-	if (p->fts_level == FTS_ROOTPARENTLEVEL) {
+ 		/*
+-		 * Done; free everything up and set errno to 0 so the user
+-		 * can distinguish between error and EOF.
++		 * Cycle detection is done by brute force when the directory
++		 * is first encountered.  If the tree gets deep enough or the
++		 * number of symbolic links to directories is high enough,
++		 * something faster might be worthwhile.
+ 		 */
+-		free(p);
+-		errno = 0;
+-		return (sp->fts_cur = NULL);
+-	}
+-
+-	/* Nul terminate the pathname. */
+-	sp->fts_path[p->fts_pathlen] = '\0';
+-
+-	/*
+-	 * Return to the parent directory.  If at a root node or came through
+-	 * a symlink, go back through the file descriptor.  Otherwise, cd up
+-	 * one directory.
+-	 */
+-	if (p->fts_level == FTS_ROOTLEVEL) {
+-		if (!ISSET(FTS_NOCHDIR) && FCHDIR(sp, sp->fts_rfd)) {
+-			SET(FTS_STOP);
+-			return (NULL);
+-		}
+-	} else if (p->fts_flags & FTS_SYMFOLLOW) {
+-		if (FCHDIR(sp, p->fts_symfd)) {
+-			saved_errno = errno;
+-			(void)close(p->fts_symfd);
+-			errno = saved_errno;
+-			SET(FTS_STOP);
+-			return (NULL);
+-		}
+-		(void)close(p->fts_symfd);
+-	} else if (!(p->fts_flags & FTS_DONTCHDIR)) {
+-		if (CHDIR(sp, "..")) {
+-			SET(FTS_STOP);
+-			return (NULL);
+-		}
+-	}
+-	p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
+-	return (sp->fts_cur = p);
+-}
+-
+-/*
+- * Fts_set takes the stream as an argument although it's not used in this
+- * implementation; it would be necessary if anyone wanted to add global
+- * semantics to fts using fts_set.  An error return is allowed for similar
+- * reasons.
+- */
+-/* ARGSUSED */
+-int
+-fts_set(sp, p, instr)
+-	FTS *sp;
+-	FTSENT *p;
+-	int instr;
+-{
+-	if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
+-	    instr != FTS_NOINSTR && instr != FTS_SKIP) {
+-		errno = EINVAL;
+-		return (1);
++		for (t = p->fts_parent;
++		    t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
++			if (ino == t->fts_ino && dev == t->fts_dev) {
++				p->fts_cycle = t;
++				return (FTS_DC);
++			}
++		return (FTS_D);
+ 	}
+-	p->fts_instr = instr;
+-	return (0);
++	if (S_ISLNK(sbp->st_mode))
++		return (FTS_SL);
++	if (S_ISREG(sbp->st_mode))
++		return (FTS_F);
++	return (FTS_DEFAULT);
+ }
+ 
+-FTSENT *
+-fts_children(sp, instr)
+-	register FTS *sp;
+-	int instr;
++static FTSENT *
++fts_sort(FTS *sp, FTSENT *head, register int nitems)
+ {
+-	register FTSENT *p;
+-	int fd;
+-
+-	if (instr && instr != FTS_NAMEONLY) {
+-		errno = EINVAL;
+-		return (NULL);
+-	}
+-
+-	/* Set current node pointer. */
+-	p = sp->fts_cur;
+-
+-	/*
+-	 * Errno set to 0 so user can distinguish empty directory from
+-	 * an error.
+-	 */
+-	errno = 0;
+-
+-	/* Fatal errors stop here. */
+-	if (ISSET(FTS_STOP))
+-		return (NULL);
+-
+-	/* Return logical hierarchy of user's arguments. */
+-	if (p->fts_info == FTS_INIT)
+-		return (p->fts_link);
+-
+-	/*
+-	 * If not a directory being visited in pre-order, stop here.  Could
+-	 * allow FTS_DNR, assuming the user has fixed the problem, but the
+-	 * same effect is available with FTS_AGAIN.
+-	 */
+-	if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */)
+-		return (NULL);
+-
+-	/* Free up any previous child list. */
+-	if (sp->fts_child)
+-		fts_lfree(sp->fts_child);
+-
+-	if (instr == FTS_NAMEONLY) {
+-		sp->fts_options |= FTS_NAMEONLY;
+-		instr = BNAMES;
+-	} else 
+-		instr = BCHILD;
++	register FTSENT **ap, *p;
+ 
+ 	/*
+-	 * If using chdir on a relative path and called BEFORE fts_read does
+-	 * its chdir to the root of a traversal, we can lose -- we need to
+-	 * chdir into the subdirectory, and we don't know where the current
+-	 * directory is, so we can't get back so that the upcoming chdir by
+-	 * fts_read will work.
++	 * Construct an array of pointers to the structures and call qsort(3).
++	 * Reassemble the array in the order returned by qsort.  If unable to
++	 * sort for memory reasons, return the directory entries in their
++	 * current order.  Allocate enough space for the current needs plus
++	 * 40 so don't realloc one entry at a time.
+ 	 */
+-	if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
+-	    ISSET(FTS_NOCHDIR))
+-		return (sp->fts_child = fts_build(sp, instr));
+-
+-	if ((fd = open(".", O_RDONLY, 0)) < 0)
+-		return (NULL);
+-	sp->fts_child = fts_build(sp, instr);
+-	if (fchdir(fd))
+-		return (NULL);
+-	(void)close(fd);
+-	return (sp->fts_child);
++	if (nitems > sp->fts_nitems) {
++		sp->fts_nitems = nitems + 40;
++		if ((sp->fts_array = realloc(sp->fts_array,
++		    (size_t)(sp->fts_nitems * sizeof(FTSENT *)))) == NULL) {
++			sp->fts_nitems = 0;
++			return (head);
++		}
++	}
++	for (ap = sp->fts_array, p = head; p; p = p->fts_link)
++		*ap++ = p;
++	qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar);
++	for (head = *(ap = sp->fts_array); --nitems; ++ap)
++		ap[0]->fts_link = ap[1];
++	ap[0]->fts_link = NULL;
++	return (head);
+ }
+ 
+ /*
+@@ -551,9 +320,7 @@ fts_children(sp, instr)
+  * been found, cutting the stat calls by about 2/3.
+  */
+ static FTSENT *
+-fts_build(sp, type)
+-	register FTS *sp;
+-	int type;
++fts_build(register FTS *sp, int type)
+ {
+ 	register struct dirent *dp;
+ 	register FTSENT *p, *head;
+@@ -716,283 +483,479 @@ mem1:				saved_errno = errno;
+ 				--nlinks;
+ 		}
+ 
+-		/* We walk in directory order so "ls -f" doesn't get upset. */
+-		p->fts_link = NULL;
+-		if (head == NULL)
+-			head = tail = p;
+-		else {
+-			tail->fts_link = p;
+-			tail = p;
++		/* We walk in directory order so "ls -f" doesn't get upset. */
++		p->fts_link = NULL;
++		if (head == NULL)
++			head = tail = p;
++		else {
++			tail->fts_link = p;
++			tail = p;
++		}
++		++nitems;
++	}
++	(void)closedir(dirp);
++
++	/*
++	 * If had to realloc the path, adjust the addresses for the rest
++	 * of the tree.
++	 */
++	if (adjaddr)
++		fts_padjust(sp, adjaddr);
++
++	/*
++	 * If not changing directories, reset the path back to original
++	 * state.
++	 */
++	if (ISSET(FTS_NOCHDIR)) {
++		if (cp - 1 > sp->fts_path)
++			--cp;
++		*cp = '\0';
++	}
++
++	/*
++	 * If descended after called from fts_children or after called from
++	 * fts_read and nothing found, get back.  At the root level we use
++	 * the saved fd; if one of fts_open()'s arguments is a relative path
++	 * to an empty directory, we wind up here with no other way back.  If
++	 * can't get back, we're done.
++	 */
++	if (descend && (type == BCHILD || !nitems) &&
++	    (cur->fts_level == FTS_ROOTLEVEL ?
++	    FCHDIR(sp, sp->fts_rfd) : CHDIR(sp, ".."))) {
++		cur->fts_info = FTS_ERR;
++		SET(FTS_STOP);
++		return (NULL);
++	}
++
++	/* If didn't find anything, return NULL. */
++	if (!nitems) {
++		if (type == BREAD)
++			cur->fts_info = FTS_DP;
++		return (NULL);
++	}
++
++	/* Sort the entries. */
++	if (sp->fts_compar && nitems > 1)
++		head = fts_sort(sp, head, nitems);
++	return (head);
++}
++
++
++FTS *
++fts_open(char * const *argv, register int options, int (*compar)())
++{
++	register FTS *sp;
++	register FTSENT *p, *root;
++	register int nitems;
++	FTSENT *parent, *tmp;
++	int len;
++
++	/* Options check. */
++	if (options & ~FTS_OPTIONMASK) {
++		errno = EINVAL;
++		return (NULL);
++	}
++
++	/* Allocate/initialize the stream */
++	if ((sp = malloc((u_int)sizeof(FTS))) == NULL)
++		return (NULL);
++	memset(sp, 0, sizeof(FTS));
++	sp->fts_compar = compar;
++	sp->fts_options = options;
++
++	/* Logical walks turn on NOCHDIR; symbolic links are too hard. */
++	if (ISSET(FTS_LOGICAL))
++		SET(FTS_NOCHDIR);
++
++	/*
++	 * Start out with 1K of path space, and enough, in any case,
++	 * to hold the user's paths.
++	 */
++	if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))
++		goto mem1;
++
++	/* Allocate/initialize root's parent. */
++	if ((parent = fts_alloc(sp, "", 0)) == NULL)
++		goto mem2;
++	parent->fts_level = FTS_ROOTPARENTLEVEL;
++
++	/* Allocate/initialize root(s). */
++	for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) {
++		/* Don't allow zero-length paths. */
++		if ((len = strlen(*argv)) == 0) {
++			errno = EINVAL;
++			goto mem3;
++		}
++
++		p = fts_alloc(sp, *argv, len);
++		p->fts_level = FTS_ROOTLEVEL;
++		p->fts_parent = parent;
++		p->fts_accpath = p->fts_name;
++		p->fts_info = fts_stat(sp, NULL, p, ISSET(FTS_COMFOLLOW));
++
++		/* Command-line "." and ".." are real directories. */
++		if (p->fts_info == FTS_DOT)
++			p->fts_info = FTS_D;
++
++		/*
++		 * If comparison routine supplied, traverse in sorted
++		 * order; otherwise traverse in the order specified.
++		 */
++		if (compar) {
++			p->fts_link = root;
++			root = p;
++		} else {
++			p->fts_link = NULL;
++			if (root == NULL)
++				tmp = root = p;
++			else {
++				tmp->fts_link = p;
++				tmp = p;
++			}
+ 		}
+-		++nitems;
+ 	}
+-	(void)closedir(dirp);
+-
+-	/*
+-	 * If had to realloc the path, adjust the addresses for the rest
+-	 * of the tree.
+-	 */
+-	if (adjaddr)
+-		fts_padjust(sp, adjaddr);
++	if (compar && nitems > 1)
++		root = fts_sort(sp, root, nitems);
+ 
+ 	/*
+-	 * If not changing directories, reset the path back to original
+-	 * state.
++	 * Allocate a dummy pointer and make fts_read think that we've just
++	 * finished the node before the root(s); set p->fts_info to FTS_INIT
++	 * so that everything about the "current" node is ignored.
+ 	 */
+-	if (ISSET(FTS_NOCHDIR)) {
+-		if (cp - 1 > sp->fts_path)
+-			--cp;
+-		*cp = '\0';
+-	}
++	if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
++		goto mem3;
++	sp->fts_cur->fts_link = root;
++	sp->fts_cur->fts_info = FTS_INIT;
+ 
+ 	/*
+-	 * If descended after called from fts_children or after called from
+-	 * fts_read and nothing found, get back.  At the root level we use
+-	 * the saved fd; if one of fts_open()'s arguments is a relative path
+-	 * to an empty directory, we wind up here with no other way back.  If
+-	 * can't get back, we're done.
++	 * If using chdir(2), grab a file descriptor pointing to dot to insure
++	 * that we can get back here; this could be avoided for some paths,
++	 * but almost certainly not worth the effort.  Slashes, symbolic links,
++	 * and ".." are all fairly nasty problems.  Note, if we can't get the
++	 * descriptor we run anyway, just more slowly.
+ 	 */
+-	if (descend && (type == BCHILD || !nitems) &&
+-	    (cur->fts_level == FTS_ROOTLEVEL ?
+-	    FCHDIR(sp, sp->fts_rfd) : CHDIR(sp, ".."))) {
+-		cur->fts_info = FTS_ERR;
+-		SET(FTS_STOP);
+-		return (NULL);
+-	}
++	if (!ISSET(FTS_NOCHDIR) && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0)
++		SET(FTS_NOCHDIR);
+ 
+-	/* If didn't find anything, return NULL. */
+-	if (!nitems) {
+-		if (type == BREAD)
+-			cur->fts_info = FTS_DP;
+-		return (NULL);
+-	}
++	return (sp);
+ 
+-	/* Sort the entries. */
+-	if (sp->fts_compar && nitems > 1)
+-		head = fts_sort(sp, head, nitems);
+-	return (head);
++mem3:	fts_lfree(root);
++	free(parent);
++mem2:	free(sp->fts_path);
++mem1:	free(sp);
++	return (NULL);
+ }
+ 
+-static u_short
+-fts_stat(sp, dp, p, follow)
+-	FTS *sp;
+-	register FTSENT *p;
+-	struct dirent *dp;
+-	int follow;
++FTSENT *
++fts_read(register FTS *sp)
+ {
+-	register FTSENT *t;
+-	register dev_t dev;
+-	register ino_t ino;
+-	struct stat *sbp, sb;
++	register FTSENT *p, *tmp;
++	register int instr;
++	register char *t;
+ 	int saved_errno;
+ 
+-	/* If user needs stat info, stat buffer already allocated. */
+-	sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
++	/* If finished or unrecoverable error, return NULL. */
++	if (sp->fts_cur == NULL || ISSET(FTS_STOP))
++		return (NULL);
+ 
+-#ifdef S_IFWHT
+-	/*
+-	 * Whited-out files don't really exist.  However, there's stat(2) file
+-	 * mask for them, so we set it so that programs (i.e., find) don't have
+-	 * to test FTS_W separately from other file types.
+-	 */
+-	if (dp != NULL && dp->d_type == DT_WHT) {
+-		memset(sbp, 0, sizeof(struct stat));
+-		sbp->st_mode = S_IFWHT;
+-		return (FTS_W);
++	/* Set current node pointer. */
++	p = sp->fts_cur;
++
++	/* Save and zero out user instructions. */
++	instr = p->fts_instr;
++	p->fts_instr = FTS_NOINSTR;
++
++	/* Any type of file may be re-visited; re-stat and re-turn. */
++	if (instr == FTS_AGAIN) {
++		p->fts_info = fts_stat(sp, NULL, p, 0);
++		return (p);
+ 	}
+-#endif
+-	
++
+ 	/*
+-	 * If doing a logical walk, or application requested FTS_FOLLOW, do
+-	 * a stat(2).  If that fails, check for a non-existent symlink.  If
+-	 * fail, set the errno from the stat call.
++	 * Following a symlink -- SLNONE test allows application to see
++	 * SLNONE and recover.  If indirecting through a symlink, have
++	 * keep a pointer to current location.  If unable to get that
++	 * pointer, follow fails.
+ 	 */
+-	if (ISSET(FTS_LOGICAL) || follow) {
+-		if (stat(p->fts_accpath, sbp)) {
+-			saved_errno = errno;
+-			if (!lstat(p->fts_accpath, sbp)) {
+-				errno = 0;
+-				return (FTS_SLNONE);
+-			} 
+-			p->fts_errno = saved_errno;
+-			goto err;
++	if (instr == FTS_FOLLOW &&
++	    (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
++		p->fts_info = fts_stat(sp, NULL, p, 1);
++		if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR))
++			if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
++				p->fts_errno = errno;
++				p->fts_info = FTS_ERR;
++			} else
++				p->fts_flags |= FTS_SYMFOLLOW;
++		return (p);
++	}
++
++	/* Directory in pre-order. */
++	if (p->fts_info == FTS_D) {
++		/* If skipped or crossed mount point, do post-order visit. */
++		if (instr == FTS_SKIP ||
++		    ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) {
++			if (p->fts_flags & FTS_SYMFOLLOW)
++				(void)close(p->fts_symfd);
++			if (sp->fts_child) {
++				fts_lfree(sp->fts_child);
++				sp->fts_child = NULL;
++			}
++			p->fts_info = FTS_DP;
++			return (p);
+ 		}
+-	} else if (lstat(p->fts_accpath, sbp)) {
+-		p->fts_errno = errno;
+-err:		memset(sbp, 0, sizeof(struct stat));
+-		return (FTS_NS);
++
++		/* Rebuild if only read the names and now traversing. */
++		if (sp->fts_child && sp->fts_options & FTS_NAMEONLY) {
++			sp->fts_options &= ~FTS_NAMEONLY;
++			fts_lfree(sp->fts_child);
++			sp->fts_child = NULL;
++		}
++
++		/*
++		 * Cd to the subdirectory.
++		 *
++		 * If have already read and now fail to chdir, whack the list
++		 * to make the names come out right, and set the parent errno
++		 * so the application will eventually get an error condition.
++		 * Set the FTS_DONTCHDIR flag so that when we logically change
++		 * directories back to the parent we don't do a chdir.
++		 *
++		 * If haven't read do so.  If the read fails, fts_build sets
++		 * FTS_STOP or the fts_info field of the node.
++		 */
++		if (sp->fts_child) {
++			if (CHDIR(sp, p->fts_accpath)) {
++				p->fts_errno = errno;
++				p->fts_flags |= FTS_DONTCHDIR;
++				for (p = sp->fts_child; p; p = p->fts_link)
++					p->fts_accpath =
++					    p->fts_parent->fts_accpath;
++			}
++		} else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
++			if (ISSET(FTS_STOP))
++				return (NULL);
++			return (p);
++		}
++		p = sp->fts_child;
++		sp->fts_child = NULL;
++		goto name;
+ 	}
+ 
+-	if (S_ISDIR(sbp->st_mode)) {
++	/* Move to the next node on this level. */
++next:	tmp = p;
++	if (p = p->fts_link) {
++		free(tmp);
++
+ 		/*
+-		 * Set the device/inode.  Used to find cycles and check for
+-		 * crossing mount points.  Also remember the link count, used
+-		 * in fts_build to limit the number of stat calls.  It is
+-		 * understood that these fields are only referenced if fts_info
+-		 * is set to FTS_D.
++		 * If reached the top, return to the original directory, and
++		 * load the paths for the next root.
+ 		 */
+-		dev = p->fts_dev = sbp->st_dev;
+-		ino = p->fts_ino = sbp->st_ino;
+-		p->fts_nlink = sbp->st_nlink;
++		if (p->fts_level == FTS_ROOTLEVEL) {
++			if (!ISSET(FTS_NOCHDIR) && FCHDIR(sp, sp->fts_rfd)) {
++				SET(FTS_STOP);
++				return (NULL);
++			}
++			fts_load(sp, p);
++			return (sp->fts_cur = p);
++		}
++
++		/*
++		 * User may have called fts_set on the node.  If skipped,
++		 * ignore.  If followed, get a file descriptor so we can
++		 * get back if necessary.
++		 */
++		if (p->fts_instr == FTS_SKIP)
++			goto next;
++		if (p->fts_instr == FTS_FOLLOW) {
++			p->fts_info = fts_stat(sp, NULL, p, 1);
++			if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR))
++				if ((p->fts_symfd =
++				    open(".", O_RDONLY, 0)) < 0) {
++					p->fts_errno = errno;
++					p->fts_info = FTS_ERR;
++				} else
++					p->fts_flags |= FTS_SYMFOLLOW;
++			p->fts_instr = FTS_NOINSTR;
++		}
+ 
+-		if (ISDOT(p->fts_name))
+-			return (FTS_DOT);
++name:		t = sp->fts_path + NAPPEND(p->fts_parent);
++		*t++ = '/';
++		memmove(t, p->fts_name, p->fts_namelen + 1);
++		return (sp->fts_cur = p);
++	}
+ 
++	/* Move up to the parent node. */
++	p = tmp->fts_parent;
++	free(tmp);
++
++	if (p->fts_level == FTS_ROOTPARENTLEVEL) {
+ 		/*
+-		 * Cycle detection is done by brute force when the directory
+-		 * is first encountered.  If the tree gets deep enough or the
+-		 * number of symbolic links to directories is high enough,
+-		 * something faster might be worthwhile.
++		 * Done; free everything up and set errno to 0 so the user
++		 * can distinguish between error and EOF.
+ 		 */
+-		for (t = p->fts_parent;
+-		    t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
+-			if (ino == t->fts_ino && dev == t->fts_dev) {
+-				p->fts_cycle = t;
+-				return (FTS_DC);
+-			}
+-		return (FTS_D);
++		free(p);
++		errno = 0;
++		return (sp->fts_cur = NULL);
+ 	}
+-	if (S_ISLNK(sbp->st_mode))
+-		return (FTS_SL);
+-	if (S_ISREG(sbp->st_mode))
+-		return (FTS_F);
+-	return (FTS_DEFAULT);
+-}
+ 
+-static FTSENT *
+-fts_sort(sp, head, nitems)
+-	FTS *sp;
+-	FTSENT *head;
+-	register int nitems;
+-{
+-	register FTSENT **ap, *p;
++	/* Nul terminate the pathname. */
++	sp->fts_path[p->fts_pathlen] = '\0';
+ 
+ 	/*
+-	 * Construct an array of pointers to the structures and call qsort(3).
+-	 * Reassemble the array in the order returned by qsort.  If unable to
+-	 * sort for memory reasons, return the directory entries in their
+-	 * current order.  Allocate enough space for the current needs plus
+-	 * 40 so don't realloc one entry at a time.
++	 * Return to the parent directory.  If at a root node or came through
++	 * a symlink, go back through the file descriptor.  Otherwise, cd up
++	 * one directory.
+ 	 */
+-	if (nitems > sp->fts_nitems) {
+-		sp->fts_nitems = nitems + 40;
+-		if ((sp->fts_array = realloc(sp->fts_array,
+-		    (size_t)(sp->fts_nitems * sizeof(FTSENT *)))) == NULL) {
+-			sp->fts_nitems = 0;
+-			return (head);
++	if (p->fts_level == FTS_ROOTLEVEL) {
++		if (!ISSET(FTS_NOCHDIR) && FCHDIR(sp, sp->fts_rfd)) {
++			SET(FTS_STOP);
++			return (NULL);
++		}
++	} else if (p->fts_flags & FTS_SYMFOLLOW) {
++		if (FCHDIR(sp, p->fts_symfd)) {
++			saved_errno = errno;
++			(void)close(p->fts_symfd);
++			errno = saved_errno;
++			SET(FTS_STOP);
++			return (NULL);
++		}
++		(void)close(p->fts_symfd);
++	} else if (!(p->fts_flags & FTS_DONTCHDIR)) {
++		if (CHDIR(sp, "..")) {
++			SET(FTS_STOP);
++			return (NULL);
+ 		}
+ 	}
+-	for (ap = sp->fts_array, p = head; p; p = p->fts_link)
+-		*ap++ = p;
+-	qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar);
+-	for (head = *(ap = sp->fts_array); --nitems; ++ap)
+-		ap[0]->fts_link = ap[1];
+-	ap[0]->fts_link = NULL;
+-	return (head);
++	p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
++	return (sp->fts_cur = p);
+ }
+ 
+-static FTSENT *
+-fts_alloc(sp, name, namelen)
+-	FTS *sp;
+-	char *name;
+-	register int namelen;
++/*
++ * Fts_set takes the stream as an argument although it's not used in this
++ * implementation; it would be necessary if anyone wanted to add global
++ * semantics to fts using fts_set.  An error return is allowed for similar
++ * reasons.
++ */
++/* ARGSUSED */
++int
++fts_set(FTS *sp, FTSENT *p, int instr)
++{
++	if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
++	    instr != FTS_NOINSTR && instr != FTS_SKIP) {
++		errno = EINVAL;
++		return (1);
++	}
++	p->fts_instr = instr;
++	return (0);
++}
++
++FTSENT *
++fts_children(register FTS *sp, int instr)
+ {
+ 	register FTSENT *p;
+-	size_t len;
++	int fd;
++
++	if (instr && instr != FTS_NAMEONLY) {
++		errno = EINVAL;
++		return (NULL);
++	}
++
++	/* Set current node pointer. */
++	p = sp->fts_cur;
+ 
+ 	/*
+-	 * The file name is a variable length array and no stat structure is
+-	 * necessary if the user has set the nostat bit.  Allocate the FTSENT
+-	 * structure, the file name and the stat structure in one chunk, but
+-	 * be careful that the stat structure is reasonably aligned.  Since the
+-	 * fts_name field is declared to be of size 1, the fts_name pointer is
+-	 * namelen + 2 before the first possible address of the stat structure.
++	 * Errno set to 0 so user can distinguish empty directory from
++	 * an error.
+ 	 */
+-	len = sizeof(FTSENT) + namelen;
+-	if (!ISSET(FTS_NOSTAT))
+-		len += sizeof(struct stat) + ALIGNBYTES;
+-	if ((p = malloc(len)) == NULL)
++	errno = 0;
++
++	/* Fatal errors stop here. */
++	if (ISSET(FTS_STOP))
+ 		return (NULL);
+ 
+-	/* Copy the name plus the trailing NULL. */
+-	memmove(p->fts_name, name, namelen + 1);
++	/* Return logical hierarchy of user's arguments. */
++	if (p->fts_info == FTS_INIT)
++		return (p->fts_link);
+ 
+-	if (!ISSET(FTS_NOSTAT))
+-		p->fts_statp = (struct stat *)ALIGN(p->fts_name + namelen + 2);
+-	p->fts_namelen = namelen;
+-	p->fts_path = sp->fts_path;
+-	p->fts_errno = 0;
+-	p->fts_flags = 0;
+-	p->fts_instr = FTS_NOINSTR;
+-	p->fts_number = 0;
+-	p->fts_pointer = NULL;
+-	return (p);
++	/*
++	 * If not a directory being visited in pre-order, stop here.  Could
++	 * allow FTS_DNR, assuming the user has fixed the problem, but the
++	 * same effect is available with FTS_AGAIN.
++	 */
++	if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */)
++		return (NULL);
++
++	/* Free up any previous child list. */
++	if (sp->fts_child)
++		fts_lfree(sp->fts_child);
++
++	if (instr == FTS_NAMEONLY) {
++		sp->fts_options |= FTS_NAMEONLY;
++		instr = BNAMES;
++	} else
++		instr = BCHILD;
++
++	/*
++	 * If using chdir on a relative path and called BEFORE fts_read does
++	 * its chdir to the root of a traversal, we can lose -- we need to
++	 * chdir into the subdirectory, and we don't know where the current
++	 * directory is, so we can't get back so that the upcoming chdir by
++	 * fts_read will work.
++	 */
++	if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
++	    ISSET(FTS_NOCHDIR))
++		return (sp->fts_child = fts_build(sp, instr));
++
++	if ((fd = open(".", O_RDONLY, 0)) < 0)
++		return (NULL);
++	sp->fts_child = fts_build(sp, instr);
++	if (fchdir(fd))
++		return (NULL);
++	(void)close(fd);
++	return (sp->fts_child);
+ }
+ 
+-static void
+-fts_lfree(head)
+-	register FTSENT *head;
++int
++fts_close(FTS *sp)
+ {
+-	register FTSENT *p;
++	register FTSENT *freep, *p;
++	int saved_errno;
+ 
+-	/* Free a linked list of structures. */
+-	while (p = head) {
+-		head = head->fts_link;
++	/*
++	 * This still works if we haven't read anything -- the dummy structure
++	 * points to the root list, so we step through to the end of the root
++	 * list which has a valid parent pointer.
++	 */
++	if (sp->fts_cur) {
++		for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
++			freep = p;
++			p = p->fts_link ? p->fts_link : p->fts_parent;
++			free(freep);
++		}
+ 		free(p);
+ 	}
+-}
+ 
+-/*
+- * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
+- * Most systems will allow creation of paths much longer than MAXPATHLEN, even
+- * though the kernel won't resolve them.  Add the size (not just what's needed)
+- * plus 256 bytes so don't realloc the path 2 bytes at a time. 
+- */
+-static int
+-fts_palloc(sp, more)
+-	FTS *sp;
+-	size_t more;
+-{
+-	sp->fts_pathlen += more + 256;
+-	sp->fts_path = realloc(sp->fts_path, (size_t)sp->fts_pathlen);
+-	return (sp->fts_path == NULL);
+-}
++	/* Free up child linked list, sort array, path buffer. */
++	if (sp->fts_child)
++		fts_lfree(sp->fts_child);
++	if (sp->fts_array)
++		free(sp->fts_array);
++	free(sp->fts_path);
+ 
+-/*
+- * When the path is realloc'd, have to fix all of the pointers in structures
+- * already returned.
+- */
+-static void
+-fts_padjust(sp, addr)
+-	FTS *sp;
+-	void *addr;
+-{
+-	FTSENT *p;
++	/* Return to original directory, save errno if necessary. */
++	if (!ISSET(FTS_NOCHDIR)) {
++		saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
++		(void)close(sp->fts_rfd);
++	}
+ 
+-#define	ADJUST(p) {							\
+-	(p)->fts_accpath =						\
+-	    (char *)addr + ((p)->fts_accpath - (p)->fts_path);		\
+-	(p)->fts_path = addr;						\
+-}
+-	/* Adjust the current set of children. */
+-	for (p = sp->fts_child; p; p = p->fts_link)
+-		ADJUST(p);
++	/* Free up the stream pointer. */
++	free(sp);
+ 
+-	/* Adjust the rest of the tree. */
+-	for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
+-		ADJUST(p);
+-		p = p->fts_link ? p->fts_link : p->fts_parent;
++	/* Set errno and return. */
++	if (!ISSET(FTS_NOCHDIR) && saved_errno) {
++		errno = saved_errno;
++		return (-1);
+ 	}
++	return (0);
+ }
+ 
+-static size_t
+-fts_maxarglen(argv)
+-	char * const *argv;
+-{
+-	size_t len, max;
+-
+-	for (max = 0; *argv; ++argv)
+-		if ((len = strlen(*argv)) > max)
+-			max = len;
+-	return (max);
+-}
diff --git a/meta/recipes-core/fts/fts/remove_cdefs.patch b/meta/recipes-core/fts/fts/remove_cdefs.patch
new file mode 100644
index 0000000..aec1db7
--- /dev/null
+++ b/meta/recipes-core/fts/fts/remove_cdefs.patch
@@ -0,0 +1,64 @@
+Index: fts/fts.h
+===================================================================
+--- fts.orig/fts.h
++++ fts/fts.h
+@@ -126,15 +126,21 @@ typedef struct _ftsent {
+ 	char fts_name[1];		/* file name */
+ } FTSENT;
+ 
+-#include <sys/cdefs.h>
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+-__BEGIN_DECLS
+-FTSENT	*fts_children __P((FTS *, int));
+-int	 fts_close __P((FTS *));
+-FTS	*fts_open __P((char * const *, int,
+-	    int (*)(const FTSENT **, const FTSENT **)));
+-FTSENT	*fts_read __P((FTS *));
+-int	 fts_set __P((FTS *, FTSENT *, int));
+-__END_DECLS
++#ifndef __P
++#define __P
++#endif
++FTSENT	*fts_children (FTS *p, int opts);
++int	 fts_close (FTS *p);
++FTS	*fts_open (char * const * path, int opts,
++	    int (*compfn)(const FTSENT **, const FTSENT **));
++FTSENT	*fts_read (FTS *p);
++int	 fts_set (FTS *p, FTSENT *f, int opts);
+ 
++#ifdef __cplusplus
++}
++#endif
+ #endif /* !_FTS_H_ */
+Index: fts/fts.c
+===================================================================
+--- fts.orig/fts.c
++++ fts/fts.c
+@@ -50,15 +50,15 @@ static char sccsid[] = "@(#)fts.c	8.6 (B
+ #include <string.h>
+ #include <unistd.h>
+ 
+-static FTSENT	*fts_alloc __P((FTS *, char *, int));
+-static FTSENT	*fts_build __P((FTS *, int));
+-static void	 fts_lfree __P((FTSENT *));
+-static void	 fts_load __P((FTS *, FTSENT *));
+-static size_t	 fts_maxarglen __P((char * const *));
+-static void	 fts_padjust __P((FTS *, void *));
+-static int	 fts_palloc __P((FTS *, size_t));
+-static FTSENT	*fts_sort __P((FTS *, FTSENT *, int));
+-static u_short	 fts_stat __P((FTS *, struct dirent *, FTSENT *, int));
++static FTSENT	*fts_alloc __P(FTS *, char *, int);
++static FTSENT	*fts_build __P(FTS *, int);
++static void	 fts_lfree __P(FTSENT *);
++static void	 fts_load __P(FTS *, FTSENT *);
++static size_t	 fts_maxarglen __P(char * const *);
++static void	 fts_padjust __P(FTS *, void *);
++static int	 fts_palloc __P(FTS *, size_t);
++static FTSENT	*fts_sort __P(FTS *, FTSENT *, int);
++static u_short	 fts_stat __P(FTS *, struct dirent *, FTSENT *, int);
+ 
+ #define	ISDOT(a)	(a[0] == '.' && (!a[1] || a[1] == '.' && !a[2]))
+ 
diff --git a/meta/recipes-core/fts/fts/stdint.patch b/meta/recipes-core/fts/fts/stdint.patch
new file mode 100644
index 0000000..1ad7157
--- /dev/null
+++ b/meta/recipes-core/fts/fts/stdint.patch
@@ -0,0 +1,10 @@
+--- ./fts.c.orig
++++ ./fts.c
+@@ -46,6 +46,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <fts.h>
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 09/17] valgrind: Define __UCLIBC__ for uclibc based systems
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (7 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 08/17] fts: Add recipe Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-21 20:38   ` Andre McCurdy
  2015-12-19 23:52 ` [PATCH 10/17] connman: include config.h for HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR Khem Raj
                   ` (8 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

Helps configure valgrind for uclibc targets otherwise it tries to assume
funcitons that are implemented in glibc like __free_res

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/valgrind/valgrind_3.10.1.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb b/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb
index c38a07b..c1c11d4 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb
@@ -44,6 +44,8 @@ EXTRA_OECONF_armv7a = "--enable-tls -host=armv7-none-linux-gnueabi --without-mpi
 EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS', True) != '32']}"
 EXTRA_OEMAKE = "-w"
 
+CFLAGS_append_libc-uclibc = " -D__UCLIBC__ "
+
 do_install_append () {
     install -m 644 ${B}/default.supp ${D}/${libdir}/valgrind/
 }
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 10/17] connman: include config.h for HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (8 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 09/17] valgrind: Define __UCLIBC__ for uclibc based systems Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2016-01-08 10:08   ` Burton, Ross
  2015-12-19 23:52 ` [PATCH 11/17] libcgroup: Add dependency on fts when building on musl Khem Raj
                   ` (7 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

We now check at configure time of libc has pktinfo struct

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../0003-Fix-header-inclusions-for-musl.patch      | 79 +++++++++++++++-------
 1 file changed, 56 insertions(+), 23 deletions(-)

diff --git a/meta/recipes-connectivity/connman/connman/0003-Fix-header-inclusions-for-musl.patch b/meta/recipes-connectivity/connman/connman/0003-Fix-header-inclusions-for-musl.patch
index 6327aa2..eefc683 100644
--- a/meta/recipes-connectivity/connman/connman/0003-Fix-header-inclusions-for-musl.patch
+++ b/meta/recipes-connectivity/connman/connman/0003-Fix-header-inclusions-for-musl.patch
@@ -14,10 +14,10 @@ Upstream-Status: Pending
  tools/dnsproxy-test.c | 1 +
  5 files changed, 3 insertions(+), 5 deletions(-)
 
-diff --git a/gweb/gresolv.c b/gweb/gresolv.c
-index 3ad8e70..61d6fe8 100644
---- a/gweb/gresolv.c
-+++ b/gweb/gresolv.c
+Index: connman-1.30/gweb/gresolv.c
+===================================================================
+--- connman-1.30.orig/gweb/gresolv.c
++++ connman-1.30/gweb/gresolv.c
 @@ -28,6 +28,7 @@
  #include <stdarg.h>
  #include <string.h>
@@ -26,10 +26,10 @@ index 3ad8e70..61d6fe8 100644
  #include <resolv.h>
  #include <sys/types.h>
  #include <sys/socket.h>
-diff --git a/plugins/wifi.c b/plugins/wifi.c
-index dfe849f..99cff3f 100644
---- a/plugins/wifi.c
-+++ b/plugins/wifi.c
+Index: connman-1.30/plugins/wifi.c
+===================================================================
+--- connman-1.30.orig/plugins/wifi.c
++++ connman-1.30/plugins/wifi.c
 @@ -30,9 +30,8 @@
  #include <string.h>
  #include <sys/ioctl.h>
@@ -41,10 +41,10 @@ index dfe849f..99cff3f 100644
  
  #ifndef IFF_LOWER_UP
  #define IFF_LOWER_UP	0x10000
-diff --git a/src/tethering.c b/src/tethering.c
-index ceeec74..c44cb36 100644
---- a/src/tethering.c
-+++ b/src/tethering.c
+Index: connman-1.30/src/tethering.c
+===================================================================
+--- connman-1.30.orig/src/tethering.c
++++ connman-1.30/src/tethering.c
 @@ -31,10 +31,8 @@
  #include <stdio.h>
  #include <sys/ioctl.h>
@@ -56,10 +56,10 @@ index ceeec74..c44cb36 100644
  #include <netinet/in.h>
  #include <linux/if_bridge.h>
  
-diff --git a/tools/dhcp-test.c b/tools/dhcp-test.c
-index c34e10a..eae66fc 100644
---- a/tools/dhcp-test.c
-+++ b/tools/dhcp-test.c
+Index: connman-1.30/tools/dhcp-test.c
+===================================================================
+--- connman-1.30.orig/tools/dhcp-test.c
++++ connman-1.30/tools/dhcp-test.c
 @@ -33,7 +33,6 @@
  #include <arpa/inet.h>
  #include <net/route.h>
@@ -68,10 +68,10 @@ index c34e10a..eae66fc 100644
  
  #include <gdhcp/gdhcp.h>
  
-diff --git a/tools/dnsproxy-test.c b/tools/dnsproxy-test.c
-index 551cae9..226ba86 100644
---- a/tools/dnsproxy-test.c
-+++ b/tools/dnsproxy-test.c
+Index: connman-1.30/tools/dnsproxy-test.c
+===================================================================
+--- connman-1.30.orig/tools/dnsproxy-test.c
++++ connman-1.30/tools/dnsproxy-test.c
 @@ -27,6 +27,7 @@
  #include <stdlib.h>
  #include <string.h>
@@ -80,6 +80,39 @@ index 551cae9..226ba86 100644
  #include <arpa/inet.h>
  #include <netinet/in.h>
  #include <sys/types.h>
--- 
-2.5.1
-
+Index: connman-1.30/configure.ac
+===================================================================
+--- connman-1.30.orig/configure.ac
++++ connman-1.30/configure.ac
+@@ -173,6 +173,8 @@ AM_CONDITIONAL(PPTP_BUILTIN, test "${ena
+ 
+ AC_CHECK_HEADERS([execinfo.h])
+ 
++AC_CHECK_MEMBERS([struct in6_pktinfo.ipi6_addr], [], [], [[#include <netinet/in.h>]])
++
+ AC_CHECK_HEADERS(resolv.h, dummy=yes,
+ 	AC_MSG_ERROR(resolver header files are required))
+ AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
+Index: connman-1.30/gdhcp/common.h
+===================================================================
+--- connman-1.30.orig/gdhcp/common.h
++++ connman-1.30/gdhcp/common.h
+@@ -19,6 +19,7 @@
+  *
+  */
+ 
++#include <config.h>
+ #include <netinet/udp.h>
+ #include <netinet/ip.h>
+ 
+@@ -170,8 +171,8 @@ static const uint8_t dhcp_option_lengths
+ 	[OPTION_U32]	= 4,
+ };
+ 
+-/* already defined within netinet/in.h if using GNU compiler */
+-#ifndef __USE_GNU
++/* already defined within netinet/in.h if using GNU or musl libc */
++#ifndef HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR
+ struct in6_pktinfo {
+ 	struct in6_addr ipi6_addr;  /* src/dst IPv6 address */
+ 	unsigned int ipi6_ifindex;  /* send/recv interface index */
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 11/17] libcgroup: Add dependency on fts when building on musl
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (9 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 10/17] connman: include config.h for HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-19 23:52 ` [PATCH 12/17] linux-libc-headers: Port patches for linux-headers for musl Khem Raj
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../libcgroup/libcgroup/musl-decls-compat.patch    | 235 +++++++++++++++++++++
 meta/recipes-core/libcgroup/libcgroup_0.41.bb      |   4 +
 2 files changed, 239 insertions(+)
 create mode 100644 meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch

diff --git a/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch b/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
new file mode 100644
index 0000000..65f4ef9
--- /dev/null
+++ b/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
@@ -0,0 +1,235 @@
+commit ca780b4f7f71abeeb04a585f2a4d889caaa985fa
+Author: Isaac Dunham <ibid.ag@gmail.com>
+Date:   Fri Sep 5 22:35:32 2014 -0700
+
+    Remove __.*DECLS nonsense
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libcgroup-0.41/include/libcgroup/config.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/config.h
++++ libcgroup-0.41/include/libcgroup/config.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /**
+  * @defgroup group_config 5. Configuration
+@@ -107,6 +109,8 @@ int cgroup_config_create_template_group(
+  * @}
+  * @}
+  */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /*_LIBCGROUP_CONFIG_H*/
+Index: libcgroup-0.41/include/libcgroup/error.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/error.h
++++ libcgroup-0.41/include/libcgroup/error.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /**
+  * @defgroup group_errors 6. Error handling
+@@ -99,6 +101,8 @@ int cgroup_get_last_errno(void);
+  * @}
+  * @}
+  */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _LIBCGROUP_INIT_H */
+Index: libcgroup-0.41/include/libcgroup/groups.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/groups.h
++++ libcgroup-0.41/include/libcgroup/groups.h
+@@ -11,7 +11,9 @@
+ #include <stdbool.h>
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /**
+  * Flags for cgroup_delete_cgroup_ext().
+@@ -577,6 +579,8 @@ char *cgroup_get_cgroup_name(struct cgro
+  */
+ 
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _LIBCGROUP_GROUPS_H */
+Index: libcgroup-0.41/include/libcgroup/init.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/init.h
++++ libcgroup-0.41/include/libcgroup/init.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /**
+  * @defgroup group_init 1. Initialization
+@@ -58,6 +60,8 @@ int cgroup_get_subsys_mount_point(const
+  * @}
+  * @}
+  */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _LIBCGROUP_INIT_H */
+Index: libcgroup-0.41/include/libcgroup/iterators.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/iterators.h
++++ libcgroup-0.41/include/libcgroup/iterators.h
+@@ -11,7 +11,9 @@
+ #include <features.h>
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /**
+  * @defgroup group_iterators 3. Iterators
+@@ -423,6 +425,8 @@ int cgroup_get_subsys_mount_point_end(vo
+  * @}
+  */
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _LIBCGROUP_ITERATORS_H */
+Index: libcgroup-0.41/include/libcgroup/tasks.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/tasks.h
++++ libcgroup-0.41/include/libcgroup/tasks.h
+@@ -12,7 +12,9 @@
+ #include <stdbool.h>
+ #endif
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /** Flags for cgroup_change_cgroup_uid_gid(). */
+ enum cgflags {
+@@ -204,6 +206,8 @@ int cgroup_register_unchanged_process(pi
+  * @}
+  * @}
+  */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _LIBCGROUP_TASKS_H */
+Index: libcgroup-0.41/src/daemon/cgrulesengd.h
+===================================================================
+--- libcgroup-0.41.orig/src/daemon/cgrulesengd.h
++++ libcgroup-0.41/src/daemon/cgrulesengd.h
+@@ -17,7 +17,9 @@
+ 
+ #include <features.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ #include "config.h"
+ #include "libcgroup.h"
+@@ -119,7 +121,9 @@ void cgre_flash_templates(int signum);
+  */
+ void cgre_catch_term(int signum);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _CGRULESENGD_H */
+ 
+Index: libcgroup-0.41/src/libcgroup-internal.h
+===================================================================
+--- libcgroup-0.41.orig/src/libcgroup-internal.h
++++ libcgroup-0.41/src/libcgroup-internal.h
+@@ -16,7 +16,9 @@
+ 
+ #define __LIBCG_INTERNAL
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ #include "config.h"
+ #include <fts.h>
+@@ -279,6 +281,8 @@ extern void cgroup_dictionary_iterator_e
+  */
+ int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif
+Index: libcgroup-0.41/include/libcgroup/log.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/log.h
++++ libcgroup-0.41/include/libcgroup/log.h
+@@ -11,7 +11,9 @@
+ 
+ #include <stdarg.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /**
+  * @defgroup group_log 7. Logging
+@@ -142,6 +144,8 @@ extern int cgroup_parse_log_level_str(co
+  * @}
+  * @}
+  */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* _LIBCGROUP_LOG_H */
diff --git a/meta/recipes-core/libcgroup/libcgroup_0.41.bb b/meta/recipes-core/libcgroup/libcgroup_0.41.bb
index 287aecd..9597963 100644
--- a/meta/recipes-core/libcgroup/libcgroup_0.41.bb
+++ b/meta/recipes-core/libcgroup/libcgroup_0.41.bb
@@ -11,12 +11,16 @@ inherit autotools pkgconfig
 DEPENDS = "bison-native flex-native ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/libcg/${BPN}/v0.41/${BPN}-${PV}.tar.bz2"
+SRC_URI_append_libc-musl = " file://musl-decls-compat.patch"
 
 SRC_URI[md5sum] = "3dea9d50b8a5b73ff0bf1cdcb210f63f"
 SRC_URI[sha256sum] = "e4e38bdc7ef70645ce33740ddcca051248d56b53283c0dc6d404e17706f6fb51"
 
 UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libcg/files/libcgroup/"
 
+DEPENDS_append_libc-musl = " fts "
+EXTRA_OEMAKE_append_libc-musl = "LIBS=-lfts"
+
 EXTRA_OECONF = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes', '--enable-pam=no', d)}"
 
 PACKAGES =+ "cgroups-pam-plugin"
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 12/17] linux-libc-headers: Port patches for linux-headers for musl
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (10 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 11/17] libcgroup: Add dependency on fts when building on musl Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-19 23:52 ` [PATCH 13/17] xserver-xorg: Fix build with musl Khem Raj
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

These patches have revealed issues with linux kernel headers which has
been proposed upstream but hasnt been applied yet

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...mpat.h-fix-some-issues-arising-from-in6.h.patch | 81 ++++++++++++++++++++++
 ...t.h-prevent-redefinition-of-struct-ethhdr.patch | 58 ++++++++++++++++
 ...remove-inclusion-of-sysinfo.h-in-kernel.h.patch | 31 +++++++++
 .../linux-libc-headers/linux-libc-headers_4.1.bb   |  5 ++
 4 files changed, 175 insertions(+)
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch

diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
new file mode 100644
index 0000000..2145ea6
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
@@ -0,0 +1,81 @@
+From 2872f5d8bcef84e62b15b37ba4ffeccfb6402dad Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Wed, 22 Jan 2014 00:48:28 +0100
+Subject: [PATCH 1/3] libc-compat.h: fix some issues arising from in6.h
+
+namely redefinition of some structs provided by netinet/in.h.
+---
+Upstream-Status: Submitted
+
+ include/uapi/linux/libc-compat.h | 25 ++++++++-----------------
+ 1 file changed, 8 insertions(+), 17 deletions(-)
+
+diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
+index fa673e9..afe15c2 100644
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -48,24 +48,15 @@
+ #ifndef _UAPI_LIBC_COMPAT_H
+ #define _UAPI_LIBC_COMPAT_H
+ 
+-/* We have included glibc headers... */
+-#if defined(__GLIBC__)
++#ifndef __KERNEL__ /* we're used from userspace */
+ 
+-/* Coordinate with glibc netinet/in.h header. */
++/* Coordinate with libc netinet/in.h header. */
+ #if defined(_NETINET_IN_H)
+ 
+-/* GLIBC headers included first so don't define anything
++/* libc 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
+@@ -73,13 +64,13 @@
+ #define __UAPI_DEF_IN6_PKTINFO		0
+ #define __UAPI_DEF_IP6_MTUINFO		0
+ 
+-#else
++#else /* defined(_NETINET_IN_H) */
+ 
+ /* Linux headers included first, and we must define everything
+- * we need. The expectation is that glibc will check the
++ * we need. The expectation is that the libc will check the
+  * __UAPI_DEF_* defines and adjust appropriately. */
+ #define __UAPI_DEF_IN6_ADDR		1
+-/* We unconditionally define the in6_addr macros and glibc must
++/* We unconditionally define the in6_addr macros and libc must
+  * coordinate. */
+ #define __UAPI_DEF_IN6_ADDR_ALT		1
+ #define __UAPI_DEF_SOCKADDR_IN6		1
+@@ -101,7 +92,7 @@
+ /* If we did not see any headers from any supported C libraries,
+  * or we are being included in the kernel, then define everything
+  * that we need. */
+-#else /* !defined(__GLIBC__) */
++#else /* __KERNEL__ */
+ 
+ /* Definitions for in6.h */
+ #define __UAPI_DEF_IN6_ADDR		1
+@@ -116,6 +107,6 @@
+ /* Definitions for xattr.h */
+ #define __UAPI_DEF_XATTR		1
+ 
+-#endif /* __GLIBC__ */
++#endif /* __KERNEL__ */
+ 
+ #endif /* _UAPI_LIBC_COMPAT_H */
+-- 
+2.6.4
+
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
new file mode 100644
index 0000000..d04761b
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
@@ -0,0 +1,58 @@
+From 75ba4a547282f91d653872a4bba5f5eae234ea6c Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Wed, 22 Jan 2014 00:57:48 +0100
+Subject: [PATCH 2/3] libc-compat.h: prevent redefinition of struct ethhdr
+
+---
+Upstream-Status: Submitted
+
+ include/uapi/linux/if_ether.h    | 4 +++-
+ include/uapi/linux/libc-compat.h | 6 ++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
+index aa63ed0..e94da57 100644
+--- a/include/uapi/linux/if_ether.h
++++ b/include/uapi/linux/if_ether.h
+@@ -22,6 +22,7 @@
+ #define _UAPI_LINUX_IF_ETHER_H
+ 
+ #include <linux/types.h>
++#include <linux/libc-compat.h>
+ 
+ /*
+  *	IEEE 802.3 Ethernet magic constants.  The frame sizes omit the preamble
+@@ -134,11 +135,12 @@
+  *	This is an Ethernet frame header.
+  */
+ 
++#if __UAPI_DEF_ETHHDR
+ struct ethhdr {
+ 	unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
+ 	unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
+ 	__be16		h_proto;		/* packet type ID field	*/
+ } __attribute__((packed));
+-
++#endif
+ 
+ #endif /* _UAPI_LINUX_IF_ETHER_H */
+diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
+index afe15c2..7d0c78a 100644
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -50,6 +50,12 @@
+ 
+ #ifndef __KERNEL__ /* we're used from userspace */
+ 
++#ifdef _NETINET_IF_ETHER_H /* musl */
++#define __UAPI_DEF_ETHHDR 0
++#else /* glibc uses __NETINET_IF_ETHER_H, and includes the kernel header. */
++#define __UAPI_DEF_ETHHDR 1
++#endif
++
+ /* Coordinate with libc netinet/in.h header. */
+ #if defined(_NETINET_IN_H)
+ 
+-- 
+2.6.4
+
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
new file mode 100644
index 0000000..3549f36
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
@@ -0,0 +1,31 @@
+From 8e69b663d6ddef132041a1186f081fdd74d4a31d Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Mon, 20 Jan 2014 21:31:34 +0100
+Subject: [PATCH 3/3] remove inclusion of sysinfo.h in kernel.h
+
+the declaration of struct sysinfo clashes with userspace.
+it's not quite clear why that header was included from kernel.h,
+as none of its functionality is needed.
+---
+Upstream-Status: Submitted
+
+ include/uapi/linux/kernel.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h
+index 321e399..e8ff821 100644
+--- a/include/uapi/linux/kernel.h
++++ b/include/uapi/linux/kernel.h
+@@ -1,7 +1,9 @@
+ #ifndef _UAPI_LINUX_KERNEL_H
+ #define _UAPI_LINUX_KERNEL_H
+ 
++#ifdef __GLIBC__
+ #include <linux/sysinfo.h>
++#endif
+ 
+ /*
+  * 'kernel.h' contains some often-used function prototypes etc
+-- 
+2.6.4
+
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.1.bb b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.1.bb
index 01037c1..6f2c427 100644
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.1.bb
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.1.bb
@@ -1,4 +1,9 @@
 require linux-libc-headers.inc
 
+SRC_URI_append_libc-musl = "\
+    file://0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch \
+    file://0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch \
+    file://0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch \
+   "
 SRC_URI[md5sum] = "fe9dc0f6729f36400ea81aa41d614c37"
 SRC_URI[sha256sum] = "caf51f085aac1e1cea4d00dbbf3093ead07b551fc07b31b2a989c05f8ea72d9f"
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 13/17] xserver-xorg: Fix build with musl
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (11 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 12/17] linux-libc-headers: Port patches for linux-headers for musl Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2016-01-08 10:10   ` Burton, Ross
  2015-12-19 23:52 ` [PATCH 14/17] gdk-pixbuf: Fix latent build issue exposed by musl Khem Raj
                   ` (4 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

inb/outb are implemented for ARM on glibc but not on linux in general
therefore the conditional has to reflect that

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch  | 18 ++++++++++++++++++
 .../xorg-xserver/xserver-xorg_1.18.0.bb                |  4 +++-
 2 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch

diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch b/meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch
new file mode 100644
index 0000000..4be441f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch
@@ -0,0 +1,18 @@
+inb/outb family for arm is only implemented on glibc
+so assumption across linux is wrong
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: xorg-server-1.18.0/hw/xfree86/common/compiler.h
+===================================================================
+--- xorg-server-1.18.0.orig/hw/xfree86/common/compiler.h
++++ xorg-server-1.18.0/hw/xfree86/common/compiler.h
+@@ -758,7 +758,7 @@ inl(unsigned short port)
+     return xf86ReadMmio32Le((void *) ioBase, port);
+ }
+ 
+-#elif defined(__arm__) && defined(__linux__)
++#elif defined(__arm__) && defined(__GLIBC__)
+ 
+ /* for Linux on ARM, we use the LIBC inx/outx routines */
+ /* note that the appropriate setup via "ioperm" needs to be done */
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.18.0.bb b/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.18.0.bb
index 60973c5..e606dac 100644
--- a/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.18.0.bb
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.18.0.bb
@@ -1,6 +1,8 @@
 require xserver-xorg.inc
 
-SRC_URI += "file://configure.ac-Use-libsystemd-in-REQUIRED_LIBS-check.patch"
+SRC_URI += "file://configure.ac-Use-libsystemd-in-REQUIRED_LIBS-check.patch \
+            file://musl-arm-inb-outb.patch \
+           "
 SRC_URI[md5sum] = "3c1c1057d3ad27380d8dd87ffcc182cd"
 SRC_URI[sha256sum] = "195670819695d9cedd8dde95fbe069be0d0f488a77797a2d409f9f702daf312e"
 
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 14/17] gdk-pixbuf: Fix latent build issue exposed by musl
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (12 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 13/17] xserver-xorg: Fix build with musl Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-19 23:52 ` [PATCH 15/17] argp-standalone: Add recipe Khem Raj
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../gdk-pixbuf/gdk-pixbuf/libc_memfuncs.patch      | 25 ++++++++++++++++++++++
 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.1.bb |  1 +
 2 files changed, 26 insertions(+)
 create mode 100644 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/libc_memfuncs.patch

diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/libc_memfuncs.patch b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/libc_memfuncs.patch
new file mode 100644
index 0000000..706debf
--- /dev/null
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/libc_memfuncs.patch
@@ -0,0 +1,25 @@
+__libc_malloc and family of functions are in glibc but not in musl e.g. so mark them as such
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: gdk-pixbuf-2.32.1/tests/pixbuf-lowmem.c
+===================================================================
+--- gdk-pixbuf-2.32.1.orig/tests/pixbuf-lowmem.c
++++ gdk-pixbuf-2.32.1/tests/pixbuf-lowmem.c
+@@ -33,9 +33,15 @@ static int max_allocation = PRETEND_MEM_
+ 
+ #define HEADER_SPACE sizeof(gsize)
+ 
++#ifdef __GLIBC__
+ extern void *__libc_malloc (size_t size);
+ extern void *__libc_realloc (void *mem, size_t size);
+ extern void *__libc_free (void *mem);
++#else
++#define __libc_malloc  malloc
++#define __libc_realloc realloc
++#define __libc_free free
++#endif
+ 
+ static gpointer
+ record_bytes (gpointer mem, gsize bytes)
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.1.bb b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.1.bb
index 084fe36..104c743 100644
--- a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.1.bb
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.1.bb
@@ -17,6 +17,7 @@ SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
            file://extending-libinstall-dependencies.patch \
            file://run-ptest \
            file://fatal-loader.patch \
+           file://libc_memfuncs.patch \
            "
 
 SRC_URI[md5sum] = "b1590189a2e89fab9f871959c168508c"
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 15/17] argp-standalone: Add recipe
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (13 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 14/17] gdk-pixbuf: Fix latent build issue exposed by musl Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-19 23:52 ` [PATCH 16/17] gnutls: Link with libargp on musl and depend on argp-standalone Khem Raj
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

This helps packages like gnutls to compile with musl
any package that needs glibc's implementation of argp
can link to this library

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../argp-standalone/argp-standalone_1.3.bb         | 28 ++++++++
 .../files/0001-throw-in-funcdef.patch              | 84 ++++++++++++++++++++++
 .../argp-standalone/files/0002-isprint.patch       | 51 +++++++++++++
 3 files changed, 163 insertions(+)
 create mode 100644 meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
 create mode 100644 meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch
 create mode 100644 meta/recipes-support/argp-standalone/files/0002-isprint.patch

diff --git a/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb b/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
new file mode 100644
index 0000000..a5d20d3
--- /dev/null
+++ b/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
@@ -0,0 +1,28 @@
+# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Glibc hierarchical argument parsing standalone library"
+HOMEPAGE = "http://www.lysator.liu.se/~nisse/misc/"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://argp.h;beginline=1;endline=20;md5=008b7e53dea6f9e1d9fdef0d9cf3184a"
+SECTION = "libs"
+
+SRC_URI = "http://www.lysator.liu.se/~nisse/misc/argp-standalone-${PV}.tar.gz \
+           file://0001-throw-in-funcdef.patch \
+           file://0002-isprint.patch \
+          "
+SRC_URI[md5sum] = "720704bac078d067111b32444e24ba69"
+SRC_URI[sha256sum] = "dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be"
+
+inherit autotools
+
+CFLAGS += "-fPIC -U__OPTIMIZE__"
+
+do_install() {
+	install -D -m 0644 ${B}/libargp.a ${D}${libdir}/libargp.a
+	install -D -m 0644 ${S}/argp.h ${D}${includedir}/argp.h
+}
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
diff --git a/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch b/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch
new file mode 100644
index 0000000..a6e2759
--- /dev/null
+++ b/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch
@@ -0,0 +1,84 @@
+# --- T2-COPYRIGHT-NOTE-BEGIN ---
+# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
+# 
+# T2 SDE: package/.../rng-tools/throw-in-funcdef.patch.argp-standalone
+# Copyright (C) 2006 The T2 SDE Project
+# 
+# More information can be found in the files COPYING and README.
+# 
+# This patch file is dual-licensed. It is available under the license the
+# patched project is licensed under, as long as it is an OpenSource license
+# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
+# of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+# --- T2-COPYRIGHT-NOTE-END ---
+
+
+No __THROW in function implementation.
+	--jsaw
+
+Taken from buildroot
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- argp-standalone-1.4-test2/argp.h.orig	2006-01-06 02:29:59.000000000 +0100
++++ argp-standalone-1.4-test2/argp.h	2006-01-06 02:41:10.000000000 +0100
+@@ -560,17 +560,17 @@
+ # endif
+ 
+ # ifndef ARGP_EI
+-#  define ARGP_EI extern __inline__
++#  define ARGP_EI extern inline
+ # endif
+ 
+ ARGP_EI void
+-__argp_usage (__const struct argp_state *__state) __THROW
++__argp_usage (__const struct argp_state *__state)
+ {
+   __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+ }
+ 
+ ARGP_EI int
+-__option_is_short (__const struct argp_option *__opt) __THROW
++__option_is_short (__const struct argp_option *__opt)
+ {
+   if (__opt->flags & OPTION_DOC)
+     return 0;
+@@ -582,7 +582,7 @@
+ }
+ 
+ ARGP_EI int
+-__option_is_end (__const struct argp_option *__opt) __THROW
++__option_is_end (__const struct argp_option *__opt)
+ {
+   return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+ }
+--- argp-standalone-1.4-test2/argp-parse.c.orig	2006-01-06 02:47:48.000000000 +0100
++++ argp-standalone-1.4-test2/argp-parse.c	2006-01-06 02:48:16.000000000 +0100
+@@ -1290,13 +1290,13 @@
+ /* Defined here, in case a user is not inlining the definitions in
+  * argp.h */
+ void
+-__argp_usage (__const struct argp_state *__state) __THROW
++__argp_usage (__const struct argp_state *__state)
+ {
+   __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+ }
+ 
+ int
+-__option_is_short (__const struct argp_option *__opt) __THROW
++__option_is_short (__const struct argp_option *__opt) 
+ {
+   if (__opt->flags & OPTION_DOC)
+     return 0;
+@@ -1310,7 +1310,7 @@
+ }
+ 
+ int
+-__option_is_end (__const struct argp_option *__opt) __THROW
++__option_is_end (__const struct argp_option *__opt) 
+ {
+   return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+ }
diff --git a/meta/recipes-support/argp-standalone/files/0002-isprint.patch b/meta/recipes-support/argp-standalone/files/0002-isprint.patch
new file mode 100644
index 0000000..1c07eea
--- /dev/null
+++ b/meta/recipes-support/argp-standalone/files/0002-isprint.patch
@@ -0,0 +1,51 @@
+Subject: restrict value range passed to isprint function
+
+According to C standards isprint argument shall be representable as an
+unsigned char or be equal to EOF, otherwise the behaviour is undefined.
+
+Passing arbitrary ints leads to segfault in nm program from elfutils.
+
+Restrict isprint argument range to values representable by unsigned char.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+
+Taken from buildroot
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+Index: b/argp.h
+===================================================================
+--- a/argp.h
++++ b/argp.h
+@@ -23,6 +23,7 @@
+ 
+ #include <stdio.h>
+ #include <ctype.h>
++#include <limits.h>
+ 
+ #define __need_error_t
+ #include <errno.h>
+@@ -577,7 +578,7 @@
+   else
+     {
+       int __key = __opt->key;
+-      return __key > 0 && isprint (__key);
++      return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+     }
+ }
+ 
+Index: b/argp-parse.c
+===================================================================
+--- a/argp-parse.c
++++ b/argp-parse.c
+@@ -1292,7 +1292,7 @@
+       int __key = __opt->key;
+       /* FIXME: whether or not a particular key implies a short option
+        * ought not to be locale dependent. */
+-      return __key > 0 && isprint (__key);
++      return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+     }
+ }
+ 
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 16/17] gnutls: Link with libargp on musl and depend on argp-standalone
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (14 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 15/17] argp-standalone: Add recipe Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2015-12-19 23:52 ` [PATCH 17/17] util-linux: Fix ptest builds on musl Khem Raj
  2016-01-07 15:32 ` [PATCH 00/17] musl fixes phase 2 Burton, Ross
  17 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-support/gnutls/gnutls.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-support/gnutls/gnutls.inc b/meta/recipes-support/gnutls/gnutls.inc
index c1ec120..5bcfc9c 100644
--- a/meta/recipes-support/gnutls/gnutls.inc
+++ b/meta/recipes-support/gnutls/gnutls.inc
@@ -2,6 +2,7 @@ SUMMARY = "GNU Transport Layer Security Library"
 HOMEPAGE = "http://www.gnu.org/software/gnutls/"
 BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls"
 DEPENDS = "nettle libidn"
+DEPENDS_append_libc-musl = " argp-standalone "
 
 LICENSE = "GPLv3+ & LGPLv2.1+"
 LICENSE_${PN} = "LGPLv2.1+"
@@ -28,6 +29,7 @@ EXTRA_OECONF="--disable-rpath \
               --without-p11-kit \
               --enable-openssl-compatibility \
               "
+LDFLAGS_append_libc-musl = " -largp "
 
 do_configure_prepend() {
 	for dir in . lib; do
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH 17/17] util-linux: Fix ptest builds on musl
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (15 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 16/17] gnutls: Link with libargp on musl and depend on argp-standalone Khem Raj
@ 2015-12-19 23:52 ` Khem Raj
  2016-01-07 15:32 ` [PATCH 00/17] musl fixes phase 2 Burton, Ross
  17 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2015-12-19 23:52 UTC (permalink / raw)
  To: openembedded-core

musl doesnt implement error() API, hence provide one

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../util-linux/uuid-test-error-api.patch           | 92 ++++++++++++++++++++++
 meta/recipes-core/util-linux/util-linux_2.27.1.bb  |  1 +
 2 files changed, 93 insertions(+)
 create mode 100644 meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch

diff --git a/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch b/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch
new file mode 100644
index 0000000..1b0ff79
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch
@@ -0,0 +1,92 @@
+This patch adds error() API implementation for non-glibc system C libs
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: util-linux-2.27.1/tests/helpers/test_uuidd.c
+===================================================================
+--- util-linux-2.27.1.orig/tests/helpers/test_uuidd.c
++++ util-linux-2.27.1/tests/helpers/test_uuidd.c
+@@ -23,7 +23,6 @@
+  *
+  *	make uuidd uuidgen localstatedir=/var
+  */
+-#include <error.h>
+ #include <libgen.h>
+ #include <pthread.h>
+ #include <stdio.h>
+@@ -39,6 +38,17 @@
+ #include "xalloc.h"
+ #include "strutils.h"
+ 
++#ifdef __GLIBC__
++#include <error.h>
++#else
++extern void (*error_print_progname)(void);
++extern unsigned int error_message_count;
++extern int error_one_per_line;
++
++void error(int, int, const char *, ...);
++void error_at_line(int, int, const char *, unsigned int, const char *, ...);
++#endif
++
+ #define LOG(level,args) if (loglev >= level) { fprintf args; }
+ 
+ size_t nprocesses = 4;
+@@ -257,6 +267,56 @@ static void object_dump(size_t idx, obje
+ 	fprintf(stderr, "}\n");
+ }
+ 
++#ifndef __GLIBC__
++extern char *__progname;
++
++void (*error_print_progname)(void) = 0;
++unsigned int error_message_count = 0;
++int error_one_per_line = 0;
++
++static void eprint(int status, int e, const char *file, unsigned int line, const char *fmt, va_list ap)
++{
++	if (file && error_one_per_line) {
++		static const char *oldfile;
++		static unsigned int oldline;
++		if (line == oldline && strcmp(file, oldfile) == 0)
++			return;
++		oldfile = file;
++		oldline = line;
++	}
++	if (error_print_progname)
++		error_print_progname();
++	else
++		fprintf(stderr, "%s: ", __progname);
++	if (file)
++		fprintf(stderr, "%s:%u: ", file, line);
++	vfprintf(stderr, fmt, ap);
++	if (e)
++		fprintf(stderr, ": %s", strerror(e));
++	putc('\n', stderr);
++	fflush(stderr);
++	error_message_count++;
++	if (status)
++		exit(status);
++}
++
++void error(int status, int e, const char *fmt, ...)
++{
++	va_list ap;
++	va_start(ap,fmt);
++	eprint(status, e, 0, 0, fmt, ap);
++	va_end(ap);
++}
++
++void error_at_line(int status, int e, const char *file, unsigned int line, const char *fmt, ...)
++{
++	va_list ap;
++	va_start(ap,fmt);
++	eprint(status, e, file, line, fmt, ap);
++	va_end(ap);
++}
++#endif /* __GLIBC__ */
++
+ int main(int argc, char *argv[])
+ {
+ 	size_t i, nfailed = 0, nignored = 0;
diff --git a/meta/recipes-core/util-linux/util-linux_2.27.1.bb b/meta/recipes-core/util-linux/util-linux_2.27.1.bb
index 14a77ca..7549158 100644
--- a/meta/recipes-core/util-linux/util-linux_2.27.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.27.1.bb
@@ -19,6 +19,7 @@ SRC_URI += "file://util-linux-ng-2.16-mount_lock_path.patch \
             file://avoid_unsupported_grep_opts.patch \
             file://display_testname_for_subtest.patch \
             file://avoid_parallel_tests.patch \
+            file://uuid-test-error-api.patch \
 "
 SRC_URI[md5sum] = "3cd2698d1363a2c64091c2dadc974647"
 SRC_URI[sha256sum] = "0a818fcdede99aec43ffe6ca5b5388bff80d162f2f7bd4541dca94fecb87a290"
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH 01/17] powertop: Include right headers for timval struct
  2015-12-19 23:52 ` [PATCH 01/17] powertop: Include right headers for timval struct Khem Raj
@ 2015-12-21 12:11   ` Burton, Ross
  0 siblings, 0 replies; 35+ messages in thread
From: Burton, Ross @ 2015-12-21 12:11 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 723 bytes --]

On 19 December 2015 at 23:52, Khem Raj <raj.khem@gmail.com> wrote:

> +From 0856d8145d187a7e5a49625247abe43a13f95acc Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Tue, 15 Sep 2015 19:36:28 +0000
> +Subject: [PATCH] include rquired headers for typedefs
> +
> +timeval struct needs to include sys/time.h and sprintf() usage requires
> +to include stdio.h headers from system
> +
> +Fixes
> +src/perf/perf_bundle.cpp:141:2: error: use of undeclared identifier
> 'sprintf'; did you mean 'vswprintf'?
> +src/devices/devfreq.h:35:18: error: field has incomplete type 'struct
> timeval'
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +---
>

Missing upstream-status.

Ross

[-- Attachment #2: Type: text/html, Size: 1260 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 02/17] dhcp: Include sys/types.h for u_int* defs
  2015-12-19 23:52 ` [PATCH 02/17] dhcp: Include sys/types.h for u_int* defs Khem Raj
@ 2015-12-21 12:11   ` Burton, Ross
  0 siblings, 0 replies; 35+ messages in thread
From: Burton, Ross @ 2015-12-21 12:11 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

On 19 December 2015 at 23:52, Khem Raj <raj.khem@gmail.com> wrote:

> +From 971491b6d7ab47d2f92f34269a129d0347fba15a Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Mon, 14 Sep 2015 23:51:38 +0000
> +Subject: [PATCH] include missing sys/types.h
> +
> +Code uses plain typedefs defines in this header but does not include it
> +Fixes
> +
> +error: unknown type name 'u_int16_t'; did you mean 'uint16_t'?
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>

Missing Upstream-Status.

Ross

[-- Attachment #2: Type: text/html, Size: 1061 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 03/17] blktrace: Include <sys/types.h for dev_t
  2015-12-19 23:52 ` [PATCH 03/17] blktrace: Include <sys/types.h for dev_t Khem Raj
@ 2015-12-21 12:12   ` Burton, Ross
  0 siblings, 0 replies; 35+ messages in thread
From: Burton, Ross @ 2015-12-21 12:12 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]

On 19 December 2015 at 23:52, Khem Raj <raj.khem@gmail.com> wrote:

> +Status: Submitted
>

We have tooling around this tag, so please use Upstream-Status.

Ross

[-- Attachment #2: Type: text/html, Size: 575 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 08/17] fts: Add recipe
  2015-12-19 23:52 ` [PATCH 08/17] fts: Add recipe Khem Raj
@ 2015-12-21 12:15   ` Burton, Ross
  2015-12-21 13:42     ` Khem Raj
  0 siblings, 1 reply; 35+ messages in thread
From: Burton, Ross @ 2015-12-21 12:15 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

On 19 December 2015 at 23:52, Khem Raj <raj.khem@gmail.com> wrote:

>  create mode 100644 meta/recipes-core/fts/fts/fts-header-correctness.patch
>  create mode 100644 meta/recipes-core/fts/fts/fts-uclibc.patch
>  create mode 100644 meta/recipes-core/fts/fts/gcc5.patch
>  create mode 100644 meta/recipes-core/fts/fts/remove_cdefs.patch
>  create mode 100644 meta/recipes-core/fts/fts/stdint.patch
>

None of these patches have headers.

Ross

[-- Attachment #2: Type: text/html, Size: 868 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 08/17] fts: Add recipe
  2015-12-21 12:15   ` Burton, Ross
@ 2015-12-21 13:42     ` Khem Raj
  2015-12-25  5:53       ` Khem Raj
  0 siblings, 1 reply; 35+ messages in thread
From: Khem Raj @ 2015-12-21 13:42 UTC (permalink / raw)
  To: Ross Burton; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

On Dec 21, 2015 4:15 AM, "Burton, Ross" <ross.burton@intel.com> wrote:
>
>
> On 19 December 2015 at 23:52, Khem Raj <raj.khem@gmail.com> wrote:
>>
>>  create mode 100644
meta/recipes-core/fts/fts/fts-header-correctness.patch
>>  create mode 100644 meta/recipes-core/fts/fts/fts-uclibc.patch
>>  create mode 100644 meta/recipes-core/fts/fts/gcc5.patch
>>  create mode 100644 meta/recipes-core/fts/fts/remove_cdefs.patch
>>  create mode 100644 meta/recipes-core/fts/fts/stdint.patch
>
>
> None of these patches have headers.

Thanks Ross. I will update the pull tree and send a note afterwards
>
> Ross

[-- Attachment #2: Type: text/html, Size: 882 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 09/17] valgrind: Define __UCLIBC__ for uclibc based systems
  2015-12-19 23:52 ` [PATCH 09/17] valgrind: Define __UCLIBC__ for uclibc based systems Khem Raj
@ 2015-12-21 20:38   ` Andre McCurdy
  2015-12-21 20:57     ` Andre McCurdy
  0 siblings, 1 reply; 35+ messages in thread
From: Andre McCurdy @ 2015-12-21 20:38 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE Core mailing list

On Sat, Dec 19, 2015 at 3:52 PM, Khem Raj <raj.khem@gmail.com> wrote:
> Helps configure valgrind for uclibc targets otherwise it tries to assume
> funcitons that are implemented in glibc like __free_res

This is going to conflict with the valgrind version update patches
already posted to the list.

Ross, any thoughts on which set of patches might get merged first, so
that either Khem or I can rebase accordingly? Or perhaps I could just
pull this one change into the valgrind update series and Khem could
drop it?

> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/recipes-devtools/valgrind/valgrind_3.10.1.bb | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb b/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb
> index c38a07b..c1c11d4 100644
> --- a/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb
> +++ b/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb
> @@ -44,6 +44,8 @@ EXTRA_OECONF_armv7a = "--enable-tls -host=armv7-none-linux-gnueabi --without-mpi
>  EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS', True) != '32']}"
>  EXTRA_OEMAKE = "-w"
>
> +CFLAGS_append_libc-uclibc = " -D__UCLIBC__ "
> +
>  do_install_append () {
>      install -m 644 ${B}/default.supp ${D}/${libdir}/valgrind/
>  }
> --
> 2.6.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 09/17] valgrind: Define __UCLIBC__ for uclibc based systems
  2015-12-21 20:38   ` Andre McCurdy
@ 2015-12-21 20:57     ` Andre McCurdy
  0 siblings, 0 replies; 35+ messages in thread
From: Andre McCurdy @ 2015-12-21 20:57 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE Core mailing list

On Mon, Dec 21, 2015 at 12:38 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
> On Sat, Dec 19, 2015 at 3:52 PM, Khem Raj <raj.khem@gmail.com> wrote:
>> Helps configure valgrind for uclibc targets otherwise it tries to assume
>> funcitons that are implemented in glibc like __free_res
>
> This is going to conflict with the valgrind version update patches
> already posted to the list.
>
> Ross, any thoughts on which set of patches might get merged first, so
> that either Khem or I can rebase accordingly? Or perhaps I could just
> pull this one change into the valgrind update series and Khem could
> drop it?

Never mind, I see Alexander's original valgrind update patch got merged to mut2.

>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>  meta/recipes-devtools/valgrind/valgrind_3.10.1.bb | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb b/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb
>> index c38a07b..c1c11d4 100644
>> --- a/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb
>> +++ b/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb
>> @@ -44,6 +44,8 @@ EXTRA_OECONF_armv7a = "--enable-tls -host=armv7-none-linux-gnueabi --without-mpi
>>  EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS', True) != '32']}"
>>  EXTRA_OEMAKE = "-w"
>>
>> +CFLAGS_append_libc-uclibc = " -D__UCLIBC__ "
>> +
>>  do_install_append () {
>>      install -m 644 ${B}/default.supp ${D}/${libdir}/valgrind/
>>  }
>> --
>> 2.6.4
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 08/17] fts: Add recipe
  2015-12-21 13:42     ` Khem Raj
@ 2015-12-25  5:53       ` Khem Raj
  0 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2015-12-25  5:53 UTC (permalink / raw)
  To: Ross Burton; +Cc: Patches and discussions about the oe-core layer

Ross

I have update the pull tree with all the comments addressed

On Mon, Dec 21, 2015 at 5:42 AM, Khem Raj <raj.khem@gmail.com> wrote:
>
> On Dec 21, 2015 4:15 AM, "Burton, Ross" <ross.burton@intel.com> wrote:
>>
>>
>> On 19 December 2015 at 23:52, Khem Raj <raj.khem@gmail.com> wrote:
>>>
>>>  create mode 100644
>>> meta/recipes-core/fts/fts/fts-header-correctness.patch
>>>  create mode 100644 meta/recipes-core/fts/fts/fts-uclibc.patch
>>>  create mode 100644 meta/recipes-core/fts/fts/gcc5.patch
>>>  create mode 100644 meta/recipes-core/fts/fts/remove_cdefs.patch
>>>  create mode 100644 meta/recipes-core/fts/fts/stdint.patch
>>
>>
>> None of these patches have headers.
>
> Thanks Ross. I will update the pull tree and send a note afterwards
>>
>> Ross


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 07/17] libtirpc: Fix build for musl
  2015-12-19 23:52 ` [PATCH 07/17] libtirpc: Fix build for musl Khem Raj
@ 2015-12-29  1:17   ` Khem Raj
  0 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2015-12-29  1:17 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

This patch is no  longer needed with latest libtirpc update

I have refreshed the pull tree on top of latest master and dropped this patch


On Sat, Dec 19, 2015 at 3:52 PM, Khem Raj <raj.khem@gmail.com> wrote:
> NIS support is really not there in musl and some fixes
> are break the linux = glibc assumption
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  ...rpcbynumber-and-getrpcbyname-if-those-are.patch |   89 +
>  ...-use-of-internal-glibc-sys-cdefs.h-header.patch | 1754 ++++++++++++++++++++
>  ...gure-option-to-disable-DES-authentication.patch |   99 ++
>  ...-compile-error-IPPORT_RESERVED-undeclared.patch |   35 +
>  ...0006-Define-struct-rpcent-on-non-GNU-libc.patch |   50 +
>  .../libtirpc/libtirpc/0007-use-bsd-queue.patch     |  561 +++++++
>  meta/recipes-extended/libtirpc/libtirpc/nis.h      |  545 ++++++
>  meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb   |   14 +
>  8 files changed, 3147 insertions(+)
>  create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
>  create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
>  create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch
>  create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
>  create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch
>  create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0007-use-bsd-queue.patch
>  create mode 100644 meta/recipes-extended/libtirpc/libtirpc/nis.h
>
> diff --git a/meta/recipes-extended/libtirpc/libtirpc/0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch b/meta/recipes-extended/libtirpc/libtirpc/0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
> new file mode 100644
> index 0000000..93149b9
> --- /dev/null
> +++ b/meta/recipes-extended/libtirpc/libtirpc/0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
> @@ -0,0 +1,89 @@
> +From fe103d60b2d4c71f11095232dadc8352c6c096da Mon Sep 17 00:00:00 2001
> +From: Natanael Copa <ncopa@alpinelinux.org>
> +Date: Thu, 24 Apr 2014 09:19:45 +0200
> +Subject: [PATCH 2/9] Provide getrpcbynumber and getrpcbyname if those are
> + missing
> +
> +We enable the config.h again and check if getrpcbynumber and
> +getrpcbyname exists on the building patform. If it does not exist, then
> +provide those functions.
> +
> +This is needed for musl libc.
> +
> +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
> +---
> +Upstream-Status: Pending
> +
> + configure.ac    |  6 ++++--
> + src/getrpcent.c | 10 ++++++++--
> + 2 files changed, 12 insertions(+), 4 deletions(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 10d17ea..0180801 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -24,14 +24,16 @@ if test "x$enable_ipv6" != xno; then
> + fi
> +
> + AC_PROG_CC
> +-m4_pattern_allow(AM_CONFIG_HEADERS(config.h))
> ++AC_CONFIG_HEADERS([config.h])
> + AC_PROG_LIBTOOL
> + AC_HEADER_DIRENT
> + AC_PREFIX_DEFAULT(/usr)
> + AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h])
> + AC_CHECK_LIB([pthread], [pthread_create])
> + AC_CHECK_LIB([nsl], [yp_get_default_domain])
> +-
> ++AC_CHECK_FUNCS([getrpcbyname getrpcbynumber])
> +
> + AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile])
> + AC_OUTPUT(libtirpc.pc)
> ++
> ++
> +diff --git a/src/getrpcent.c b/src/getrpcent.c
> +index 1b54b6d..6da006a 100644
> +--- a/src/getrpcent.c
> ++++ b/src/getrpcent.c
> +@@ -50,6 +50,10 @@
> + #include <libc_private.h>
> + #endif
> +
> ++#if HAVE_CONFIG_H
> ++#include "config.h"
> ++#endif
> ++
> + /*
> +  * Internet version.
> +  */
> +@@ -89,7 +93,7 @@ _rpcdata()
> +       return (d);
> + }
> +
> +-#ifdef GQ
> ++#if !HAVE_GETRPCBYNYMBER
> + struct rpcent *
> + getrpcbynumber(number)
> +       int number;
> +@@ -135,7 +139,9 @@ no_yp:
> +       endrpcent();
> +       return (p);
> + }
> ++#endif /* !HAVE_GETRPCBYNUMBER */
> +
> ++#if !HAVE_GETRPCBYNAME
> + struct rpcent *
> + getrpcbyname(name)
> +       const char *name;
> +@@ -158,7 +164,7 @@ done:
> +       endrpcent();
> +       return (rpc);
> + }
> +-#endif /* GQ */
> ++#endif /* !HAVE_GETRPCBYNAME */
> +
> + void
> + setrpcent(f)
> +--
> +2.2.0
> +
> diff --git a/meta/recipes-extended/libtirpc/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch b/meta/recipes-extended/libtirpc/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
> new file mode 100644
> index 0000000..5585d7a
> --- /dev/null
> +++ b/meta/recipes-extended/libtirpc/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
> @@ -0,0 +1,1754 @@
> +From d859292140e52c055b2a51ded67cbb966531ac4c Mon Sep 17 00:00:00 2001
> +From: Natanael Copa <ncopa@alpinelinux.org>
> +Date: Mon, 15 Dec 2014 09:29:32 +0100
> +Subject: [PATCH 3/9] Avoid use of internal glibc sys/cdefs.h header
> +
> +This header was never intended to be used by programs.
> +
> +Expand the macros used, __BEGIN_CDECLS, __END_CDECLS and __P()
> +
> +The __THROW macro is a non-portable hint for optimization so we simply
> +remove those.
> +
> +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
> +---
> +Upstream-Status: Pending
> +
> + src/auth_des.c        |  2 --
> + src/auth_none.c       |  1 -
> + src/auth_time.c       |  1 -
> + src/auth_unix.c       |  1 -
> + src/authdes_prot.c    |  1 -
> + src/authunix_prot.c   |  1 -
> + src/bindresvport.c    |  1 -
> + src/clnt_bcast.c      |  1 -
> + src/clnt_perror.c     |  3 --
> + src/clnt_simple.c     |  1 -
> + src/crypt_client.c    |  1 -
> + src/des_crypt.c       |  1 -
> + src/getnetconfig.c    |  1 -
> + src/getnetpath.c      |  2 --
> + src/getpeereid.c      |  1 -
> + src/getpublickey.c    |  3 --
> + src/key_call.c        |  1 -
> + src/key_prot_xdr.c    |  1 -
> + src/mt_misc.c         |  1 -
> + src/pmap_clnt.c       |  1 -
> + src/pmap_getmaps.c    |  1 -
> + src/rpc_com.h         |  9 ++++--
> + src/rpc_generic.c     |  1 -
> + src/rpcb_st_xdr.c     |  1 -
> + src/rpcdname.c        |  1 -
> + src/svc_dg.c          |  1 -
> + src/svc_simple.c      |  1 -
> + src/svc_vc.c          |  1 -
> + src/xdr.c             |  1 -
> + src/xdr_array.c       |  1 -
> + src/xdr_float.c       |  1 -
> + src/xdr_mem.c         |  1 -
> + src/xdr_rec.c         |  2 --
> + src/xdr_reference.c   |  2 --
> + src/xdr_sizeof.c      |  1 -
> + src/xdr_stdio.c       |  1 -
> + tirpc/netconfig.h     |  8 +++--
> + tirpc/rpc/auth.h      | 89 ++++++++++++++++++++++++++++++++++++++-------------
> + tirpc/rpc/auth_des.h  | 16 ++++++---
> + tirpc/rpc/auth_gss.h  | 47 ++++++++++++++-------------
> + tirpc/rpc/auth_unix.h |  9 ++++--
> + tirpc/rpc/clnt.h      | 57 ++++++++++++++++++++++++---------
> + tirpc/rpc/clnt_soc.h  | 33 +++++++++++++------
> + tirpc/rpc/des_crypt.h | 25 +++++++++++----
> + tirpc/rpc/nettype.h   |  8 +++--
> + tirpc/rpc/pmap_clnt.h |  9 ++++--
> + tirpc/rpc/pmap_prot.h |  9 ++++--
> + tirpc/rpc/pmap_rmt.h  |  9 ++++--
> + tirpc/rpc/rpc.h       | 18 ++++++++---
> + tirpc/rpc/rpc_com.h   |  9 ++++--
> + tirpc/rpc/rpc_msg.h   |  8 +++--
> + tirpc/rpc/rpcb_clnt.h |  8 +++--
> + tirpc/rpc/rpcent.h    | 12 ++++---
> + tirpc/rpc/svc.h       | 65 +++++++++++++++++++++++++++----------
> + tirpc/rpc/svc_auth.h  |  8 +++--
> + tirpc/rpc/svc_soc.h   | 49 ++++++++++++++++++++--------
> + tirpc/rpc/xdr.h       | 17 +++++++---
> + 57 files changed, 369 insertions(+), 196 deletions(-)
> +
> +diff --git a/src/auth_des.c b/src/auth_des.c
> +index cff777c..1ccbf28 100644
> +--- a/src/auth_des.c
> ++++ b/src/auth_des.c
> +@@ -38,7 +38,6 @@
> + #include <string.h>
> + #include <stdlib.h>
> + #include <unistd.h>
> +-#include <sys/cdefs.h>
> + #include <rpc/des_crypt.h>
> + #include <syslog.h>
> + #include <rpc/types.h>
> +@@ -52,7 +51,6 @@
> +
> + #if defined(LIBC_SCCS) && !defined(lint)
> + #endif
> +-#include <sys/cdefs.h>
> +
> + #include "debug.h"
> +
> +diff --git a/src/auth_none.c b/src/auth_none.c
> +index affc92b..0b0bbd1 100644
> +--- a/src/auth_none.c
> ++++ b/src/auth_none.c
> +@@ -31,7 +31,6 @@
> + static char *sccsid = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro";
> + static char *sccsid = "@(#)auth_none.c        2.1 88/07/29 4.0 RPCSRC";
> + #endif
> +-#include <sys/cdefs.h>
> + __FBSDID("$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.12 2002/03/22 23:18:35 obrien Exp $");
> + */
> +
> +diff --git a/src/auth_time.c b/src/auth_time.c
> +index 7cfbb7e..ace86bf 100644
> +--- a/src/auth_time.c
> ++++ b/src/auth_time.c
> +@@ -25,7 +25,6 @@
> +  *    needed to deal with TCP connections.
> +  */
> +
> +-#include <sys/cdefs.h>
> + #include <stdio.h>
> + #include <syslog.h>
> + #include <string.h>
> +diff --git a/src/auth_unix.c b/src/auth_unix.c
> +index 4b9b13f..3009543 100644
> +--- a/src/auth_unix.c
> ++++ b/src/auth_unix.c
> +@@ -26,7 +26,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * auth_unix.c, Implements UNIX style authentication parameters.
> +diff --git a/src/authdes_prot.c b/src/authdes_prot.c
> +index ed061a5..227d08a 100644
> +--- a/src/authdes_prot.c
> ++++ b/src/authdes_prot.c
> +@@ -1,4 +1,3 @@
> +-#include <sys/cdefs.h>
> + /*
> +  * Copyright (c) 2009, Sun Microsystems, Inc.
> +  * All rights reserved.
> +diff --git a/src/authunix_prot.c b/src/authunix_prot.c
> +index bf76a9d..0a04336 100644
> +--- a/src/authunix_prot.c
> ++++ b/src/authunix_prot.c
> +@@ -26,7 +26,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * authunix_prot.c
> +diff --git a/src/bindresvport.c b/src/bindresvport.c
> +index d6d9c14..950fbd1 100644
> +--- a/src/bindresvport.c
> ++++ b/src/bindresvport.c
> +@@ -26,7 +26,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * Copyright (c) 1987 by Sun Microsystems, Inc.
> +diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c
> +index 373d8a5..be05af4 100644
> +--- a/src/clnt_bcast.c
> ++++ b/src/clnt_bcast.c
> +@@ -28,7 +28,6 @@
> + /*
> +  * Copyright (c) 1986-1991 by Sun Microsystems Inc.
> +  */
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * clnt_bcast.c
> +diff --git a/src/clnt_perror.c b/src/clnt_perror.c
> +index bcd8af8..fb7fb80 100644
> +--- a/src/clnt_perror.c
> ++++ b/src/clnt_perror.c
> +@@ -27,9 +27,6 @@
> +  */
> +
> + /*
> +-#include <sys/cdefs.h>
> +-*/
> +-/*
> +  * clnt_perror.c
> +  *
> +  * Copyright (C) 1984, Sun Microsystems, Inc.
> +diff --git a/src/clnt_simple.c b/src/clnt_simple.c
> +index 7ee9542..1700060 100644
> +--- a/src/clnt_simple.c
> ++++ b/src/clnt_simple.c
> +@@ -29,7 +29,6 @@
> +  * Copyright (c) 1986-1991 by Sun Microsystems Inc.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * clnt_simple.c
> +diff --git a/src/crypt_client.c b/src/crypt_client.c
> +index 670b253..f393926 100644
> +--- a/src/crypt_client.c
> ++++ b/src/crypt_client.c
> +@@ -30,7 +30,6 @@
> +  * SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + #include <err.h>
> + #include <sys/types.h>
> +diff --git a/src/des_crypt.c b/src/des_crypt.c
> +index 37a1022..980a6cb 100644
> +--- a/src/des_crypt.c
> ++++ b/src/des_crypt.c
> +@@ -39,7 +39,6 @@
> + static char sccsid[] = "@(#)des_crypt.c       2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02/08 SMI";
> + #endif
> + #endif
> +-#include <sys/cdefs.h>
> +
> + static int common_crypt( char *, char *, unsigned, unsigned, struct desparams * );
> + int (*__des_crypt_LOCAL)() = 0;
> +diff --git a/src/getnetconfig.c b/src/getnetconfig.c
> +index 635c03a..92e7c43 100644
> +--- a/src/getnetconfig.c
> ++++ b/src/getnetconfig.c
> +@@ -32,7 +32,6 @@
> +
> + #include <pthread.h>
> + #include <reentrant.h>
> +-#include <sys/cdefs.h>
> + #include <stdio.h>
> + #include <errno.h>
> + #include <netconfig.h>
> +diff --git a/src/getnetpath.c b/src/getnetpath.c
> +index cd80dca..7c19932 100644
> +--- a/src/getnetpath.c
> ++++ b/src/getnetpath.c
> +@@ -25,13 +25,11 @@
> +  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * Copyright (c) 1989 by Sun Microsystems, Inc.
> +  */
> +
> +-#include <sys/cdefs.h>
> + #include <stdio.h>
> + #include <errno.h>
> + #include <netconfig.h>
> +diff --git a/src/getpeereid.c b/src/getpeereid.c
> +index 57ee197..dd85270 100644
> +--- a/src/getpeereid.c
> ++++ b/src/getpeereid.c
> +@@ -24,7 +24,6 @@
> +  * SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + #include <sys/param.h>
> + #include <sys/socket.h>
> +diff --git a/src/getpublickey.c b/src/getpublickey.c
> +index 85935d8..764a5f9 100644
> +--- a/src/getpublickey.c
> ++++ b/src/getpublickey.c
> +@@ -25,9 +25,6 @@
> +  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +-/*
> +-#include <sys/cdefs.h>
> +-*/
> +
> + /*
> +  * publickey.c
> +diff --git a/src/key_call.c b/src/key_call.c
> +index 8b9f388..1a6430b 100644
> +--- a/src/key_call.c
> ++++ b/src/key_call.c
> +@@ -30,7 +30,6 @@
> +  */
> +
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * key_call.c, Interface to keyserver
> +diff --git a/src/key_prot_xdr.c b/src/key_prot_xdr.c
> +index df2842f..772f582 100644
> +--- a/src/key_prot_xdr.c
> ++++ b/src/key_prot_xdr.c
> +@@ -33,7 +33,6 @@
> +  */
> + /* Copyright (c)  1990, 1991 Sun Microsystems, Inc. */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * Compiled from key_prot.x using rpcgen.
> +diff --git a/src/mt_misc.c b/src/mt_misc.c
> +index 093086e..a50f385 100644
> +--- a/src/mt_misc.c
> ++++ b/src/mt_misc.c
> +@@ -1,5 +1,4 @@
> +
> +-#include <sys/cdefs.h>
> + #include <pthread.h>
> + #include <reentrant.h>
> + #include <rpc/rpc.h>
> +diff --git a/src/pmap_clnt.c b/src/pmap_clnt.c
> +index 1d5d153..4b5fd85 100644
> +--- a/src/pmap_clnt.c
> ++++ b/src/pmap_clnt.c
> +@@ -26,7 +26,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * pmap_clnt.c
> +diff --git a/src/pmap_getmaps.c b/src/pmap_getmaps.c
> +index 54338f7..853f724 100644
> +--- a/src/pmap_getmaps.c
> ++++ b/src/pmap_getmaps.c
> +@@ -26,7 +26,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * pmap_getmap.c
> +diff --git a/src/rpc_com.h b/src/rpc_com.h
> +index 38c2cfe..52a8c48 100644
> +--- a/src/rpc_com.h
> ++++ b/src/rpc_com.h
> +@@ -40,7 +40,6 @@
> + #ifndef _TIRPC_RPCCOM_H
> + #define       _TIRPC_RPCCOM_H
> +
> +-#include <sys/cdefs.h>
> +
> + /* #pragma ident      "@(#)rpc_com.h  1.11    93/07/05 SMI" */
> +
> +@@ -54,7 +53,9 @@
> + #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
> +     (u_int32_t)(now)->tv_usec)
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern u_int __rpc_get_a_size(int);
> + extern int __rpc_dtbsize(void);
> + extern struct netconfig * __rpcgettp(int);
> +@@ -90,6 +91,8 @@ void __xprt_set_raddr(SVCXPRT *, const struct sockaddr_storage *);
> + SVCXPRT **__svc_xports;
> + int __svc_maxrec;
> +
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* _TIRPC_RPCCOM_H */
> +diff --git a/src/rpc_generic.c b/src/rpc_generic.c
> +index a43906c..0ceadb4 100644
> +--- a/src/rpc_generic.c
> ++++ b/src/rpc_generic.c
> +@@ -29,7 +29,6 @@
> +  * Copyright (c) 1986-1991 by Sun Microsystems Inc.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * rpc_generic.c, Miscl routines for RPC.
> +diff --git a/src/rpcb_st_xdr.c b/src/rpcb_st_xdr.c
> +index c5d3575..08db745 100644
> +--- a/src/rpcb_st_xdr.c
> ++++ b/src/rpcb_st_xdr.c
> +@@ -35,7 +35,6 @@
> +  * routines used with the rpcbind stats facility.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + #include <rpc/rpc.h>
> +
> +diff --git a/src/rpcdname.c b/src/rpcdname.c
> +index 094cea3..3e6a988 100644
> +--- a/src/rpcdname.c
> ++++ b/src/rpcdname.c
> +@@ -25,7 +25,6 @@
> +  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * rpcdname.c
> +diff --git a/src/svc_dg.c b/src/svc_dg.c
> +index f8255cc..1fd6f92 100644
> +--- a/src/svc_dg.c
> ++++ b/src/svc_dg.c
> +@@ -31,7 +31,6 @@
> +  * Copyright (c) 1986-1991 by Sun Microsystems Inc.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * svc_dg.c, Server side for connectionless RPC.
> +diff --git a/src/svc_simple.c b/src/svc_simple.c
> +index b6c371e..cb58002 100644
> +--- a/src/svc_simple.c
> ++++ b/src/svc_simple.c
> +@@ -29,7 +29,6 @@
> +  * Copyright (c) 1986-1991 by Sun Microsystems Inc.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * svc_simple.c
> +diff --git a/src/svc_vc.c b/src/svc_vc.c
> +index 4d3ea51..9dba72a 100644
> +--- a/src/svc_vc.c
> ++++ b/src/svc_vc.c
> +@@ -27,7 +27,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * svc_vc.c, Server side for Connection Oriented based RPC.
> +diff --git a/src/xdr.c b/src/xdr.c
> +index 1142a88..f3fb9ad 100644
> +--- a/src/xdr.c
> ++++ b/src/xdr.c
> +@@ -26,7 +26,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * xdr.c, Generic XDR routines implementation.
> +diff --git a/src/xdr_array.c b/src/xdr_array.c
> +index 216173d..7fc8fb8 100644
> +--- a/src/xdr_array.c
> ++++ b/src/xdr_array.c
> +@@ -27,7 +27,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * xdr_array.c, Generic XDR routines impelmentation.
> +diff --git a/src/xdr_float.c b/src/xdr_float.c
> +index 90daf3f..26bc865 100644
> +--- a/src/xdr_float.c
> ++++ b/src/xdr_float.c
> +@@ -27,7 +27,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * xdr_float.c, Generic XDR routines implementation.
> +diff --git a/src/xdr_mem.c b/src/xdr_mem.c
> +index bd86f00..ecdc932 100644
> +--- a/src/xdr_mem.c
> ++++ b/src/xdr_mem.c
> +@@ -26,7 +26,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * xdr_mem.h, XDR implementation using memory buffers.
> +diff --git a/src/xdr_rec.c b/src/xdr_rec.c
> +index 2aca623..7d535cf 100644
> +--- a/src/xdr_rec.c
> ++++ b/src/xdr_rec.c
> +@@ -27,8 +27,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking"
> +diff --git a/src/xdr_reference.c b/src/xdr_reference.c
> +index affe19e..13f6410 100644
> +--- a/src/xdr_reference.c
> ++++ b/src/xdr_reference.c
> +@@ -26,8 +26,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * xdr_reference.c, Generic XDR routines impelmentation.
> +diff --git a/src/xdr_sizeof.c b/src/xdr_sizeof.c
> +index a805e31..cc5414b 100644
> +--- a/src/xdr_sizeof.c
> ++++ b/src/xdr_sizeof.c
> +@@ -34,7 +34,6 @@
> +  * when serialized using XDR.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + #include <rpc/types.h>
> + #include <rpc/xdr.h>
> +diff --git a/src/xdr_stdio.c b/src/xdr_stdio.c
> +index 45b1150..4410262 100644
> +--- a/src/xdr_stdio.c
> ++++ b/src/xdr_stdio.c
> +@@ -26,7 +26,6 @@
> +  * POSSIBILITY OF SUCH DAMAGE.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * xdr_stdio.c, XDR implementation on standard i/o file.
> +diff --git a/tirpc/netconfig.h b/tirpc/netconfig.h
> +index 7d6c2bc..c25788c 100644
> +--- a/tirpc/netconfig.h
> ++++ b/tirpc/netconfig.h
> +@@ -74,7 +74,9 @@ typedef struct {
> + #define NC_UDP                "udp"
> + #define NC_ICMP               "icmp"
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> +
> + extern void *setnetconfig (void);
> + extern struct netconfig *getnetconfig (void *);
> +@@ -89,6 +91,8 @@ extern int endnetpath (void *);
> + extern void nc_perror (const char *);
> + extern char *nc_sperror (void);
> +
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* _NETCONFIG_H_ */
> +diff --git a/tirpc/rpc/auth.h b/tirpc/rpc/auth.h
> +index 7c8f813..434d35c 100644
> +--- a/tirpc/rpc/auth.h
> ++++ b/tirpc/rpc/auth.h
> +@@ -48,7 +48,6 @@
> +
> + #include <rpc/xdr.h>
> + #include <rpc/clnt_stat.h>
> +-#include <sys/cdefs.h>
> + #include <sys/socket.h>
> + #include <sys/types.h>
> +
> +@@ -164,9 +163,13 @@ union des_block {
> +       char c[8];
> + };
> + typedef union des_block des_block;
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern bool_t xdr_des_block(XDR *, des_block *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Authentication info.  Opaque to client.
> +@@ -277,9 +280,13 @@ auth_put(AUTH *auth)
> +               xfunc, xwhere))
> +
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern struct opaque_auth _null_auth;
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Any style authentication.  These routines can be used by any
> +@@ -300,11 +307,15 @@ int authany_wrap(void), authany_unwrap(void);
> +  *    int len;
> +  *    int *aup_gids;
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern AUTH *authunix_create(char *, uid_t, uid_t, int, uid_t *);
> + extern AUTH *authunix_create_default(void);   /* takes no parameters */
> + extern AUTH *authnone_create(void);           /* takes no parameters */
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> + /*
> +  * DES style authentication
> +  * AUTH *authsecdes_create(servername, window, timehost, ckey)
> +@@ -313,15 +324,23 @@ __END_DECLS
> +  *    const char *timehost;                   - optional hostname to sync with
> +  *    des_block *ckey;                - optional conversation key to use
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *);
> + extern AUTH *authdes_seccreate (const char *, const u_int, const  char *,
> +     const  des_block *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern bool_t xdr_opaque_auth         (XDR *, struct opaque_auth *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
> + #define authsys_create_default() authunix_create_default()
> +@@ -329,36 +348,48 @@ __END_DECLS
> + /*
> +  * Netname manipulation routines.
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern int getnetname(char *);
> + extern int host2netname(char *, const char *, const char *);
> + extern int user2netname(char *, const uid_t, const char *);
> + extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *);
> + extern int netname2host(char *, char *, const int);
> + extern void passwd2des ( char *, char * );
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  *
> +  * These routines interface to the keyserv daemon
> +  *
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern int key_decryptsession(const char *, des_block *);
> + extern int key_encryptsession(const char *, des_block *);
> + extern int key_gendes(des_block *);
> + extern int key_setsecret(const char *);
> + extern int key_secretkey_is_set(void);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Publickey routines.
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern int getpublickey (const char *, char *);
> + extern int getpublicandprivatekey (char *, char *);
> + extern int getsecretkey (char *, char *, char *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #ifdef KERBEROS
> + /*
> +@@ -371,10 +402,14 @@ __END_DECLS
> +  *    const char *timehost;                   - optional hostname to sync with
> +  *    int *status;                            - kerberos status returned
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern AUTH   *authkerb_seccreate(const char *, const char *, const  char *,
> +                   const u_int, const char *, int *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Map a kerberos credential into a unix cred.
> +@@ -387,20 +422,28 @@ __END_DECLS
> +  *    int *groups;
> +  *
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern int    authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *,
> +                   short *, int * */);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> + #endif /* KERBEROS */
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + struct svc_req;
> + struct rpc_msg;
> + enum auth_stat _svcauth_none (struct svc_req *, struct rpc_msg *);
> + enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *);
> + enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *);
> + enum auth_stat _svcauth_gss (struct svc_req *, struct rpc_msg *, bool_t *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #define AUTH_NONE     0               /* no authentication */
> + #define       AUTH_NULL       0               /* backward compatibility */
> +diff --git a/tirpc/rpc/auth_des.h b/tirpc/rpc/auth_des.h
> +index 39b5332..77e169d 100644
> +--- a/tirpc/rpc/auth_des.h
> ++++ b/tirpc/rpc/auth_des.h
> +@@ -114,17 +114,25 @@ struct authdes_verf {
> +  * Map a des credential into a unix cred.
> +  *
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern int authdes_getucred( struct authdes_cred *, uid_t *, gid_t *, int *, gid_t * );
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern bool_t xdr_authdes_cred(XDR *, struct authdes_cred *);
> + extern bool_t xdr_authdes_verf(XDR *, struct authdes_verf *);
> + extern int    rtime(dev_t, struct netbuf *, int, struct timeval *,
> +                   struct timeval *);
> + extern void   kgetnetname(char *);
> + extern enum auth_stat _svcauth_des(struct svc_req *, struct rpc_msg *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* ndef _TI_AUTH_DES_ */
> +diff --git a/tirpc/rpc/auth_gss.h b/tirpc/rpc/auth_gss.h
> +index d6f2bbd..a17b34b 100644
> +--- a/tirpc/rpc/auth_gss.h
> ++++ b/tirpc/rpc/auth_gss.h
> +@@ -104,28 +104,29 @@ struct rpc_gss_init_res {
> + #define MAXSEQ                0x80000000
> +
> + /* Prototypes. */
> +-__BEGIN_DECLS
> +-bool_t        xdr_rpc_gss_cred        __P((XDR *xdrs, struct rpc_gss_cred *p));
> +-bool_t        xdr_rpc_gss_init_args   __P((XDR *xdrs, gss_buffer_desc *p));
> +-bool_t        xdr_rpc_gss_init_res    __P((XDR *xdrs, struct rpc_gss_init_res *p));
> +-bool_t        xdr_rpc_gss_data        __P((XDR *xdrs, xdrproc_t xdr_func,
> +-                                   caddr_t xdr_ptr, gss_ctx_id_t ctx,
> +-                                   gss_qop_t qop, rpc_gss_svc_t svc,
> +-                                   u_int seq));
> +-
> +-AUTH   *authgss_create                __P((CLIENT *, gss_name_t,
> +-                                   struct rpc_gss_sec *));
> +-AUTH   *authgss_create_default        __P((CLIENT *, char *, struct rpc_gss_sec *));
> +-bool_t authgss_service                __P((AUTH *auth, int svc));
> +-bool_t authgss_get_private_data       __P((AUTH *auth,
> +-                                   struct authgss_private_data *));
> +-bool_t authgss_free_private_data __P((struct authgss_private_data *));
> +-
> +-void  gss_log_debug           __P((const char *fmt, ...));
> +-void  gss_log_status          __P((char *m, OM_uint32 major,
> +-                                   OM_uint32 minor));
> +-void  gss_log_hexdump         __P((const u_char *buf, int len, int offset));
> +-
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> ++bool_t        xdr_rpc_gss_cred        (XDR *xdrs, struct rpc_gss_cred *p);
> ++bool_t        xdr_rpc_gss_init_args   (XDR *xdrs, gss_buffer_desc *p);
> ++bool_t        xdr_rpc_gss_init_res    (XDR *xdrs, struct rpc_gss_init_res *p);
> ++bool_t        xdr_rpc_gss_data        (XDR *xdrs, xdrproc_t xdr_func,
> ++                               caddr_t xdr_ptr, gss_ctx_id_t ctx,
> ++                               gss_qop_t qop, rpc_gss_svc_t svc,
> ++                               u_int seq);
> ++
> ++AUTH   *authgss_create                (CLIENT *, gss_name_t, struct rpc_gss_sec *);
> ++AUTH   *authgss_create_default        (CLIENT *, char *, struct rpc_gss_sec *);
> ++bool_t authgss_service                (AUTH *auth, int svc);
> ++bool_t authgss_get_private_data       (AUTH *auth, struct authgss_private_data *);
> ++bool_t authgss_free_private_data (struct authgss_private_data *);
> ++
> ++void  gss_log_debug           (const char *fmt, ...);
> ++void  gss_log_status          (char *m, OM_uint32 major, OM_uint32 minor);
> ++void  gss_log_hexdump         (const u_char *buf, int len, int offset);
> ++
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* !_TIRPC_AUTH_GSS_H */
> +diff --git a/tirpc/rpc/auth_unix.h b/tirpc/rpc/auth_unix.h
> +index 602889b..b10e71d 100644
> +--- a/tirpc/rpc/auth_unix.h
> ++++ b/tirpc/rpc/auth_unix.h
> +@@ -45,7 +45,6 @@
> +
> + #ifndef _TIRPC_AUTH_UNIX_H
> + #define _TIRPC_AUTH_UNIX_H
> +-#include <sys/cdefs.h>
> +
> + /* The machine name is part of a credential; it may not exceed 255 bytes */
> + #define MAX_MACHINE_NAME 255
> +@@ -67,9 +66,13 @@ struct authunix_parms {
> +
> + #define authsys_parms authunix_parms
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * If a response verifier has flavor AUTH_SHORT,
> +diff --git a/tirpc/rpc/clnt.h b/tirpc/rpc/clnt.h
> +index 9ee619e..05f2215 100644
> +--- a/tirpc/rpc/clnt.h
> ++++ b/tirpc/rpc/clnt.h
> +@@ -42,7 +42,6 @@
> + #include <rpc/clnt_stat.h>
> + #include <rpc/auth.h>
> +
> +-#include <sys/cdefs.h>
> + #include <netconfig.h>
> + #include <sys/un.h>
> +
> +@@ -267,7 +266,9 @@ struct rpc_timers {
> +  * Generic client creation routine. Supported protocols are those that
> +  * belong to the nettype namespace (/etc/netconfig).
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
> +                          const char *);
> + /*
> +@@ -414,32 +415,46 @@ extern CLIENT *clnt_dg_create(const int, const struct netbuf *,
> +  */
> + extern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t);
> +
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> +
> + /*
> +  * Print why creation failed
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern void clnt_pcreateerror(const char *);                  /* stderr */
> + extern char *clnt_spcreateerror(const char *);                        /* string */
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Like clnt_perror(), but is more verbose in its output
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern void clnt_perrno(enum clnt_stat);              /* stderr */
> + extern char *clnt_sperrno(enum clnt_stat);            /* string */
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Print an English error message, given the client error code
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern void clnt_perror(CLIENT *, const char *);              /* stderr */
> + extern char *clnt_sperror(CLIENT *, const char *);            /* string */
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> +
> + /*
> +@@ -450,9 +465,13 @@ struct rpc_createerr {
> +       struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
> + };
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern struct rpc_createerr   *__rpc_createerr(void);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> + #define get_rpc_createerr()   (*(__rpc_createerr()))
> + #define rpc_createerr         (*(__rpc_createerr()))
> +
> +@@ -469,12 +488,16 @@ __END_DECLS
> +  *    char *out;
> +  *    const char *nettype;
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern enum clnt_stat rpc_call(const char *, const rpcprog_t,
> +                              const rpcvers_t, const rpcproc_t,
> +                              const xdrproc_t, const char *,
> +                              const xdrproc_t, char *, const char *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * RPC broadcast interface
> +@@ -522,7 +545,9 @@ __END_DECLS
> +
> + typedef bool_t (*resultproc_t)(caddr_t, ...);
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t,
> +                                   const rpcproc_t, const xdrproc_t,
> +                                   caddr_t, const xdrproc_t, caddr_t,
> +@@ -532,7 +557,9 @@ extern enum clnt_stat rpc_broadcast_exp(const rpcprog_t, const rpcvers_t,
> +                                       caddr_t, const xdrproc_t, caddr_t,
> +                                       const resultproc_t, const int,
> +                                       const int, const char *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /* For backward compatibility */
> + #include <rpc/clnt_soc.h>
> +diff --git a/tirpc/rpc/clnt_soc.h b/tirpc/rpc/clnt_soc.h
> +index 82330a3..6ec545c 100644
> +--- a/tirpc/rpc/clnt_soc.h
> ++++ b/tirpc/rpc/clnt_soc.h
> +@@ -46,7 +46,6 @@
> +  * with TS-RPC.
> +  */
> +
> +-#include <sys/cdefs.h>
> +
> + #define UDPMSGSIZE      8800    /* rpc imposed limit on udp msg size */
> +
> +@@ -61,27 +60,39 @@
> +  *    u_int sendsz;
> +  *    u_int recvsz;
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern CLIENT *clnttcp_create(struct sockaddr_in *, u_long, u_long, int *,
> +                             u_int, u_int);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Raw (memory) rpc.
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern CLIENT *clntraw_create(u_long, u_long);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> +
> + /*
> + IPv6 socket version
> + */
> + #ifdef INET6
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern CLIENT *clnttcp6_create(struct sockaddr_in6 *, u_long, u_long, int *,
> +                             u_int, u_int);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> + #endif
> +
> + /*
> +@@ -105,7 +116,9 @@ __END_DECLS
> +  *    u_int sendsz;
> +  *    u_int recvsz;
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern CLIENT *clntudp_create(struct sockaddr_in *, u_long, u_long,
> +                             struct timeval, int *);
> + extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, u_long, u_long,
> +@@ -116,7 +129,9 @@ extern CLIENT *clntudp6_create(struct sockaddr_in6 *, u_long, u_long,
> + extern CLIENT *clntudp6_bufcreate(struct sockaddr_in6 *, u_long, u_long,
> +                                struct timeval, int *, u_int, u_int);
> + #endif
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> +
> + #endif /* _RPC_CLNT_SOC_H */
> +diff --git a/tirpc/rpc/des_crypt.h b/tirpc/rpc/des_crypt.h
> +index 837088c..2358960 100644
> +--- a/tirpc/rpc/des_crypt.h
> ++++ b/tirpc/rpc/des_crypt.h
> +@@ -43,7 +43,6 @@
> + #ifndef _DES_DES_CRYPT_H
> + #define _DES_DES_CRYPT_H
> +
> +-#include <sys/cdefs.h>
> + #include <rpc/rpc.h>
> +
> + #define DES_MAXDATA 8192      /* max bytes encrypted in one call */
> +@@ -83,23 +82,35 @@
> + /*
> +  * Cipher Block Chaining mode
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + int cbc_crypt( char *, char *, unsigned int, unsigned int, char *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Electronic Code Book mode
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + int ecb_crypt( char *, char *, unsigned int, unsigned int );
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Set des parity for a key.
> +  * DES parity is odd and in the low bit of each byte
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + void des_setparity( char *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif  /* _DES_DES_CRYPT_H */
> +diff --git a/tirpc/rpc/nettype.h b/tirpc/rpc/nettype.h
> +index 92063c6..926797a 100644
> +--- a/tirpc/rpc/nettype.h
> ++++ b/tirpc/rpc/nettype.h
> +@@ -53,11 +53,15 @@
> + #define       _RPC_TCP        7
> + #define       _RPC_UDP        8
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern void *__rpc_setconf(const char *);
> + extern void __rpc_endconf(void *);
> + extern struct netconfig *__rpc_getconf(void *);
> + extern struct netconfig *__rpc_getconfip(const char *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif        /* !_TIRPC_NETTYPE_H */
> +diff --git a/tirpc/rpc/pmap_clnt.h b/tirpc/rpc/pmap_clnt.h
> +index 0d23908..6abd583 100644
> +--- a/tirpc/rpc/pmap_clnt.h
> ++++ b/tirpc/rpc/pmap_clnt.h
> +@@ -63,9 +63,10 @@
> +
> + #ifndef _RPC_PMAP_CLNT_H_
> + #define _RPC_PMAP_CLNT_H_
> +-#include <sys/cdefs.h>
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern bool_t         pmap_set(u_long, u_long, int, int);
> + extern bool_t         pmap_unset(u_long, u_long);
> + extern struct pmaplist        *pmap_getmaps(struct sockaddr_in *);
> +@@ -80,6 +81,8 @@ extern enum clnt_stat        clnt_broadcast(u_long, u_long, u_long,
> +                                      resultproc_t);
> + extern u_short                pmap_getport(struct sockaddr_in *,
> +                                    u_long, u_long, u_int);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* !_RPC_PMAP_CLNT_H_ */
> +diff --git a/tirpc/rpc/pmap_prot.h b/tirpc/rpc/pmap_prot.h
> +index c1a2546..75354ce 100644
> +--- a/tirpc/rpc/pmap_prot.h
> ++++ b/tirpc/rpc/pmap_prot.h
> +@@ -71,7 +71,6 @@
> +
> + #ifndef _RPC_PMAP_PROT_H
> + #define _RPC_PMAP_PROT_H
> +-#include <sys/cdefs.h>
> +
> + #define PMAPPORT              ((u_short)111)
> + #define PMAPPROG              ((u_long)100000)
> +@@ -97,10 +96,14 @@ struct pmaplist {
> +       struct pmaplist *pml_next;
> + };
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern bool_t xdr_pmap(XDR *, struct pmap *);
> + extern bool_t xdr_pmaplist(XDR *, struct pmaplist **);
> + extern bool_t xdr_pmaplist_ptr(XDR *, struct pmaplist *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* !_RPC_PMAP_PROT_H */
> +diff --git a/tirpc/rpc/pmap_rmt.h b/tirpc/rpc/pmap_rmt.h
> +index dd59a15..2a385e7 100644
> +--- a/tirpc/rpc/pmap_rmt.h
> ++++ b/tirpc/rpc/pmap_rmt.h
> +@@ -41,7 +41,6 @@
> +
> + #ifndef _RPC_PMAP_RMT_H
> + #define _RPC_PMAP_RMT_H
> +-#include <sys/cdefs.h>
> +
> + struct rmtcallargs {
> +       u_long prog, vers, proc, arglen;
> +@@ -56,9 +55,13 @@ struct rmtcallres {
> +       xdrproc_t xdr_results;
> + };
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern bool_t xdr_rmtcall_args(XDR *, struct rmtcallargs *);
> + extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* !_RPC_PMAP_RMT_H */
> +diff --git a/tirpc/rpc/rpc.h b/tirpc/rpc/rpc.h
> +index 6c0222e..fac2fa9 100644
> +--- a/tirpc/rpc/rpc.h
> ++++ b/tirpc/rpc/rpc.h
> +@@ -79,9 +79,11 @@
> + #define UDPMSGSIZE 8800
> + #endif
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern int get_myaddress(struct sockaddr_in *);
> +-extern int bindresvport(int, struct sockaddr_in *) __THROW;
> ++extern int bindresvport(int, struct sockaddr_in *);
> + extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
> +     xdrproc_t, xdrproc_t);
> + extern int callrpc(const char *, int, int, int, xdrproc_t, void *,
> +@@ -93,18 +95,24 @@ struct netbuf *uaddr2taddr(const struct netconfig *, const char *);
> +
> + struct sockaddr;
> + extern int bindresvport_sa(int, struct sockaddr *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * The following are not exported interfaces, they are for internal library
> +  * and rpcbind use only. Do not use, they may change without notice.
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + int __rpc_nconf2fd(const struct netconfig *);
> + int __rpc_nconf2fd_flags(const struct netconfig *, int);
> + int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);
> + int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *);
> + u_int __rpc_get_t_size(int, int, int);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* !_RPC_RPC_H */
> +diff --git a/tirpc/rpc/rpc_com.h b/tirpc/rpc/rpc_com.h
> +index cb3bbbb..236fcee 100644
> +--- a/tirpc/rpc/rpc_com.h
> ++++ b/tirpc/rpc/rpc_com.h
> +@@ -41,7 +41,6 @@
> + #ifndef _RPC_RPCCOM_H
> + #define       _RPC_RPCCOM_H
> +
> +-#include <sys/cdefs.h>
> +
> + /* #pragma ident      "@(#)rpc_com.h  1.11    93/07/05 SMI" */
> +
> +@@ -55,7 +54,9 @@
> + #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
> +     (u_int32_t)(now)->tv_usec)
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern u_int __rpc_get_a_size(int);
> + extern int __rpc_dtbsize(void);
> + extern int _rpc_dtablesize(void);
> +@@ -77,6 +78,8 @@ bool_t rpc_control(int,void *);
> +
> + char *_get_next_token(char *, int);
> +
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* _RPC_RPCCOM_H */
> +diff --git a/tirpc/rpc/rpc_msg.h b/tirpc/rpc/rpc_msg.h
> +index 16d8eef..f7aabd8 100644
> +--- a/tirpc/rpc/rpc_msg.h
> ++++ b/tirpc/rpc/rpc_msg.h
> +@@ -161,7 +161,9 @@ struct rpc_msg {
> + #define       acpted_rply     ru.RM_rmb.ru.RP_ar
> + #define       rjcted_rply     ru.RM_rmb.ru.RP_dr
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + /*
> +  * XDR routine to handle a rpc message.
> +  * xdr_callmsg(xdrs, cmsg)
> +@@ -210,6 +212,8 @@ extern bool_t      xdr_rejected_reply(XDR *, struct rejected_reply *);
> +  *    struct rpc_err *error;
> +  */
> + extern void   _seterr_reply(struct rpc_msg *, struct rpc_err *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* !_TIRPC_RPC_MSG_H */
> +diff --git a/tirpc/rpc/rpcb_clnt.h b/tirpc/rpc/rpcb_clnt.h
> +index 7e64f8f..86d81f6 100644
> +--- a/tirpc/rpc/rpcb_clnt.h
> ++++ b/tirpc/rpc/rpcb_clnt.h
> +@@ -59,7 +59,9 @@
> +
> + #include <rpc/types.h>
> + #include <rpc/rpcb_prot.h>
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t,
> +                      const struct netconfig  *, const struct netbuf *);
> + extern bool_t rpcb_unset(const rpcprog_t, const rpcvers_t,
> +@@ -78,6 +80,8 @@ extern bool_t rpcb_getaddr(const rpcprog_t, const rpcvers_t,
> + extern bool_t rpcb_gettime(const char *, time_t *);
> + extern char *rpcb_taddr2uaddr(struct netconfig *, struct netbuf *);
> + extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif        /* !_RPC_RPCB_CLNT_H */
> +diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
> +index c865e51..6619cd3 100644
> +--- a/tirpc/rpc/rpcent.h
> ++++ b/tirpc/rpc/rpcent.h
> +@@ -44,7 +44,9 @@
> + /*    #pragma ident "@(#)rpcent.h   1.13    94/04/25 SMI"     */
> + /*      @(#)rpcent.h 1.1 88/12/06 SMI   */
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> +
> + /* These are defined in /usr/include/rpc/netdb.h */
> + #if 0
> +@@ -60,8 +62,10 @@ extern struct rpcent *getrpcbynumber(int);
> + extern struct rpcent *getrpcent(void);
> + #endif
> +
> +-extern void setrpcent(int) __THROW;
> +-extern void endrpcent(void) __THROW;
> +-__END_DECLS
> ++extern void setrpcent(int);
> ++extern void endrpcent(void);
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* !_RPC_CENT_H */
> +diff --git a/tirpc/rpc/svc.h b/tirpc/rpc/svc.h
> +index b9691a8..8273c95 100644
> +--- a/tirpc/rpc/svc.h
> ++++ b/tirpc/rpc/svc.h
> +@@ -40,7 +40,6 @@
> +
> + #ifndef _TIRPC_SVC_H
> + #define _TIRPC_SVC_H
> +-#include <sys/cdefs.h>
> +
> + /*
> +  * This interface must manage two items concerning remote procedure calling:
> +@@ -200,11 +199,15 @@ struct svc_req {
> +  *    const struct netconfig *nconf;
> +  */
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern bool_t svc_reg(SVCXPRT *, const rpcprog_t, const rpcvers_t,
> +                       void (*)(struct svc_req *, SVCXPRT *),
> +                       const struct netconfig *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Service un-registration
> +@@ -214,9 +217,13 @@ __END_DECLS
> +  *    const rpcvers_t vers;
> +  */
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern void   svc_unreg(const rpcprog_t, const rpcvers_t);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Transport registration.
> +@@ -224,9 +231,13 @@ __END_DECLS
> +  * xprt_register(xprt)
> +  *    SVCXPRT *xprt;
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern void   xprt_register(SVCXPRT *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Transport un-register
> +@@ -234,9 +245,13 @@ __END_DECLS
> +  * xprt_unregister(xprt)
> +  *    SVCXPRT *xprt;
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern void   xprt_unregister(SVCXPRT *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> +
> + /*
> +@@ -265,7 +280,9 @@ __END_DECLS
> +  * deadlock the caller and server processes!
> +  */
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, void *);
> + extern void   svcerr_decode(SVCXPRT *);
> + extern void   svcerr_weakauth(SVCXPRT *);
> +@@ -277,7 +294,9 @@ extern void        svcerr_systemerr(SVCXPRT *);
> + extern int    rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t,
> +                       char *(*)(char *), xdrproc_t, xdrproc_t,
> +                       char *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Lowest level dispatching -OR- who owns this process anyway.
> +@@ -306,11 +325,17 @@ extern int svc_fds;
> +  * a small program implemented by the svc_rpc implementation itself;
> +  * also see clnt.h for protocol numbers.
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern void rpctest_service(void);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern void   svc_getreq(int);
> + extern void   svc_getreqset(fd_set *);
> + extern void   svc_getreq_common(int);
> +@@ -319,7 +344,9 @@ extern void        svc_getreq_poll(struct pollfd *, int);
> +
> + extern void   svc_run(void);
> + extern void   svc_exit(void);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Socket to use on svcxxx_create call to get default socket
> +@@ -331,7 +358,9 @@ __END_DECLS
> +  * These are the existing service side transport implementations
> +  */
> +
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + /*
> +  * Transport independent svc_create routine.
> +  */
> +@@ -427,7 +456,9 @@ int svc_dg_enablecache(SVCXPRT *, const u_int);
> +
> + int __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid);
> +
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> +
> + /* for backward compatibility */
> +diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h
> +index 723c989..67608d0 100644
> +--- a/tirpc/rpc/svc_auth.h
> ++++ b/tirpc/rpc/svc_auth.h
> +@@ -65,13 +65,17 @@ typedef struct SVCAUTH {
> + /*
> +  * Server side authenticator
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern enum auth_stat _gss_authenticate(struct svc_req *, struct rpc_msg *,
> +               bool_t *);
> + extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *);
> + extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *,
> +                         struct rpc_msg *));
> +
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* !_RPC_SVC_AUTH_H */
> +diff --git a/tirpc/rpc/svc_soc.h b/tirpc/rpc/svc_soc.h
> +index 6148d7b..9b7befa 100644
> +--- a/tirpc/rpc/svc_soc.h
> ++++ b/tirpc/rpc/svc_soc.h
> +@@ -38,7 +38,6 @@
> +
> + #ifndef _RPC_SVC_SOC_H
> + #define _RPC_SVC_SOC_H
> +-#include <sys/cdefs.h>
> +
> + /* #pragma ident   "@(#)svc_soc.h  1.11    94/04/25 SMI" */
> + /*      svc_soc.h 1.8 89/05/01 SMI      */
> +@@ -64,10 +63,14 @@
> +  *    void (*dispatch)();
> +  *    int protocol;    like TCP or UDP, zero means do not register
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern bool_t svc_register(SVCXPRT *, u_long, u_long,
> +                   void (*)(struct svc_req *, SVCXPRT *), int);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Service un-registration
> +@@ -76,44 +79,64 @@ __END_DECLS
> +  *    u_long prog;
> +  *    u_long vers;
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern void   svc_unregister(u_long, u_long);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> +
> + /*
> +  * Memory based rpc for testing and timing.
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern SVCXPRT *svcraw_create(void);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> +
> + /*
> +  * Udp based rpc.
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern SVCXPRT *svcudp_create(int);
> + extern SVCXPRT *svcudp_bufcreate(int, u_int, u_int);
> + extern int svcudp_enablecache(SVCXPRT *, u_long);
> + extern SVCXPRT *svcudp6_create(int);
> + extern SVCXPRT *svcudp6_bufcreate(int, u_int, u_int);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> +
> + /*
> +  * Tcp based rpc.
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern SVCXPRT *svctcp_create(int, u_int, u_int);
> + extern SVCXPRT *svctcp6_create(int, u_int, u_int);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Fd based rpc.
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern SVCXPRT *svcfd_create(int, u_int, u_int);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* !_RPC_SVC_SOC_H */
> +diff --git a/tirpc/rpc/xdr.h b/tirpc/rpc/xdr.h
> +index 613fab0..917c067 100644
> +--- a/tirpc/rpc/xdr.h
> ++++ b/tirpc/rpc/xdr.h
> +@@ -40,7 +40,6 @@
> +
> + #ifndef _TIRPC_XDR_H
> + #define _TIRPC_XDR_H
> +-#include <sys/cdefs.h>
> + #include <stdio.h>
> + #include <netinet/in.h>
> +
> +@@ -287,7 +286,9 @@ struct xdr_discrim {
> + /*
> +  * These are the "generic" xdr routines.
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern bool_t xdr_void(void);
> + extern bool_t xdr_int(XDR *, int *);
> + extern bool_t xdr_u_int(XDR *, u_int *);
> +@@ -330,7 +331,9 @@ extern bool_t      xdr_hyper(XDR *, quad_t *);
> + extern bool_t xdr_u_hyper(XDR *, u_quad_t *);
> + extern bool_t xdr_longlong_t(XDR *, quad_t *);
> + extern bool_t xdr_u_longlong_t(XDR *, u_quad_t *);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + /*
> +  * Common opaque bytes objects used by many rpc protocols;
> +@@ -348,7 +351,9 @@ extern bool_t   xdr_netobj(XDR *, struct netobj *);
> +  * These are the public routines for the various implementations of
> +  * xdr streams.
> +  */
> +-__BEGIN_DECLS
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + /* XDR using memory buffers */
> + extern void   xdrmem_create(XDR *, char *, u_int, enum xdr_op);
> +
> +@@ -369,6 +374,8 @@ extern bool_t xdrrec_skiprecord(XDR *);
> + /* true if no more input */
> + extern bool_t xdrrec_eof(XDR *);
> + extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int);
> +-__END_DECLS
> ++#ifdef __cplusplus
> ++}
> ++#endif
> +
> + #endif /* !_TIRPC_XDR_H */
> +--
> +2.2.0
> +
> diff --git a/meta/recipes-extended/libtirpc/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch b/meta/recipes-extended/libtirpc/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch
> new file mode 100644
> index 0000000..4957ac8
> --- /dev/null
> +++ b/meta/recipes-extended/libtirpc/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch
> @@ -0,0 +1,99 @@
> +From 5aff70a8fc06163c4ed5fcc45df4a734447000bd Mon Sep 17 00:00:00 2001
> +From: Natanael Copa <ncopa@alpinelinux.org>
> +Date: Mon, 15 Dec 2014 11:40:20 +0100
> +Subject: [PATCH 4/9] Add configure option to disable DES authentication
> +
> +DES is not good for encryption anymore and some C libraries does not
> +even implement it. We add a --disable-authdes to optionally disable
> +it, but let it be enabled by default for compatibility.
> +
> +This is needed for musl libc.
> +
> +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
> +---
> +Upstream-Status: Pending
> +
> + configure.ac    |  6 ++++++
> + src/Makefile.am | 12 ++++++++++--
> + src/rpc_soc.c   |  2 ++
> + 3 files changed, 18 insertions(+), 2 deletions(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 0180801..e6d3df5 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -15,6 +15,12 @@ if test x$enable_gssapi = xyes; then
> +       AC_SUBST([GSSAPI_CFLAGS])
> +       AC_SUBST([GSSAPI_LIBS])
> + fi
> ++
> ++AC_ARG_ENABLE(authdes,
> ++      [AC_HELP_STRING([--disable-authdes], [Disable DES authentication @<:@default=no@:>@])],
> ++      [],[enable_authdes=yes])
> ++AM_CONDITIONAL(AUTHDES, test x$enable_authdes = xyes)
> ++
> + AC_ARG_ENABLE(ipv6,
> +       [AC_HELP_STRING([--disable-ipv6], [Disable IPv6 support @<:@default=no@:>@])],
> +       [],[enable_ipv6=yes])
> +diff --git a/src/Makefile.am b/src/Makefile.am
> +index de57c8f..26ccbdf 100644
> +--- a/src/Makefile.am
> ++++ b/src/Makefile.am
> +@@ -42,6 +42,7 @@ lib_LTLIBRARIES = libtirpc.la
> + # misunderstanding of the purpose of library versions."
> + #
> + libtirpc_la_LDFLAGS = -lpthread -version-info 1:10:0
> ++libtirpc_la_CFLAGS =
> +
> + libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c clnt_bcast.c \
> +         clnt_dg.c clnt_generic.c clnt_perror.c clnt_raw.c clnt_simple.c \
> +@@ -51,7 +52,7 @@ libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c cln
> +         rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
> +         rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
> +         svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
> +-        auth_time.c auth_des.c authdes_prot.c debug.c
> ++        auth_time.c debug.c
> +
> + ## XDR
> + libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c
> +@@ -60,9 +61,16 @@ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_ref
> + if GSS
> +     libtirpc_la_SOURCES += auth_gss.c authgss_prot.c svc_auth_gss.c
> +     libtirpc_la_LDFLAGS += $(GSSAPI_LIBS)
> +-    libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
> ++    libtirpc_la_CFLAGS += -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
> + endif
> +
> ++## DES authentication
> ++if AUTHDES
> ++    libtirpc_la_SOURCES += auth_des.c authdes_prot.c
> ++    libtirpc_la_CFLAGS += -DHAVE_AUTHDES
> ++endif
> ++
> ++
> + ## libtirpc_a_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
> + ## libtirpc_a_SOURCES += netname.c netnamer.c rpcdname.c \
> + ## libtirpc_a_SOURCES += rtime.c \
> +diff --git a/src/rpc_soc.c b/src/rpc_soc.c
> +index 338edbb..b12b116 100644
> +--- a/src/rpc_soc.c
> ++++ b/src/rpc_soc.c
> +@@ -520,6 +520,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
> +           (resultproc_t) rpc_wrap_bcast, "udp");
> + }
> +
> ++#if HAVE_AUTHDES
> + /*
> +  * Create the client des authentication object. Obsoleted by
> +  * authdes_seccreate().
> +@@ -551,6 +552,7 @@ fallback:
> +       dummy = authdes_seccreate(servername, window, NULL, ckey);
> +       return (dummy);
> + }
> ++#endif
> +
> + /*
> +  * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
> +--
> +2.2.0
> +
> diff --git a/meta/recipes-extended/libtirpc/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch b/meta/recipes-extended/libtirpc/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
> new file mode 100644
> index 0000000..f76678b
> --- /dev/null
> +++ b/meta/recipes-extended/libtirpc/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
> @@ -0,0 +1,35 @@
> +From 90c2dea527d8fd95065e2a10147d050f978fe8a5 Mon Sep 17 00:00:00 2001
> +From: Natanael Copa <ncopa@alpinelinux.org>
> +Date: Thu, 24 Apr 2014 08:58:20 +0200
> +Subject: [PATCH 5/9] Fix compile error: 'IPPORT_RESERVED' undeclared
> +
> +The IPPORT_RESERVED is declared in netdb.h. This fixes the following
> +compile error with musl libc:
> +
> +bindresvport.c: In function 'bindresvport_sa':
> +bindresvport.c:67:18: error: 'IPPORT_RESERVED' undeclared (first use in
> +this function)
> + #define ENDPORT (IPPORT_RESERVED - 1)
> +                   ^
> +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
> +---
> +Upstream-Status: Pending
> +
> + src/bindresvport.c | 1 +
> + 1 file changed, 1 insertion(+)
> +
> +diff --git a/src/bindresvport.c b/src/bindresvport.c
> +index 950fbd1..2d8f2bc 100644
> +--- a/src/bindresvport.c
> ++++ b/src/bindresvport.c
> +@@ -36,6 +36,7 @@
> + #include <sys/types.h>
> + #include <sys/socket.h>
> +
> ++#include <netdb.h>
> + #include <netinet/in.h>
> +
> + #include <errno.h>
> +--
> +2.2.0
> +
> diff --git a/meta/recipes-extended/libtirpc/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch b/meta/recipes-extended/libtirpc/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch
> new file mode 100644
> index 0000000..21911f5
> --- /dev/null
> +++ b/meta/recipes-extended/libtirpc/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch
> @@ -0,0 +1,50 @@
> +From 182305b99d3a63b6caf72fe5abba3fb88ebea679 Mon Sep 17 00:00:00 2001
> +From: Natanael Copa <ncopa@alpinelinux.org>
> +Date: Mon, 15 Dec 2014 14:55:37 +0100
> +Subject: [PATCH 6/9] Define struct rpcent on non GNU libc
> +
> +This fixes the following compile error with musl libc:
> +getrpcent.c:65:16: error: field 'rpc' has incomplete type
> +  struct rpcent rpc;
> +                ^
> +
> +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
> +---
> +Upstream-Status: Pending
> +
> +This patch could probably be better. It assumes that only GNU libc has
> +the rpcent struct defined, but the BSDs probably has it too.
> +
> +I am not sure if uClibc has it, but uClibc does define __GLIBC__ so it
> +might be broken there too.
> +
> +I looked into using AC_CHECK_MEMBER but I don't think it is a good idea
> +so depend on config.h since this is a header that will be installed on
> +the system.
> +
> +I also found out that struct rpcent is also defined in
> +/usr/include/gssrpc/netdb.h but I am unsure if we can depend on that
> +too since GSS is optional.
> +
> +So I am a bit in doubt what the proper fix is. Meanwhile, this works
> +for musl libc.
> +
> + tirpc/rpc/rpcent.h | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
> +index 6619cd3..147f909 100644
> +--- a/tirpc/rpc/rpcent.h
> ++++ b/tirpc/rpc/rpcent.h
> +@@ -49,7 +49,7 @@ extern "C" {
> + #endif
> +
> + /* These are defined in /usr/include/rpc/netdb.h */
> +-#if 0
> ++#if !defined(__GLIBC__)
> + struct rpcent {
> +       char    *r_name;        /* name of server for this rpc program */
> +       char    **r_aliases;    /* alias list */
> +--
> +2.2.0
> +
> diff --git a/meta/recipes-extended/libtirpc/libtirpc/0007-use-bsd-queue.patch b/meta/recipes-extended/libtirpc/libtirpc/0007-use-bsd-queue.patch
> new file mode 100644
> index 0000000..d717de7
> --- /dev/null
> +++ b/meta/recipes-extended/libtirpc/libtirpc/0007-use-bsd-queue.patch
> @@ -0,0 +1,561 @@
> +Add missing file from musl
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Upstream-Status: Pending
> +
> +Index: libtirpc-0.2.5/src/bsdqueue.h
> +===================================================================
> +--- /dev/null
> ++++ libtirpc-0.2.5/src/bsdqueue.h
> +@@ -0,0 +1,531 @@
> ++/*    $OpenBSD: queue.h,v 1.31 2005/11/25 08:06:25 otto Exp $ */
> ++/*    $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $       */
> ++
> ++/*
> ++ * Copyright (c) 1991, 1993
> ++ *    The Regents of the University of California.  All rights reserved.
> ++ *
> ++ * Redistribution and use in source and binary forms, with or without
> ++ * modification, are permitted provided that the following conditions
> ++ * are met:
> ++ * 1. Redistributions of source code must retain the above copyright
> ++ *    notice, this list of conditions and the following disclaimer.
> ++ * 2. Redistributions in binary form must reproduce the above copyright
> ++ *    notice, this list of conditions and the following disclaimer in the
> ++ *    documentation and/or other materials provided with the distribution.
> ++ * 3. Neither the name of the University nor the names of its contributors
> ++ *    may be used to endorse or promote products derived from this software
> ++ *    without specific prior written permission.
> ++ *
> ++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
> ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> ++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
> ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> ++ * SUCH DAMAGE.
> ++ *
> ++ *    @(#)queue.h     8.5 (Berkeley) 8/20/94
> ++ */
> ++
> ++#ifndef       _SYS_QUEUE_H_
> ++#define       _SYS_QUEUE_H_
> ++
> ++/*
> ++ * This file defines five types of data structures: singly-linked lists,
> ++ * lists, simple queues, tail queues, and circular queues.
> ++ *
> ++ *
> ++ * A singly-linked list is headed by a single forward pointer. The elements
> ++ * are singly linked for minimum space and pointer manipulation overhead at
> ++ * the expense of O(n) removal for arbitrary elements. New elements can be
> ++ * added to the list after an existing element or at the head of the list.
> ++ * Elements being removed from the head of the list should use the explicit
> ++ * macro for this purpose for optimum efficiency. A singly-linked list may
> ++ * only be traversed in the forward direction.  Singly-linked lists are ideal
> ++ * for applications with large datasets and few or no removals or for
> ++ * implementing a LIFO queue.
> ++ *
> ++ * A list is headed by a single forward pointer (or an array of forward
> ++ * pointers for a hash table header). The elements are doubly linked
> ++ * so that an arbitrary element can be removed without a need to
> ++ * traverse the list. New elements can be added to the list before
> ++ * or after an existing element or at the head of the list. A list
> ++ * may only be traversed in the forward direction.
> ++ *
> ++ * A simple queue is headed by a pair of pointers, one the head of the
> ++ * list and the other to the tail of the list. The elements are singly
> ++ * linked to save space, so elements can only be removed from the
> ++ * head of the list. New elements can be added to the list before or after
> ++ * an existing element, at the head of the list, or at the end of the
> ++ * list. A simple queue may only be traversed in the forward direction.
> ++ *
> ++ * A tail queue is headed by a pair of pointers, one to the head of the
> ++ * list and the other to the tail of the list. The elements are doubly
> ++ * linked so that an arbitrary element can be removed without a need to
> ++ * traverse the list. New elements can be added to the list before or
> ++ * after an existing element, at the head of the list, or at the end of
> ++ * the list. A tail queue may be traversed in either direction.
> ++ *
> ++ * A circle queue is headed by a pair of pointers, one to the head of the
> ++ * list and the other to the tail of the list. The elements are doubly
> ++ * linked so that an arbitrary element can be removed without a need to
> ++ * traverse the list. New elements can be added to the list before or after
> ++ * an existing element, at the head of the list, or at the end of the list.
> ++ * A circle queue may be traversed in either direction, but has a more
> ++ * complex end of list detection.
> ++ *
> ++ * For details on the use of these macros, see the queue(3) manual page.
> ++ */
> ++
> ++#ifdef QUEUE_MACRO_DEBUG
> ++#define _Q_INVALIDATE(a) (a) = ((void *)-1)
> ++#else
> ++#define _Q_INVALIDATE(a)
> ++#endif
> ++
> ++/*
> ++ * Singly-linked List definitions.
> ++ */
> ++#define SLIST_HEAD(name, type)                                                \
> ++struct name {                                                         \
> ++      struct type *slh_first; /* first element */                     \
> ++}
> ++
> ++#define       SLIST_HEAD_INITIALIZER(head)                                    \
> ++      { NULL }
> ++
> ++#ifdef SLIST_ENTRY
> ++#undef SLIST_ENTRY
> ++#endif
> ++
> ++#define SLIST_ENTRY(type)                                             \
> ++struct {                                                              \
> ++      struct type *sle_next;  /* next element */                      \
> ++}
> ++
> ++/*
> ++ * Singly-linked List access methods.
> ++ */
> ++#define       SLIST_FIRST(head)       ((head)->slh_first)
> ++#define       SLIST_END(head)         NULL
> ++#define       SLIST_EMPTY(head)       (SLIST_FIRST(head) == SLIST_END(head))
> ++#define       SLIST_NEXT(elm, field)  ((elm)->field.sle_next)
> ++
> ++#define       SLIST_FOREACH(var, head, field)                                 \
> ++      for((var) = SLIST_FIRST(head);                                  \
> ++          (var) != SLIST_END(head);                                   \
> ++          (var) = SLIST_NEXT(var, field))
> ++
> ++#define       SLIST_FOREACH_PREVPTR(var, varp, head, field)                   \
> ++      for ((varp) = &SLIST_FIRST((head));                             \
> ++          ((var) = *(varp)) != SLIST_END(head);                       \
> ++          (varp) = &SLIST_NEXT((var), field))
> ++
> ++/*
> ++ * Singly-linked List functions.
> ++ */
> ++#define       SLIST_INIT(head) {                                              \
> ++      SLIST_FIRST(head) = SLIST_END(head);                            \
> ++}
> ++
> ++#define       SLIST_INSERT_AFTER(slistelm, elm, field) do {                   \
> ++      (elm)->field.sle_next = (slistelm)->field.sle_next;             \
> ++      (slistelm)->field.sle_next = (elm);                             \
> ++} while (0)
> ++
> ++#define       SLIST_INSERT_HEAD(head, elm, field) do {                        \
> ++      (elm)->field.sle_next = (head)->slh_first;                      \
> ++      (head)->slh_first = (elm);                                      \
> ++} while (0)
> ++
> ++#define       SLIST_REMOVE_NEXT(head, elm, field) do {                        \
> ++      (elm)->field.sle_next = (elm)->field.sle_next->field.sle_next;  \
> ++} while (0)
> ++
> ++#define       SLIST_REMOVE_HEAD(head, field) do {                             \
> ++      (head)->slh_first = (head)->slh_first->field.sle_next;          \
> ++} while (0)
> ++
> ++#define SLIST_REMOVE(head, elm, type, field) do {                     \
> ++      if ((head)->slh_first == (elm)) {                               \
> ++              SLIST_REMOVE_HEAD((head), field);                       \
> ++      } else {                                                        \
> ++              struct type *curelm = (head)->slh_first;                \
> ++                                                                      \
> ++              while (curelm->field.sle_next != (elm))                 \
> ++                      curelm = curelm->field.sle_next;                \
> ++              curelm->field.sle_next =                                \
> ++                  curelm->field.sle_next->field.sle_next;             \
> ++              _Q_INVALIDATE((elm)->field.sle_next);                   \
> ++      }                                                               \
> ++} while (0)
> ++
> ++/*
> ++ * List definitions.
> ++ */
> ++#define LIST_HEAD(name, type)                                         \
> ++struct name {                                                         \
> ++      struct type *lh_first;  /* first element */                     \
> ++}
> ++
> ++#define LIST_HEAD_INITIALIZER(head)                                   \
> ++      { NULL }
> ++
> ++#define LIST_ENTRY(type)                                              \
> ++struct {                                                              \
> ++      struct type *le_next;   /* next element */                      \
> ++      struct type **le_prev;  /* address of previous next element */  \
> ++}
> ++
> ++/*
> ++ * List access methods
> ++ */
> ++#define       LIST_FIRST(head)                ((head)->lh_first)
> ++#define       LIST_END(head)                  NULL
> ++#define       LIST_EMPTY(head)                (LIST_FIRST(head) == LIST_END(head))
> ++#define       LIST_NEXT(elm, field)           ((elm)->field.le_next)
> ++
> ++#define LIST_FOREACH(var, head, field)                                        \
> ++      for((var) = LIST_FIRST(head);                                   \
> ++          (var)!= LIST_END(head);                                     \
> ++          (var) = LIST_NEXT(var, field))
> ++
> ++/*
> ++ * List functions.
> ++ */
> ++#define       LIST_INIT(head) do {                                            \
> ++      LIST_FIRST(head) = LIST_END(head);                              \
> ++} while (0)
> ++
> ++#define LIST_INSERT_AFTER(listelm, elm, field) do {                   \
> ++      if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)  \
> ++              (listelm)->field.le_next->field.le_prev =               \
> ++                  &(elm)->field.le_next;                              \
> ++      (listelm)->field.le_next = (elm);                               \
> ++      (elm)->field.le_prev = &(listelm)->field.le_next;               \
> ++} while (0)
> ++
> ++#define       LIST_INSERT_BEFORE(listelm, elm, field) do {                    \
> ++      (elm)->field.le_prev = (listelm)->field.le_prev;                \
> ++      (elm)->field.le_next = (listelm);                               \
> ++      *(listelm)->field.le_prev = (elm);                              \
> ++      (listelm)->field.le_prev = &(elm)->field.le_next;               \
> ++} while (0)
> ++
> ++#define LIST_INSERT_HEAD(head, elm, field) do {                               \
> ++      if (((elm)->field.le_next = (head)->lh_first) != NULL)          \
> ++              (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
> ++      (head)->lh_first = (elm);                                       \
> ++      (elm)->field.le_prev = &(head)->lh_first;                       \
> ++} while (0)
> ++
> ++#define LIST_REMOVE(elm, field) do {                                  \
> ++      if ((elm)->field.le_next != NULL)                               \
> ++              (elm)->field.le_next->field.le_prev =                   \
> ++                  (elm)->field.le_prev;                               \
> ++      *(elm)->field.le_prev = (elm)->field.le_next;                   \
> ++      _Q_INVALIDATE((elm)->field.le_prev);                            \
> ++      _Q_INVALIDATE((elm)->field.le_next);                            \
> ++} while (0)
> ++
> ++#define LIST_REPLACE(elm, elm2, field) do {                           \
> ++      if (((elm2)->field.le_next = (elm)->field.le_next) != NULL)     \
> ++              (elm2)->field.le_next->field.le_prev =                  \
> ++                  &(elm2)->field.le_next;                             \
> ++      (elm2)->field.le_prev = (elm)->field.le_prev;                   \
> ++      *(elm2)->field.le_prev = (elm2);                                \
> ++      _Q_INVALIDATE((elm)->field.le_prev);                            \
> ++      _Q_INVALIDATE((elm)->field.le_next);                            \
> ++} while (0)
> ++
> ++/*
> ++ * Simple queue definitions.
> ++ */
> ++#define SIMPLEQ_HEAD(name, type)                                      \
> ++struct name {                                                         \
> ++      struct type *sqh_first; /* first element */                     \
> ++      struct type **sqh_last; /* addr of last next element */         \
> ++}
> ++
> ++#define SIMPLEQ_HEAD_INITIALIZER(head)                                        \
> ++      { NULL, &(head).sqh_first }
> ++
> ++#define SIMPLEQ_ENTRY(type)                                           \
> ++struct {                                                              \
> ++      struct type *sqe_next;  /* next element */                      \
> ++}
> ++
> ++/*
> ++ * Simple queue access methods.
> ++ */
> ++#define       SIMPLEQ_FIRST(head)         ((head)->sqh_first)
> ++#define       SIMPLEQ_END(head)           NULL
> ++#define       SIMPLEQ_EMPTY(head)         (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head))
> ++#define       SIMPLEQ_NEXT(elm, field)    ((elm)->field.sqe_next)
> ++
> ++#define SIMPLEQ_FOREACH(var, head, field)                             \
> ++      for((var) = SIMPLEQ_FIRST(head);                                \
> ++          (var) != SIMPLEQ_END(head);                                 \
> ++          (var) = SIMPLEQ_NEXT(var, field))
> ++
> ++/*
> ++ * Simple queue functions.
> ++ */
> ++#define       SIMPLEQ_INIT(head) do {                                         \
> ++      (head)->sqh_first = NULL;                                       \
> ++      (head)->sqh_last = &(head)->sqh_first;                          \
> ++} while (0)
> ++
> ++#define SIMPLEQ_INSERT_HEAD(head, elm, field) do {                    \
> ++      if (((elm)->field.sqe_next = (head)->sqh_first) == NULL)        \
> ++              (head)->sqh_last = &(elm)->field.sqe_next;              \
> ++      (head)->sqh_first = (elm);                                      \
> ++} while (0)
> ++
> ++#define SIMPLEQ_INSERT_TAIL(head, elm, field) do {                    \
> ++      (elm)->field.sqe_next = NULL;                                   \
> ++      *(head)->sqh_last = (elm);                                      \
> ++      (head)->sqh_last = &(elm)->field.sqe_next;                      \
> ++} while (0)
> ++
> ++#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do {          \
> ++      if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
> ++              (head)->sqh_last = &(elm)->field.sqe_next;              \
> ++      (listelm)->field.sqe_next = (elm);                              \
> ++} while (0)
> ++
> ++#define SIMPLEQ_REMOVE_HEAD(head, field) do {                 \
> ++      if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
> ++              (head)->sqh_last = &(head)->sqh_first;                  \
> ++} while (0)
> ++
> ++/*
> ++ * Tail queue definitions.
> ++ */
> ++#define TAILQ_HEAD(name, type)                                                \
> ++struct name {                                                         \
> ++      struct type *tqh_first; /* first element */                     \
> ++      struct type **tqh_last; /* addr of last next element */         \
> ++}
> ++
> ++#define TAILQ_HEAD_INITIALIZER(head)                                  \
> ++      { NULL, &(head).tqh_first }
> ++
> ++#define TAILQ_ENTRY(type)                                             \
> ++struct {                                                              \
> ++      struct type *tqe_next;  /* next element */                      \
> ++      struct type **tqe_prev; /* address of previous next element */  \
> ++}
> ++
> ++/*
> ++ * tail queue access methods
> ++ */
> ++#define       TAILQ_FIRST(head)               ((head)->tqh_first)
> ++#define       TAILQ_END(head)                 NULL
> ++#define       TAILQ_NEXT(elm, field)          ((elm)->field.tqe_next)
> ++#define TAILQ_LAST(head, headname)                                    \
> ++      (*(((struct headname *)((head)->tqh_last))->tqh_last))
> ++/* XXX */
> ++#define TAILQ_PREV(elm, headname, field)                              \
> ++      (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
> ++#define       TAILQ_EMPTY(head)                                               \
> ++      (TAILQ_FIRST(head) == TAILQ_END(head))
> ++
> ++#define TAILQ_FOREACH(var, head, field)                                       \
> ++      for((var) = TAILQ_FIRST(head);                                  \
> ++          (var) != TAILQ_END(head);                                   \
> ++          (var) = TAILQ_NEXT(var, field))
> ++
> ++#define TAILQ_FOREACH_REVERSE(var, head, headname, field)             \
> ++      for((var) = TAILQ_LAST(head, headname);                         \
> ++          (var) != TAILQ_END(head);                                   \
> ++          (var) = TAILQ_PREV(var, headname, field))
> ++
> ++/*
> ++ * Tail queue functions.
> ++ */
> ++#define       TAILQ_INIT(head) do {                                           \
> ++      (head)->tqh_first = NULL;                                       \
> ++      (head)->tqh_last = &(head)->tqh_first;                          \
> ++} while (0)
> ++
> ++#define TAILQ_INSERT_HEAD(head, elm, field) do {                      \
> ++      if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)        \
> ++              (head)->tqh_first->field.tqe_prev =                     \
> ++                  &(elm)->field.tqe_next;                             \
> ++      else                                                            \
> ++              (head)->tqh_last = &(elm)->field.tqe_next;              \
> ++      (head)->tqh_first = (elm);                                      \
> ++      (elm)->field.tqe_prev = &(head)->tqh_first;                     \
> ++} while (0)
> ++
> ++#define TAILQ_INSERT_TAIL(head, elm, field) do {                      \
> ++      (elm)->field.tqe_next = NULL;                                   \
> ++      (elm)->field.tqe_prev = (head)->tqh_last;                       \
> ++      *(head)->tqh_last = (elm);                                      \
> ++      (head)->tqh_last = &(elm)->field.tqe_next;                      \
> ++} while (0)
> ++
> ++#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do {            \
> ++      if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
> ++              (elm)->field.tqe_next->field.tqe_prev =                 \
> ++                  &(elm)->field.tqe_next;                             \
> ++      else                                                            \
> ++              (head)->tqh_last = &(elm)->field.tqe_next;              \
> ++      (listelm)->field.tqe_next = (elm);                              \
> ++      (elm)->field.tqe_prev = &(listelm)->field.tqe_next;             \
> ++} while (0)
> ++
> ++#define       TAILQ_INSERT_BEFORE(listelm, elm, field) do {                   \
> ++      (elm)->field.tqe_prev = (listelm)->field.tqe_prev;              \
> ++      (elm)->field.tqe_next = (listelm);                              \
> ++      *(listelm)->field.tqe_prev = (elm);                             \
> ++      (listelm)->field.tqe_prev = &(elm)->field.tqe_next;             \
> ++} while (0)
> ++
> ++#define TAILQ_REMOVE(head, elm, field) do {                           \
> ++      if (((elm)->field.tqe_next) != NULL)                            \
> ++              (elm)->field.tqe_next->field.tqe_prev =                 \
> ++                  (elm)->field.tqe_prev;                              \
> ++      else                                                            \
> ++              (head)->tqh_last = (elm)->field.tqe_prev;               \
> ++      *(elm)->field.tqe_prev = (elm)->field.tqe_next;                 \
> ++      _Q_INVALIDATE((elm)->field.tqe_prev);                           \
> ++      _Q_INVALIDATE((elm)->field.tqe_next);                           \
> ++} while (0)
> ++
> ++#define TAILQ_REPLACE(head, elm, elm2, field) do {                    \
> ++      if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL)   \
> ++              (elm2)->field.tqe_next->field.tqe_prev =                \
> ++                  &(elm2)->field.tqe_next;                            \
> ++      else                                                            \
> ++              (head)->tqh_last = &(elm2)->field.tqe_next;             \
> ++      (elm2)->field.tqe_prev = (elm)->field.tqe_prev;                 \
> ++      *(elm2)->field.tqe_prev = (elm2);                               \
> ++      _Q_INVALIDATE((elm)->field.tqe_prev);                           \
> ++      _Q_INVALIDATE((elm)->field.tqe_next);                           \
> ++} while (0)
> ++
> ++/*
> ++ * Circular queue definitions.
> ++ */
> ++#define CIRCLEQ_HEAD(name, type)                                      \
> ++struct name {                                                         \
> ++      struct type *cqh_first;         /* first element */             \
> ++      struct type *cqh_last;          /* last element */              \
> ++}
> ++
> ++#define CIRCLEQ_HEAD_INITIALIZER(head)                                        \
> ++      { CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
> ++
> ++#define CIRCLEQ_ENTRY(type)                                           \
> ++struct {                                                              \
> ++      struct type *cqe_next;          /* next element */              \
> ++      struct type *cqe_prev;          /* previous element */          \
> ++}
> ++
> ++/*
> ++ * Circular queue access methods
> ++ */
> ++#define       CIRCLEQ_FIRST(head)             ((head)->cqh_first)
> ++#define       CIRCLEQ_LAST(head)              ((head)->cqh_last)
> ++#define       CIRCLEQ_END(head)               ((void *)(head))
> ++#define       CIRCLEQ_NEXT(elm, field)        ((elm)->field.cqe_next)
> ++#define       CIRCLEQ_PREV(elm, field)        ((elm)->field.cqe_prev)
> ++#define       CIRCLEQ_EMPTY(head)                                             \
> ++      (CIRCLEQ_FIRST(head) == CIRCLEQ_END(head))
> ++
> ++#define CIRCLEQ_FOREACH(var, head, field)                             \
> ++      for((var) = CIRCLEQ_FIRST(head);                                \
> ++          (var) != CIRCLEQ_END(head);                                 \
> ++          (var) = CIRCLEQ_NEXT(var, field))
> ++
> ++#define CIRCLEQ_FOREACH_REVERSE(var, head, field)                     \
> ++      for((var) = CIRCLEQ_LAST(head);                                 \
> ++          (var) != CIRCLEQ_END(head);                                 \
> ++          (var) = CIRCLEQ_PREV(var, field))
> ++
> ++/*
> ++ * Circular queue functions.
> ++ */
> ++#define       CIRCLEQ_INIT(head) do {                                         \
> ++      (head)->cqh_first = CIRCLEQ_END(head);                          \
> ++      (head)->cqh_last = CIRCLEQ_END(head);                           \
> ++} while (0)
> ++
> ++#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do {          \
> ++      (elm)->field.cqe_next = (listelm)->field.cqe_next;              \
> ++      (elm)->field.cqe_prev = (listelm);                              \
> ++      if ((listelm)->field.cqe_next == CIRCLEQ_END(head))             \
> ++              (head)->cqh_last = (elm);                               \
> ++      else                                                            \
> ++              (listelm)->field.cqe_next->field.cqe_prev = (elm);      \
> ++      (listelm)->field.cqe_next = (elm);                              \
> ++} while (0)
> ++
> ++#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do {         \
> ++      (elm)->field.cqe_next = (listelm);                              \
> ++      (elm)->field.cqe_prev = (listelm)->field.cqe_prev;              \
> ++      if ((listelm)->field.cqe_prev == CIRCLEQ_END(head))             \
> ++              (head)->cqh_first = (elm);                              \
> ++      else                                                            \
> ++              (listelm)->field.cqe_prev->field.cqe_next = (elm);      \
> ++      (listelm)->field.cqe_prev = (elm);                              \
> ++} while (0)
> ++
> ++#define CIRCLEQ_INSERT_HEAD(head, elm, field) do {                    \
> ++      (elm)->field.cqe_next = (head)->cqh_first;                      \
> ++      (elm)->field.cqe_prev = CIRCLEQ_END(head);                      \
> ++      if ((head)->cqh_last == CIRCLEQ_END(head))                      \
> ++              (head)->cqh_last = (elm);                               \
> ++      else                                                            \
> ++              (head)->cqh_first->field.cqe_prev = (elm);              \
> ++      (head)->cqh_first = (elm);                                      \
> ++} while (0)
> ++
> ++#define CIRCLEQ_INSERT_TAIL(head, elm, field) do {                    \
> ++      (elm)->field.cqe_next = CIRCLEQ_END(head);                      \
> ++      (elm)->field.cqe_prev = (head)->cqh_last;                       \
> ++      if ((head)->cqh_first == CIRCLEQ_END(head))                     \
> ++              (head)->cqh_first = (elm);                              \
> ++      else                                                            \
> ++              (head)->cqh_last->field.cqe_next = (elm);               \
> ++      (head)->cqh_last = (elm);                                       \
> ++} while (0)
> ++
> ++#define       CIRCLEQ_REMOVE(head, elm, field) do {                           \
> ++      if ((elm)->field.cqe_next == CIRCLEQ_END(head))                 \
> ++              (head)->cqh_last = (elm)->field.cqe_prev;               \
> ++      else                                                            \
> ++              (elm)->field.cqe_next->field.cqe_prev =                 \
> ++                  (elm)->field.cqe_prev;                              \
> ++      if ((elm)->field.cqe_prev == CIRCLEQ_END(head))                 \
> ++              (head)->cqh_first = (elm)->field.cqe_next;              \
> ++      else                                                            \
> ++              (elm)->field.cqe_prev->field.cqe_next =                 \
> ++                  (elm)->field.cqe_next;                              \
> ++      _Q_INVALIDATE((elm)->field.cqe_prev);                           \
> ++      _Q_INVALIDATE((elm)->field.cqe_next);                           \
> ++} while (0)
> ++
> ++#define CIRCLEQ_REPLACE(head, elm, elm2, field) do {                  \
> ++      if (((elm2)->field.cqe_next = (elm)->field.cqe_next) ==         \
> ++          CIRCLEQ_END(head))                                          \
> ++              (head).cqh_last = (elm2);                               \
> ++      else                                                            \
> ++              (elm2)->field.cqe_next->field.cqe_prev = (elm2);        \
> ++      if (((elm2)->field.cqe_prev = (elm)->field.cqe_prev) ==         \
> ++          CIRCLEQ_END(head))                                          \
> ++              (head).cqh_first = (elm2);                              \
> ++      else                                                            \
> ++              (elm2)->field.cqe_prev->field.cqe_next = (elm2);        \
> ++      _Q_INVALIDATE((elm)->field.cqe_prev);                           \
> ++      _Q_INVALIDATE((elm)->field.cqe_next);                           \
> ++} while (0)
> ++
> ++#endif        /* !_SYS_QUEUE_H_ */
> +Index: libtirpc-0.2.5/src/clnt_bcast.c
> +===================================================================
> +--- libtirpc-0.2.5.orig/src/clnt_bcast.c
> ++++ libtirpc-0.2.5/src/clnt_bcast.c
> +@@ -40,7 +40,6 @@
> +  */
> + #include <sys/socket.h>
> + #include <sys/types.h>
> +-#include <sys/queue.h>
> +
> + #include <net/if.h>
> + #include <netinet/in.h>
> +@@ -64,6 +63,7 @@
> +
> + #include "rpc_com.h"
> + #include "debug.h"
> ++#include "bsdqueue.h"
> +
> + #define       MAXBCAST 20     /* Max no of broadcasting transports */
> + #define       INITTIME 4000   /* Time to wait initially */
> diff --git a/meta/recipes-extended/libtirpc/libtirpc/nis.h b/meta/recipes-extended/libtirpc/libtirpc/nis.h
> new file mode 100644
> index 0000000..8e29596
> --- /dev/null
> +++ b/meta/recipes-extended/libtirpc/libtirpc/nis.h
> @@ -0,0 +1,545 @@
> +/*
> + * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
> + * unrestricted use provided that this legend is included on all tape
> + * media and as a part of the software program in whole or part.  Users
> + * may copy or modify Sun RPC without charge, but are not authorized
> + * to license or distribute it to anyone else except as part of a product or
> + * program developed by the user or with the express written consent of
> + * Sun Microsystems, Inc.
> + *
> + * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
> + * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
> + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
> + *
> + * Sun RPC is provided with no support and without any obligation on the
> + * part of Sun Microsystems, Inc. to assist in its use, correction,
> + * modification or enhancement.
> + *
> + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
> + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
> + * OR ANY PART THEREOF.
> + *
> + * In no event will Sun Microsystems, Inc. be liable for any lost revenue
> + * or profits or other special, indirect and consequential damages, even if
> + * Sun has been advised of the possibility of such damages.
> + *
> + * Sun Microsystems, Inc.
> + * 2550 Garcia Avenue
> + * Mountain View, California  94043
> + */
> +
> +#ifndef _RPCSVC_NIS_H
> +#define _RPCSVC_NIS_H 1
> +
> +#include <features.h>
> +//#include <rpc/rpc.h>
> +//#include <rpcsvc/nis_tags.h>
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +/*
> + *     nis.h
> + *
> + *     This file is the main include file for NIS clients. It contains
> + *     both the client library function defines and the various data
> + *     structures used by the NIS service. It includes the file nis_tags.h
> + *     which defines the tag values. This allows the tags to change without
> + *     having to change the nis.x file.
> + *
> + *     NOTE : THIS FILE IS NOT GENERATED WITH RPCGEN ! SO YOU HAVE TO
> + *             ADD ALL THE CHANGES ON nis_*.x FILES HERE AGAIN !
> + *
> + *      I have removed all the Solaris internal structs and variables,
> + *      because they are not supported, Sun changed them between various
> + *      releases and they shouldn't be used in user programs.
> + *                                              <kukuk@suse.de>
> + */
> +
> +
> +#ifndef __nis_object_h
> +#define __nis_object_h
> +
> +#define NIS_MAXSTRINGLEN 255
> +#define NIS_MAXNAMELEN 1024
> +#define NIS_MAXATTRNAME 32
> +#define NIS_MAXATTRVAL 2048
> +#define NIS_MAXCOLUMNS 64
> +#define NIS_MAXATTR 16
> +#define NIS_MAXPATH 1024
> +#define NIS_MAXREPLICAS 128
> +#define NIS_MAXLINKS 16
> +#define NIS_PK_NONE 0
> +#define NIS_PK_DH 1
> +#define NIS_PK_RSA 2
> +#define NIS_PK_KERB 3
> +#define NIS_PK_DHEXT 4
> +
> +struct nis_attr {
> +       char *zattr_ndx;
> +       struct {
> +               u_int zattr_val_len;
> +               char *zattr_val_val;
> +       } zattr_val;
> +};
> +typedef struct nis_attr nis_attr;
> +
> +typedef char *nis_name;
> +
> +enum zotypes {
> +       BOGUS_OBJ = 0,
> +       NO_OBJ = 1,
> +       DIRECTORY_OBJ = 2,
> +       GROUP_OBJ = 3,
> +       TABLE_OBJ = 4,
> +       ENTRY_OBJ = 5,
> +       LINK_OBJ = 6,
> +       PRIVATE_OBJ = 7,
> +       NIS_BOGUS_OBJ = 0,
> +       NIS_NO_OBJ = 1,
> +       NIS_DIRECTORY_OBJ = 2,
> +       NIS_GROUP_OBJ = 3,
> +       NIS_TABLE_OBJ = 4,
> +       NIS_ENTRY_OBJ = 5,
> +       NIS_LINK_OBJ = 6,
> +       NIS_PRIVATE_OBJ = 7
> +};
> +typedef enum zotypes zotypes;
> +
> +enum nstype {
> +       UNKNOWN = 0,
> +       NIS = 1,
> +       SUNYP = 2,
> +       IVY = 3,
> +       DNS = 4,
> +       X500 = 5,
> +       DNANS = 6,
> +       XCHS = 7,
> +       CDS = 8,
> +};
> +typedef enum nstype nstype;
> +
> +struct oar_mask {
> +        uint32_t oa_rights;
> +        zotypes oa_otype;
> +};
> +typedef struct oar_mask oar_mask;
> +
> +struct endpoint {
> +       char *uaddr;
> +       char *family;
> +       char *proto;
> +};
> +typedef struct endpoint endpoint;
> +
> +struct nis_server {
> +       nis_name name;
> +       struct {
> +               u_int ep_len;
> +               endpoint *ep_val;
> +       } ep;
> +       uint32_t key_type;
> +       netobj pkey;
> +};
> +typedef struct nis_server nis_server;
> +
> +struct directory_obj {
> +       nis_name do_name;
> +       nstype do_type;
> +       struct {
> +               u_int do_servers_len;
> +               nis_server *do_servers_val;
> +       } do_servers;
> +       uint32_t do_ttl;
> +       struct {
> +               u_int do_armask_len;
> +               oar_mask *do_armask_val;
> +       } do_armask;
> +};
> +typedef struct directory_obj directory_obj;
> +
> +#define EN_BINARY 1
> +#define EN_CRYPT 2
> +#define EN_XDR 4
> +#define EN_MODIFIED 8
> +#define EN_ASN1 64
> +
> +struct entry_col {
> +       uint32_t ec_flags;
> +       struct {
> +               u_int ec_value_len;
> +               char *ec_value_val;
> +       } ec_value;
> +};
> +typedef struct entry_col entry_col;
> +
> +struct entry_obj {
> +       char *en_type;
> +       struct {
> +               u_int en_cols_len;
> +               entry_col *en_cols_val;
> +       } en_cols;
> +};
> +typedef struct entry_obj entry_obj;
> +
> +struct group_obj {
> +       uint32_t gr_flags;
> +       struct {
> +               u_int gr_members_len;
> +               nis_name *gr_members_val;
> +       } gr_members;
> +};
> +typedef struct group_obj group_obj;
> +
> +struct link_obj {
> +       zotypes li_rtype;
> +       struct {
> +               u_int li_attrs_len;
> +               nis_attr *li_attrs_val;
> +       } li_attrs;
> +       nis_name li_name;
> +};
> +typedef struct link_obj link_obj;
> +
> +#define TA_BINARY 1
> +#define TA_CRYPT 2
> +#define TA_XDR 4
> +#define TA_SEARCHABLE 8
> +#define TA_CASE 16
> +#define TA_MODIFIED 32
> +#define TA_ASN1 64
> +
> +struct table_col {
> +       char *tc_name;
> +       uint32_t tc_flags;
> +       uint32_t tc_rights;
> +};
> +typedef struct table_col table_col;
> +
> +struct table_obj {
> +       char *ta_type;
> +       int ta_maxcol;
> +       u_char ta_sep;
> +       struct {
> +               u_int ta_cols_len;
> +               table_col *ta_cols_val;
> +       } ta_cols;
> +       char *ta_path;
> +};
> +typedef struct table_obj table_obj;
> +
> +struct objdata {
> +       zotypes zo_type;
> +       union {
> +               struct directory_obj di_data;
> +               struct group_obj gr_data;
> +               struct table_obj ta_data;
> +               struct entry_obj en_data;
> +               struct link_obj li_data;
> +               struct {
> +                       u_int po_data_len;
> +                       char *po_data_val;
> +               } po_data;
> +       } objdata_u;
> +};
> +typedef struct objdata objdata;
> +
> +struct nis_oid {
> +       uint32_t ctime;
> +       uint32_t mtime;
> +};
> +typedef struct nis_oid nis_oid;
> +
> +struct nis_object {
> +       nis_oid zo_oid;
> +       nis_name zo_name;
> +       nis_name zo_owner;
> +       nis_name zo_group;
> +       nis_name zo_domain;
> +       uint32_t zo_access;
> +       uint32_t zo_ttl;
> +       objdata zo_data;
> +};
> +typedef struct nis_object nis_object;
> +
> +#endif /* if __nis_object_h */
> +
> +enum nis_error {
> +       NIS_SUCCESS = 0,
> +       NIS_S_SUCCESS = 1,
> +       NIS_NOTFOUND = 2,
> +       NIS_S_NOTFOUND = 3,
> +       NIS_CACHEEXPIRED = 4,
> +       NIS_NAMEUNREACHABLE = 5,
> +       NIS_UNKNOWNOBJ = 6,
> +       NIS_TRYAGAIN = 7,
> +       NIS_SYSTEMERROR = 8,
> +       NIS_CHAINBROKEN = 9,
> +       NIS_PERMISSION = 10,
> +       NIS_NOTOWNER = 11,
> +       NIS_NOT_ME = 12,
> +       NIS_NOMEMORY = 13,
> +       NIS_NAMEEXISTS = 14,
> +       NIS_NOTMASTER = 15,
> +       NIS_INVALIDOBJ = 16,
> +       NIS_BADNAME = 17,
> +       NIS_NOCALLBACK = 18,
> +       NIS_CBRESULTS = 19,
> +       NIS_NOSUCHNAME = 20,
> +       NIS_NOTUNIQUE = 21,
> +       NIS_IBMODERROR = 22,
> +       NIS_NOSUCHTABLE = 23,
> +       NIS_TYPEMISMATCH = 24,
> +       NIS_LINKNAMEERROR = 25,
> +       NIS_PARTIAL = 26,
> +       NIS_TOOMANYATTRS = 27,
> +       NIS_RPCERROR = 28,
> +       NIS_BADATTRIBUTE = 29,
> +       NIS_NOTSEARCHABLE = 30,
> +       NIS_CBERROR = 31,
> +       NIS_FOREIGNNS = 32,
> +       NIS_BADOBJECT = 33,
> +       NIS_NOTSAMEOBJ = 34,
> +       NIS_MODFAIL = 35,
> +       NIS_BADREQUEST = 36,
> +       NIS_NOTEMPTY = 37,
> +       NIS_COLDSTART_ERR = 38,
> +       NIS_RESYNC = 39,
> +       NIS_FAIL = 40,
> +       NIS_UNAVAIL = 41,
> +       NIS_RES2BIG = 42,
> +       NIS_SRVAUTH = 43,
> +       NIS_CLNTAUTH = 44,
> +       NIS_NOFILESPACE = 45,
> +       NIS_NOPROC = 46,
> +       NIS_DUMPLATER = 47,
> +};
> +typedef enum nis_error nis_error;
> +
> +struct nis_result {
> +       nis_error status;
> +       struct {
> +               u_int objects_len;
> +               nis_object *objects_val;
> +       } objects;
> +       netobj cookie;
> +       uint32_t zticks;
> +       uint32_t dticks;
> +       uint32_t aticks;
> +       uint32_t cticks;
> +};
> +typedef struct nis_result nis_result;
> +
> +struct ns_request {
> +       nis_name ns_name;
> +       struct {
> +               u_int ns_object_len;
> +               nis_object *ns_object_val;
> +       } ns_object;
> +};
> +typedef struct ns_request ns_request;
> +
> +struct ib_request {
> +       nis_name ibr_name;
> +       struct {
> +               u_int ibr_srch_len;
> +               nis_attr *ibr_srch_val;
> +       } ibr_srch;
> +       uint32_t ibr_flags;
> +       struct {
> +               u_int ibr_obj_len;
> +               nis_object *ibr_obj_val;
> +       } ibr_obj;
> +       struct {
> +               u_int ibr_cbhost_len;
> +               nis_server *ibr_cbhost_val;
> +       } ibr_cbhost;
> +       u_int ibr_bufsize;
> +       netobj ibr_cookie;
> +};
> +typedef struct ib_request ib_request;
> +
> +struct ping_args {
> +       nis_name dir;
> +       uint32_t stamp;
> +};
> +typedef struct ping_args ping_args;
> +
> +enum log_entry_t {
> +       LOG_NOP = 0,
> +       ADD_NAME = 1,
> +       REM_NAME = 2,
> +       MOD_NAME_OLD = 3,
> +       MOD_NAME_NEW = 4,
> +       ADD_IBASE = 5,
> +       REM_IBASE = 6,
> +       MOD_IBASE = 7,
> +       UPD_STAMP = 8,
> +};
> +typedef enum log_entry_t log_entry_t;
> +
> +struct log_entry {
> +       uint32_t le_time;
> +       log_entry_t le_type;
> +       nis_name le_princp;
> +       nis_name le_name;
> +       struct {
> +               u_int le_attrs_len;
> +               nis_attr *le_attrs_val;
> +       } le_attrs;
> +       nis_object le_object;
> +};
> +typedef struct log_entry log_entry;
> +
> +struct log_result {
> +       nis_error lr_status;
> +       netobj lr_cookie;
> +       struct {
> +               u_int lr_entries_len;
> +               log_entry *lr_entries_val;
> +       } lr_entries;
> +};
> +typedef struct log_result log_result;
> +
> +struct cp_result {
> +       nis_error cp_status;
> +       uint32_t cp_zticks;
> +       uint32_t cp_dticks;
> +};
> +typedef struct cp_result cp_result;
> +
> +struct nis_tag {
> +       uint32_t tag_type;
> +       char *tag_val;
> +};
> +typedef struct nis_tag nis_tag;
> +
> +struct nis_taglist {
> +       struct {
> +               u_int tags_len;
> +               nis_tag *tags_val;
> +       } tags;
> +};
> +typedef struct nis_taglist nis_taglist;
> +
> +struct dump_args {
> +       nis_name da_dir;
> +       uint32_t da_time;
> +       struct {
> +               u_int da_cbhost_len;
> +               nis_server *da_cbhost_val;
> +       } da_cbhost;
> +};
> +typedef struct dump_args dump_args;
> +
> +struct fd_args {
> +       nis_name dir_name;
> +       nis_name requester;
> +};
> +typedef struct fd_args fd_args;
> +
> +struct fd_result {
> +       nis_error status;
> +       nis_name source;
> +       struct {
> +               u_int dir_data_len;
> +               char *dir_data_val;
> +       } dir_data;
> +       struct {
> +               u_int signature_len;
> +               char *signature_val;
> +       } signature;
> +};
> +typedef struct fd_result fd_result;
> +
> +/* Generic client creating flags */
> +#define ZMH_VC         1
> +#define ZMH_DG         2
> +#define ZMH_AUTH       4
> +
> +/* Testing Access rights for objects */
> +
> +#define NIS_READ_ACC           1
> +#define NIS_MODIFY_ACC         2
> +#define NIS_CREATE_ACC         4
> +#define NIS_DESTROY_ACC        8
> +/* Test macros. a == access rights, m == desired rights. */
> +#define NIS_WORLD(a, m)        (((a) & (m)) != 0)
> +#define NIS_GROUP(a, m)        (((a) & ((m) << 8)) != 0)
> +#define NIS_OWNER(a, m)        (((a) & ((m) << 16)) != 0)
> +#define NIS_NOBODY(a, m)       (((a) & ((m) << 24)) != 0)
> +/*
> + * EOL Alert - The following non-prefixed test macros are
> + * here for backward compatability, and will be not be present
> + * in future releases - use the NIS_*() macros above.
> + */
> +#define WORLD(a, m)    (((a) & (m)) != 0)
> +#define GROUP(a, m)    (((a) & ((m) << 8)) != 0)
> +#define OWNER(a, m)    (((a) & ((m) << 16)) != 0)
> +#define NOBODY(a, m)   (((a) & ((m) << 24)) != 0)
> +
> +#define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
> +#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
> +#define WORLD_DEFAULT (NIS_READ_ACC)
> +#define GROUP_DEFAULT (NIS_READ_ACC << 8)
> +#define OWNER_DEFAULT ((NIS_READ_ACC + NIS_MODIFY_ACC + NIS_CREATE_ACC +\
> +                       NIS_DESTROY_ACC) << 16)
> +#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
> +
> +/* Result manipulation defines ... */
> +#define NIS_RES_NUMOBJ(x)      ((x)->objects.objects_len)
> +#define NIS_RES_OBJECT(x)      ((x)->objects.objects_val)
> +#define NIS_RES_COOKIE(x)      ((x)->cookie)
> +#define NIS_RES_STATUS(x)      ((x)->status)
> +
> +/* These defines make getting at the variant part of the object easier. */
> +#define TA_data zo_data.objdata_u.ta_data
> +#define EN_data zo_data.objdata_u.en_data
> +#define DI_data zo_data.objdata_u.di_data
> +#define LI_data zo_data.objdata_u.li_data
> +#define GR_data zo_data.objdata_u.gr_data
> +
> +#define __type_of(o) ((o)->zo_data.zo_type)
> +
> +/* Declarations for the internal subroutines in nislib.c */
> +enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME};
> +typedef enum name_pos name_pos;
> +
> +/*
> + * Defines for getting at column data in entry objects. Because RPCGEN
> + * generates some rather wordy structures, we create some defines that
> + * collapse the needed keystrokes to access a particular value using
> + * these definitions they take an nis_object *, and an int and return
> + * a u_char * for Value, and an int for length.
> + */
> +#define ENTRY_VAL(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
> +#define ENTRY_LEN(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
> +
> +
> +/* Prototypes, and extern declarations for the NIS library functions. */
> +//#include <rpcsvc/nislib.h>
> +#endif
> +
> +/*
> + * nis_3.h
> + *
> + * This file contains definitions that are only of interest to the actual
> + * service daemon and client stubs. Normal users of NIS will not include
> + * this file.
> + *
> + * NOTE : This include file is automatically created by a combination
> + * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
> + * and then remake this file.
> + */
> +#ifndef __nis_3_h
> +#define __nis_3_h
> +
> +#define NIS_PROG 100300
> +#define NIS_VERSION 3
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* ! _RPCSVC_NIS_H */
> diff --git a/meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb b/meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb
> index 330b829..9ee6570 100644
> --- a/meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb
> +++ b/meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb
> @@ -19,6 +19,16 @@ SRC_URI_append_libc-uclibc = " file://remove-des-uclibc.patch \
>                                 file://va_list.patch \
>                               "
>
> +SRC_URI_append_libc-musl = "\
> +            file://0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch \
> +            file://0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch \
> +            file://0004-Add-configure-option-to-disable-DES-authentication.patch \
> +            file://0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch \
> +            file://0006-Define-struct-rpcent-on-non-GNU-libc.patch \
> +            file://0007-use-bsd-queue.patch \
> +            file://nis.h \
> +           "
> +
>  SRC_URI[libtirpc.md5sum] = "8cd41a5ef5a9b50d0fb6abb98af15368"
>  SRC_URI[libtirpc.sha256sum] = "62f9de7c2c8686c568757730e1fef66502a0e00d6cacf33546d0267984e002db"
>  SRC_URI[glibc-nfs.md5sum] = "5ae500b9d0b6b72cb875bc04944b9445"
> @@ -27,11 +37,15 @@ SRC_URI[glibc-nfs.sha256sum] = "2677cfedf626f3f5a8f6e507aed5bb8f79a7453b589d684d
>  inherit autotools pkgconfig
>
>  EXTRA_OECONF = "--disable-gssapi"
> +EXTRA_OECONF_append_libc-musl = " --disable-authdes"
>
>  do_configure_prepend () {
>          cp -r ${S}/../tirpc ${S}
>  }
>
> +do_configure_prepend_libc-musl () {
> +        cp ${WORKDIR}/nis.h ${S}/../tirpc/rpcsvc/nis.h
> +}
>  do_install_append() {
>          chown root:root ${D}${sysconfdir}/netconfig
>  }
> --
> 2.6.4
>


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 00/17] musl fixes phase 2
  2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
                   ` (16 preceding siblings ...)
  2015-12-19 23:52 ` [PATCH 17/17] util-linux: Fix ptest builds on musl Khem Raj
@ 2016-01-07 15:32 ` Burton, Ross
  2016-01-07 16:48   ` Khem Raj
  2016-01-08  9:40   ` Khem Raj
  17 siblings, 2 replies; 35+ messages in thread
From: Burton, Ross @ 2016-01-07 15:32 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1301 bytes --]

Hi Khem,

I just reviewed this series again and there's still some patches that need
tweaking:

On 19 December 2015 at 23:52, Khem Raj <raj.khem@gmail.com> wrote:

> Khem Raj (17):
>   powertop: Include right headers for timval struct
>

Missing Upstream-Status.


>   dhcp: Include sys/types.h for u_int* defs
>

Missing Upstream-Status.


>   blktrace: Include <sys/types.h for dev_t
>

Missing Upstream-Status (Status doesn't count, there's machinery about this
tag now)


>   fts: Add recipe
>

Every patch is missing patch explanation / signed-off-by / upstream-status.

  libcgroup: Add dependency on fts when building on musl
>

The U-S is Pending but the commit isn't from you - was this actually a
backport or just a patch that eg buildroot is carrying?

  linux-libc-headers: Port patches for linux-headers for musl
>

Patches are missing signed-off-by.


>   gdk-pixbuf: Fix latent build  issue exposed by musl
>

This is a test that uses glibc features, so simply changing it to use
malloc isn't right.  This is already fixed upstream properly:
https://git.gnome.org/browse/gdk-pixbuf/commit/tests/pixbuf-lowmem.c?id=205a3b04e1216c1df199aec95185f7f48b8e0491

The rest are merged into ross/mut so can you please rebase onto that.

Ross

[-- Attachment #2: Type: text/html, Size: 3240 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 00/17] musl fixes phase 2
  2016-01-07 15:32 ` [PATCH 00/17] musl fixes phase 2 Burton, Ross
@ 2016-01-07 16:48   ` Khem Raj
  2016-01-08  9:40   ` Khem Raj
  1 sibling, 0 replies; 35+ messages in thread
From: Khem Raj @ 2016-01-07 16:48 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core


[-- Attachment #1.1: Type: text/plain, Size: 1695 bytes --]

Hi Ross

No worries, I will prepare phase3 today at earliest. Where these will be addressed along with new fixes.

Thanks
-Khem

> On Jan 7, 2016, at 7:32 AM, Burton, Ross <ross.burton@intel.com> wrote:
> 
> Hi Khem,
> 
> I just reviewed this series again and there's still some patches that need tweaking:
> 
> On 19 December 2015 at 23:52, Khem Raj <raj.khem@gmail.com <mailto:raj.khem@gmail.com>> wrote:
> Khem Raj (17):
>   powertop: Include right headers for timval struct
> 
> Missing Upstream-Status.
> 
>   dhcp: Include sys/types.h for u_int* defs
> 
> Missing Upstream-Status.
> 
>   blktrace: Include <sys/types.h for dev_t
> 
> Missing Upstream-Status (Status doesn't count, there's machinery about this tag now)
> 
>   fts: Add recipe
> 
> Every patch is missing patch explanation / signed-off-by / upstream-status.
> 
>   libcgroup: Add dependency on fts when building on musl
> 
> The U-S is Pending but the commit isn't from you - was this actually a backport or just a patch that eg buildroot is carrying?
> 
>   linux-libc-headers: Port patches for linux-headers for musl
> 
> Patches are missing signed-off-by.
> 
>   gdk-pixbuf: Fix latent build  issue exposed by musl
> 
> This is a test that uses glibc features, so simply changing it to use malloc isn't right.  This is already fixed upstream properly: https://git.gnome.org/browse/gdk-pixbuf/commit/tests/pixbuf-lowmem.c?id=205a3b04e1216c1df199aec95185f7f48b8e0491 <https://git.gnome.org/browse/gdk-pixbuf/commit/tests/pixbuf-lowmem.c?id=205a3b04e1216c1df199aec95185f7f48b8e0491>
> 
> The rest are merged into ross/mut so can you please rebase onto that.
> 
> Ross
> 
> 


[-- Attachment #1.2: Type: text/html, Size: 4515 bytes --]

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 00/17] musl fixes phase 2
  2016-01-07 15:32 ` [PATCH 00/17] musl fixes phase 2 Burton, Ross
  2016-01-07 16:48   ` Khem Raj
@ 2016-01-08  9:40   ` Khem Raj
  2016-01-08  9:58     ` Burton, Ross
  1 sibling, 1 reply; 35+ messages in thread
From: Khem Raj @ 2016-01-08  9:40 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core


[-- Attachment #1.1: Type: text/plain, Size: 1638 bytes --]


> On Jan 7, 2016, at 7:32 AM, Burton, Ross <ross.burton@intel.com> wrote:
> 
> Hi Khem,
> 
> I just reviewed this series again and there's still some patches that need tweaking:
> 
> On 19 December 2015 at 23:52, Khem Raj <raj.khem@gmail.com <mailto:raj.khem@gmail.com>> wrote:
> Khem Raj (17):
>   powertop: Include right headers for timval struct
> 
> Missing Upstream-Status.
> 
>   dhcp: Include sys/types.h for u_int* defs
> 
> Missing Upstream-Status.
> 
>   blktrace: Include <sys/types.h for dev_t
> 
> Missing Upstream-Status (Status doesn't count, there's machinery about this tag now)
> 
>   fts: Add recipe
> 
> Every patch is missing patch explanation / signed-off-by / upstream-status.
> 
>   libcgroup: Add dependency on fts when building on musl
> 
> The U-S is Pending but the commit isn't from you - was this actually a backport or just a patch that eg buildroot is carrying?

This is a patch from sabotage linux, I have addressed all other issues.

> 
>   linux-libc-headers: Port patches for linux-headers for musl
> 
> Patches are missing signed-off-by.
> 
>   gdk-pixbuf: Fix latent build  issue exposed by musl
> 
> This is a test that uses glibc features, so simply changing it to use malloc isn't right.  This is already fixed upstream properly: https://git.gnome.org/browse/gdk-pixbuf/commit/tests/pixbuf-lowmem.c?id=205a3b04e1216c1df199aec95185f7f48b8e0491 <https://git.gnome.org/browse/gdk-pixbuf/commit/tests/pixbuf-lowmem.c?id=205a3b04e1216c1df199aec95185f7f48b8e0491>
> 
> The rest are merged into ross/mut so can you please rebase onto that.
> 
> Ross
> 
> 


[-- Attachment #1.2: Type: text/html, Size: 4524 bytes --]

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 00/17] musl fixes phase 2
  2016-01-08  9:40   ` Khem Raj
@ 2016-01-08  9:58     ` Burton, Ross
  2016-01-08 10:24       ` Khem Raj
  0 siblings, 1 reply; 35+ messages in thread
From: Burton, Ross @ 2016-01-08  9:58 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 333 bytes --]

On 8 January 2016 at 09:40, Khem Raj <raj.khem@gmail.com> wrote:

> This is a patch from sabotage linux, I have addressed all other issues.
>

Thanks Khem, merged those into my testing branch now.   There's a lot
pending in your branch, do you have an ETA for when the rest of the
muslification patches will be sent?

Ross

[-- Attachment #2: Type: text/html, Size: 766 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 10/17] connman: include config.h for HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR
  2015-12-19 23:52 ` [PATCH 10/17] connman: include config.h for HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR Khem Raj
@ 2016-01-08 10:08   ` Burton, Ross
  0 siblings, 0 replies; 35+ messages in thread
From: Burton, Ross @ 2016-01-08 10:08 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 964 bytes --]

On 19 December 2015 at 23:52, Khem Raj <raj.khem@gmail.com> wrote:

> We now check at configure time of libc has pktinfo struct
>

| In file included from
/data/poky-master/tmp/sysroots/intel-corei7-64/usr/include/linux/if_tun.h:20:0,
|                  from
/data/poky-master/tmp/work/corei7-64-poky-linux-musl/connman/1.30-r0/connman-1.30/src/inet.c:46:
|
/data/poky-master/tmp/sysroots/intel-corei7-64/usr/include/linux/if_ether.h:137:8:
error: redefinition of 'struct ethhdr'
|  struct ethhdr {
|         ^
| In file included from
/data/poky-master/tmp/sysroots/intel-corei7-64/usr/include/net/ethernet.h:10:0,
|                  from
/data/poky-master/tmp/work/corei7-64-poky-linux-musl/connman/1.30-r0/connman-1.30/src/inet.c:41:
|
/data/poky-master/tmp/sysroots/intel-corei7-64/usr/include/netinet/if_ether.h:96:8:
note: originally defined here
|  struct ethhdr {
|         ^

connman still fails to build with musl for me.

Ross

[-- Attachment #2: Type: text/html, Size: 1847 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 13/17] xserver-xorg: Fix build with musl
  2015-12-19 23:52 ` [PATCH 13/17] xserver-xorg: Fix build with musl Khem Raj
@ 2016-01-08 10:10   ` Burton, Ross
  2016-01-08 10:23     ` Khem Raj
  0 siblings, 1 reply; 35+ messages in thread
From: Burton, Ross @ 2016-01-08 10:10 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]

On 19 December 2015 at 23:52, Khem Raj <raj.khem@gmail.com> wrote:

> inb/outb are implemented for ARM on glibc but not on linux in general
> therefore the conditional has to reflect that
>

Untestable as libdrm fails to build with musl:

|
/data/poky-master/tmp/work/corei7-64-poky-linux-musl/libdrm/2.4.65-r0/libdrm-2.4.65/xf86drm.c:
In function 'drmParseSubsystemType':
|
/data/poky-master/tmp/work/corei7-64-poky-linux-musl/libdrm/2.4.65-r0/libdrm-2.4.65/xf86drm.c:2840:15:
error: 'PATH_MAX' undeclared (first use in this function)
|      char link[PATH_MAX + 1] = "";

Ross

[-- Attachment #2: Type: text/html, Size: 1237 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 13/17] xserver-xorg: Fix build with musl
  2016-01-08 10:10   ` Burton, Ross
@ 2016-01-08 10:23     ` Khem Raj
  0 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2016-01-08 10:23 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core


[-- Attachment #1.1: Type: text/plain, Size: 797 bytes --]


> On Jan 8, 2016, at 2:10 AM, Burton, Ross <ross.burton@intel.com> wrote:
> 
> 
> On 19 December 2015 at 23:52, Khem Raj <raj.khem@gmail.com <mailto:raj.khem@gmail.com>> wrote:
> inb/outb are implemented for ARM on glibc but not on linux in general
> therefore the conditional has to reflect that
> 
> Untestable as libdrm fails to build with musl:
> 
> | /data/poky-master/tmp/work/corei7-64-poky-linux-musl/libdrm/2.4.65-r0/libdrm-2.4.65/xf86drm.c: In function 'drmParseSubsystemType':
> | /data/poky-master/tmp/work/corei7-64-poky-linux-musl/libdrm/2.4.65-r0/libdrm-2.4.65/xf86drm.c:2840:15: error: 'PATH_MAX' undeclared (first use in this function)
> |      char link[PATH_MAX + 1] = "";
> 
> Ross


Ignore this, I have send a new pull request just now which should fix it.

[-- Attachment #1.2: Type: text/html, Size: 1942 bytes --]

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 00/17] musl fixes phase 2
  2016-01-08  9:58     ` Burton, Ross
@ 2016-01-08 10:24       ` Khem Raj
  0 siblings, 0 replies; 35+ messages in thread
From: Khem Raj @ 2016-01-08 10:24 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core


[-- Attachment #1.1: Type: text/plain, Size: 547 bytes --]


> On Jan 8, 2016, at 1:58 AM, Burton, Ross <ross.burton@intel.com> wrote:
> 
> 
> On 8 January 2016 at 09:40, Khem Raj <raj.khem@gmail.com <mailto:raj.khem@gmail.com>> wrote:
> This is a patch from sabotage linux, I have addressed all other issues.
> 
> Thanks Khem, merged those into my testing branch now.   There's a lot pending in your branch, do you have an ETA for when the rest of the muslification patches will be sent?
> 

Please take the request for phase 3 which includes remaining patches from phase 2 as well.

> Ross


[-- Attachment #1.2: Type: text/html, Size: 1581 bytes --]

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2016-01-08 10:24 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
2015-12-19 23:52 ` [PATCH 01/17] powertop: Include right headers for timval struct Khem Raj
2015-12-21 12:11   ` Burton, Ross
2015-12-19 23:52 ` [PATCH 02/17] dhcp: Include sys/types.h for u_int* defs Khem Raj
2015-12-21 12:11   ` Burton, Ross
2015-12-19 23:52 ` [PATCH 03/17] blktrace: Include <sys/types.h for dev_t Khem Raj
2015-12-21 12:12   ` Burton, Ross
2015-12-19 23:52 ` [PATCH 04/17] ppp: Fix build with musl Khem Raj
2015-12-19 23:52 ` [PATCH 05/17] tcp-wrappers: " Khem Raj
2015-12-19 23:52 ` [PATCH 06/17] tcmode-default: Use glibc for nativesdk version even on uclibc and musl Khem Raj
2015-12-19 23:52 ` [PATCH 07/17] libtirpc: Fix build for musl Khem Raj
2015-12-29  1:17   ` Khem Raj
2015-12-19 23:52 ` [PATCH 08/17] fts: Add recipe Khem Raj
2015-12-21 12:15   ` Burton, Ross
2015-12-21 13:42     ` Khem Raj
2015-12-25  5:53       ` Khem Raj
2015-12-19 23:52 ` [PATCH 09/17] valgrind: Define __UCLIBC__ for uclibc based systems Khem Raj
2015-12-21 20:38   ` Andre McCurdy
2015-12-21 20:57     ` Andre McCurdy
2015-12-19 23:52 ` [PATCH 10/17] connman: include config.h for HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR Khem Raj
2016-01-08 10:08   ` Burton, Ross
2015-12-19 23:52 ` [PATCH 11/17] libcgroup: Add dependency on fts when building on musl Khem Raj
2015-12-19 23:52 ` [PATCH 12/17] linux-libc-headers: Port patches for linux-headers for musl Khem Raj
2015-12-19 23:52 ` [PATCH 13/17] xserver-xorg: Fix build with musl Khem Raj
2016-01-08 10:10   ` Burton, Ross
2016-01-08 10:23     ` Khem Raj
2015-12-19 23:52 ` [PATCH 14/17] gdk-pixbuf: Fix latent build issue exposed by musl Khem Raj
2015-12-19 23:52 ` [PATCH 15/17] argp-standalone: Add recipe Khem Raj
2015-12-19 23:52 ` [PATCH 16/17] gnutls: Link with libargp on musl and depend on argp-standalone Khem Raj
2015-12-19 23:52 ` [PATCH 17/17] util-linux: Fix ptest builds on musl Khem Raj
2016-01-07 15:32 ` [PATCH 00/17] musl fixes phase 2 Burton, Ross
2016-01-07 16:48   ` Khem Raj
2016-01-08  9:40   ` Khem Raj
2016-01-08  9:58     ` Burton, Ross
2016-01-08 10:24       ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.