summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2015-04-06 17:36:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-08 10:53:31 +0100
commitca6b43cd8d5fb69f07b75f1de92f46e8767f9c99 (patch)
tree084b35177bf95e8cd26e827f41676bebb7a189b1
parent9a2768b013cb28de604023752c2f62bd91226184 (diff)
downloadpoky-ca6b43cd8d5fb69f07b75f1de92f46e8767f9c99.tar.gz
rpcbind: Fix build with musl
most patches are just removing glibc'ism e.g. using sys/queue.h of cdefs.h the one patch which is specific to musl is housed with overrides Change-Id: Ia15bf6c9c4b562c9392a704ef92e9090aa5f6381 (From OE-Core rev: 5ed97aeeb603506d772d252f97b9b6e02d84ae9a) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch224
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind/0002-uclibc-rpcsvc-defines.patch6
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch29
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch22
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind_0.2.2.bb6
5 files changed, 284 insertions, 3 deletions
diff --git a/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch b/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch
new file mode 100644
index 0000000000..6f5f5ddbef
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch
@@ -0,0 +1,224 @@
1From 2a44d862233f2126581e290d568e1c8b8f2eb9f5 Mon Sep 17 00:00:00 2001
2From: Carlo Landmeter <clandmeter@gmail.com>
3Date: Thu, 19 Feb 2015 15:28:45 +0000
4Subject: [PATCH] Avoid use of glibc sys/cdefs.h header
5
6Upstream-Status: Pending
7---
8 src/check_bound.c | 2 +-
9 src/pmap_svc.c | 10 +++++-----
10 src/rpcb_svc.c | 10 +++++-----
11 src/rpcb_svc_4.c | 14 +++++++-------
12 src/rpcb_svc_com.c | 46 +++++++++++++++++++++++-----------------------
13 src/rpcbind.c | 12 ++++++------
14 src/util.c | 2 +-
15 src/warmstart.c | 4 ++--
16 8 files changed, 50 insertions(+), 50 deletions(-)
17
18Index: rpcbind-0.2.2/src/check_bound.c
19===================================================================
20--- rpcbind-0.2.2.orig/src/check_bound.c
21+++ rpcbind-0.2.2/src/check_bound.c
22@@ -70,7 +70,7 @@ static struct fdlist *fdhead; /* Link li
23 static struct fdlist *fdtail;
24 static char *nullstring = "";
25
26-static bool_t check_bound __P((struct fdlist *, char *uaddr));
27+static bool_t check_bound (struct fdlist *, char *uaddr);
28
29 /*
30 * Returns 1 if the given address is bound for the given addr & transport
31Index: rpcbind-0.2.2/src/pmap_svc.c
32===================================================================
33--- rpcbind-0.2.2.orig/src/pmap_svc.c
34+++ rpcbind-0.2.2/src/pmap_svc.c
35@@ -58,11 +58,11 @@ static char sccsid[] = "@(#)pmap_svc.c 1
36 #endif
37 #include "rpcbind.h"
38 #include <rpc/svc_soc.h> /* svc_getcaller routine definition */
39-static struct pmaplist *find_service_pmap __P((rpcprog_t, rpcvers_t,
40- rpcprot_t));
41-static bool_t pmapproc_change __P((struct svc_req *, SVCXPRT *, u_long));
42-static bool_t pmapproc_getport __P((struct svc_req *, SVCXPRT *));
43-static bool_t pmapproc_dump __P((struct svc_req *, SVCXPRT *));
44+static struct pmaplist *find_service_pmap (rpcprog_t, rpcvers_t,
45+ rpcprot_t);
46+static bool_t pmapproc_change (struct svc_req *, SVCXPRT *, u_long);
47+static bool_t pmapproc_getport (struct svc_req *, SVCXPRT *);
48+static bool_t pmapproc_dump (struct svc_req *, SVCXPRT *);
49
50 /*
51 * Called for all the version 2 inquiries.
52Index: rpcbind-0.2.2/src/rpcb_svc.c
53===================================================================
54--- rpcbind-0.2.2.orig/src/rpcb_svc.c
55+++ rpcbind-0.2.2/src/rpcb_svc.c
56@@ -52,10 +52,10 @@
57
58 #include "rpcbind.h"
59
60-static void *rpcbproc_getaddr_3_local __P((void *, struct svc_req *, SVCXPRT *,
61- rpcvers_t));
62-static void *rpcbproc_dump_3_local __P((void *, struct svc_req *, SVCXPRT *,
63- rpcvers_t));
64+static void *rpcbproc_getaddr_3_local (void *, struct svc_req *, SVCXPRT *,
65+ rpcvers_t);
66+static void *rpcbproc_dump_3_local (void *, struct svc_req *, SVCXPRT *,
67+ rpcvers_t);
68
69 /*
70 * Called by svc_getreqset. There is a separate server handle for
71@@ -74,7 +74,7 @@ rpcb_service_3(struct svc_req *rqstp, SV
72 } argument;
73 char *result;
74 xdrproc_t xdr_argument, xdr_result;
75- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
76+ void *(*local) (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
77 rpcprog_t setprog = 0;
78
79 rpcbs_procinfo(RPCBVERS_3_STAT, rqstp->rq_proc);
80Index: rpcbind-0.2.2/src/rpcb_svc_4.c
81===================================================================
82--- rpcbind-0.2.2.orig/src/rpcb_svc_4.c
83+++ rpcbind-0.2.2/src/rpcb_svc_4.c
84@@ -53,13 +53,13 @@
85 #include <stdlib.h>
86 #include "rpcbind.h"
87
88-static void *rpcbproc_getaddr_4_local __P((void *, struct svc_req *, SVCXPRT *,
89- rpcvers_t));
90-static void *rpcbproc_getversaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
91+static void *rpcbproc_getaddr_4_local (void *, struct svc_req *, SVCXPRT *,
92+ rpcvers_t);
93+static void *rpcbproc_getversaddr_4_local (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
94 static void *rpcbproc_getaddrlist_4_local
95- __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
96-static void free_rpcb_entry_list __P((rpcb_entry_list_ptr *));
97-static void *rpcbproc_dump_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
98+ (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
99+static void free_rpcb_entry_list (rpcb_entry_list_ptr *);
100+static void *rpcbproc_dump_4_local (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
101
102 /*
103 * Called by svc_getreqset. There is a separate server handle for
104@@ -77,7 +77,7 @@ rpcb_service_4(struct svc_req *rqstp, SV
105 } argument;
106 char *result;
107 xdrproc_t xdr_argument, xdr_result;
108- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
109+ void *(*local) (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
110 rpcprog_t setprog = 0;
111
112 rpcbs_procinfo(RPCBVERS_4_STAT, rqstp->rq_proc);
113Index: rpcbind-0.2.2/src/rpcb_svc_com.c
114===================================================================
115--- rpcbind-0.2.2.orig/src/rpcb_svc_com.c
116+++ rpcbind-0.2.2/src/rpcb_svc_com.c
117@@ -99,29 +99,29 @@ struct finfo {
118 static struct finfo FINFO[NFORWARD];
119
120
121-static bool_t xdr_encap_parms __P((XDR *, struct encap_parms *));
122-static bool_t xdr_rmtcall_args __P((XDR *, struct r_rmtcall_args *));
123-static bool_t xdr_rmtcall_result __P((XDR *, struct r_rmtcall_args *));
124-static bool_t xdr_opaque_parms __P((XDR *, struct r_rmtcall_args *));
125-static int find_rmtcallfd_by_netid __P((char *));
126-static SVCXPRT *find_rmtcallxprt_by_fd __P((int));
127-static int forward_register __P((u_int32_t, struct netbuf *, int, char *,
128- rpcproc_t, rpcvers_t, u_int32_t *));
129-static struct finfo *forward_find __P((u_int32_t));
130-static int free_slot_by_xid __P((u_int32_t));
131-static int free_slot_by_index __P((int));
132-static int netbufcmp __P((struct netbuf *, struct netbuf *));
133-static struct netbuf *netbufdup __P((struct netbuf *));
134-static void netbuffree __P((struct netbuf *));
135-static int check_rmtcalls __P((struct pollfd *, int));
136-static void xprt_set_caller __P((SVCXPRT *, struct finfo *));
137-static void send_svcsyserr __P((SVCXPRT *, struct finfo *));
138-static void handle_reply __P((int, SVCXPRT *));
139-static void find_versions __P((rpcprog_t, char *, rpcvers_t *, rpcvers_t *));
140-static rpcblist_ptr find_service __P((rpcprog_t, rpcvers_t, char *));
141-static char *getowner __P((SVCXPRT *, char *, size_t));
142-static int add_pmaplist __P((RPCB *));
143-static int del_pmaplist __P((RPCB *));
144+static bool_t xdr_encap_parms (XDR *, struct encap_parms *);
145+static bool_t xdr_rmtcall_args (XDR *, struct r_rmtcall_args *);
146+static bool_t xdr_rmtcall_result (XDR *, struct r_rmtcall_args *);
147+static bool_t xdr_opaque_parms (XDR *, struct r_rmtcall_args *);
148+static int find_rmtcallfd_by_netid (char *);
149+static SVCXPRT *find_rmtcallxprt_by_fd (int);
150+static int forward_register (u_int32_t, struct netbuf *, int, char *,
151+ rpcproc_t, rpcvers_t, u_int32_t *);
152+static struct finfo *forward_find (u_int32_t);
153+static int free_slot_by_xid (u_int32_t);
154+static int free_slot_by_index (int);
155+static int netbufcmp (struct netbuf *, struct netbuf *);
156+static struct netbuf *netbufdup (struct netbuf *);
157+static void netbuffree (struct netbuf *);
158+static int check_rmtcalls (struct pollfd *, int);
159+static void xprt_set_caller (SVCXPRT *, struct finfo *);
160+static void send_svcsyserr (SVCXPRT *, struct finfo *);
161+static void handle_reply (int, SVCXPRT *);
162+static void find_versions (rpcprog_t, char *, rpcvers_t *, rpcvers_t *);
163+static rpcblist_ptr find_service (rpcprog_t, rpcvers_t, char *);
164+static char *getowner (SVCXPRT *, char *, size_t);
165+static int add_pmaplist (RPCB *);
166+static int del_pmaplist (RPCB *);
167
168 /*
169 * Set a mapping of program, version, netid
170Index: rpcbind-0.2.2/src/rpcbind.c
171===================================================================
172--- rpcbind-0.2.2.orig/src/rpcbind.c
173+++ rpcbind-0.2.2/src/rpcbind.c
174@@ -130,13 +130,13 @@ char *tcp_uaddr; /* Universal TCP addres
175 static char servname[] = "rpcbind";
176 static char superuser[] = "superuser";
177
178-int main __P((int, char *[]));
179+int main (int, char *[]);
180
181-static int init_transport __P((struct netconfig *));
182-static void rbllist_add __P((rpcprog_t, rpcvers_t, struct netconfig *,
183- struct netbuf *));
184-static void terminate __P((int));
185-static void parseargs __P((int, char *[]));
186+static int init_transport (struct netconfig *);
187+static void rbllist_add (rpcprog_t, rpcvers_t, struct netconfig *,
188+ struct netbuf *);
189+static void terminate (int);
190+static void parseargs (int, char *[]);
191
192 int
193 main(int argc, char *argv[])
194Index: rpcbind-0.2.2/src/util.c
195===================================================================
196--- rpcbind-0.2.2.orig/src/util.c
197+++ rpcbind-0.2.2/src/util.c
198@@ -70,9 +70,9 @@ static struct sockaddr_in *local_in4;
199 static struct sockaddr_in6 *local_in6;
200 #endif
201
202-static int bitmaskcmp __P((void *, void *, void *, int));
203+static int bitmaskcmp (void *, void *, void *, int);
204 #ifdef INET6
205-static void in6_fillscopeid __P((struct sockaddr_in6 *));
206+static void in6_fillscopeid (struct sockaddr_in6 *);
207 #endif
208
209 /*
210Index: rpcbind-0.2.2/src/warmstart.c
211===================================================================
212--- rpcbind-0.2.2.orig/src/warmstart.c
213+++ rpcbind-0.2.2/src/warmstart.c
214@@ -58,8 +58,8 @@
215 #define PMAPFILE RPCBIND_STATEDIR "/portmap.xdr"
216 #endif
217
218-static bool_t write_struct __P((char *, xdrproc_t, void *));
219-static bool_t read_struct __P((char *, xdrproc_t, void *));
220+static bool_t write_struct (char *, xdrproc_t, void *);
221+static bool_t read_struct (char *, xdrproc_t, void *);
222
223 static bool_t
224 write_struct(char *filename, xdrproc_t structproc, void *list)
diff --git a/meta/recipes-extended/rpcbind/rpcbind/0002-uclibc-rpcsvc-defines.patch b/meta/recipes-extended/rpcbind/rpcbind/0002-uclibc-rpcsvc-defines.patch
index c54fc96fc0..6b113165c4 100644
--- a/meta/recipes-extended/rpcbind/rpcbind/0002-uclibc-rpcsvc-defines.patch
+++ b/meta/recipes-extended/rpcbind/rpcbind/0002-uclibc-rpcsvc-defines.patch
@@ -1,10 +1,10 @@
1Upstream-Status: Pending
2
3From 077add040c2e30d3ac507362f4afe350f47be027 Mon Sep 17 00:00:00 2001 1From 077add040c2e30d3ac507362f4afe350f47be027 Mon Sep 17 00:00:00 2001
4From: Natanael Copa <ncopa@alpinelinux.org> 2From: Natanael Copa <ncopa@alpinelinux.org>
5Date: Tue, 2 Feb 2010 09:47:57 +0000 3Date: Tue, 2 Feb 2010 09:47:57 +0000
6Subject: [PATCH 2/2] uclibc-rpcsvc-defines 4Subject: [PATCH 2/2] uclibc-rpcsvc-defines
7 5
6Upstream-Status: Pending
7
8--- 8---
9 src/security.c | 28 ++++++++++++++++++++++++++++ 9 src/security.c | 28 ++++++++++++++++++++++++++++
10 1 files changed, 28 insertions(+), 0 deletions(-) 10 1 files changed, 28 insertions(+), 0 deletions(-)
@@ -17,7 +17,7 @@ index 0edeac6..e9fed55 100644
17 /* 17 /*
18 * XXX for special case checks in check_callit. 18 * XXX for special case checks in check_callit.
19 */ 19 */
20+#if defined(__UCLIBC__) 20+#if defined(__UCLIBC__) || !defined(__GLIBC__)
21+ 21+
22+#define MOUNTPROC_MNT 1 22+#define MOUNTPROC_MNT 1
23+#define MOUNTPROC_UMNT 3 23+#define MOUNTPROC_UMNT 3
diff --git a/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch b/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch
new file mode 100644
index 0000000000..9c72a1bdf4
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch
@@ -0,0 +1,29 @@
1The musl implementation of getaddrinfo and getservbyname does not
2aliases. As a workaround we use "sunprc" instead of "portmapper"
3
4ported from alpine linux
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Index: rpcbind-0.2.2/src/rpcbind.c
9===================================================================
10--- rpcbind-0.2.2.orig/src/rpcbind.c
11+++ rpcbind-0.2.2/src/rpcbind.c
12@@ -491,7 +491,7 @@ init_transport(struct netconfig *nconf)
13 if ((aicode = getaddrinfo(hosts[nhostsbak],
14 servname, &hints, &res)) != 0) {
15 if ((aicode = getaddrinfo(hosts[nhostsbak],
16- "portmapper", &hints, &res)) != 0) {
17+ "sunrpc", &hints, &res)) != 0) {
18 syslog(LOG_ERR,
19 "cannot get local address for %s: %s",
20 nconf->nc_netid, gai_strerror(aicode));
21@@ -564,7 +564,7 @@ init_transport(struct netconfig *nconf)
22 if ((strcmp(nconf->nc_netid, "local") != 0) &&
23 (strcmp(nconf->nc_netid, "unix") != 0)) {
24 if ((aicode = getaddrinfo(NULL, servname, &hints, &res))!= 0) {
25- if ((aicode = getaddrinfo(NULL, "portmapper", &hints, &res))!= 0) {
26+ if ((aicode = getaddrinfo(NULL, "sunrpc", &hints, &res))!= 0) {
27 printf("cannot get local address for %s: %s", nconf->nc_netid, gai_strerror(aicode));
28 syslog(LOG_ERR,
29 "cannot get local address for %s: %s",
diff --git a/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch b/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch
new file mode 100644
index 0000000000..84fc974fdf
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch
@@ -0,0 +1,22 @@
1musl does not provide this header and here is reasoning
2http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_sys.2Fqueue.h_not_included_.3F
3
4So include it only when __GLIBC__ is defined which is true for uclibc and glibc
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7Upstream-Status: Pending
8
9Index: rpcbind-0.2.2/src/util.c
10===================================================================
11--- rpcbind-0.2.2.orig/src/util.c
12+++ rpcbind-0.2.2/src/util.c
13@@ -41,7 +41,9 @@
14
15 #include <sys/types.h>
16 #include <sys/socket.h>
17+#ifdef __GLIBC__
18 #include <sys/queue.h>
19+#endif
20 #include <net/if.h>
21 #include <netinet/in.h>
22 #include <ifaddrs.h>
diff --git a/meta/recipes-extended/rpcbind/rpcbind_0.2.2.bb b/meta/recipes-extended/rpcbind/rpcbind_0.2.2.bb
index 1952b2a298..51e456e4bd 100644
--- a/meta/recipes-extended/rpcbind/rpcbind_0.2.2.bb
+++ b/meta/recipes-extended/rpcbind/rpcbind_0.2.2.bb
@@ -12,16 +12,22 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b46486e4c4a416602693a711bb5bfa39 \
12 12
13SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \ 13SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \
14 file://init.d \ 14 file://init.d \
15 file://0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch \
16 file://0002-uclibc-rpcsvc-defines.patch \
17 file://remove-sys-queue.patch \
15 ${UCLIBCPATCHES} \ 18 ${UCLIBCPATCHES} \
19 ${MUSLPATCHES} \
16 file://rpcbind.conf \ 20 file://rpcbind.conf \
17 file://rpcbind.socket \ 21 file://rpcbind.socket \
18 file://rpcbind.service \ 22 file://rpcbind.service \
19 " 23 "
24MUSLPATCHES_libc-musl = "file://musl-sunrpc.patch"
20 25
21UCLIBCPATCHES_libc-uclibc = "file://0001-uclibc-nss.patch \ 26UCLIBCPATCHES_libc-uclibc = "file://0001-uclibc-nss.patch \
22 file://0002-uclibc-rpcsvc-defines.patch \ 27 file://0002-uclibc-rpcsvc-defines.patch \
23 " 28 "
24UCLIBCPATCHES ?= "" 29UCLIBCPATCHES ?= ""
30MUSLPATCHES ?= ""
25 31
26SRC_URI[md5sum] = "8acf839bfef2364a05fbd6be5f8edf9a" 32SRC_URI[md5sum] = "8acf839bfef2364a05fbd6be5f8edf9a"
27SRC_URI[sha256sum] = "13dbc8c796dbe0ce8df873007bea0490c8460b56202d918c9eb6fa0358a08f29" 33SRC_URI[sha256sum] = "13dbc8c796dbe0ce8df873007bea0490c8460b56202d918c9eb6fa0358a08f29"