All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] libtirpc: Backport fixes from 1.0.2rc3
@ 2017-04-19  1:58 Khem Raj
  2017-04-19  1:58 ` [PATCH 2/5] libtirpc: Expose key_secretkey_is_set API Khem Raj
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Khem Raj @ 2017-04-19  1:58 UTC (permalink / raw)
  To: openembedded-core

These fixes are needed for it to work with gcc7

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...d-missing-rwlock_unlocks-in-xprt_register.patch |  62 --
 .../libtirpc/libtirpc/libtirpc-1.0.2-rc3.patch     | 743 +++++++++++++++++++++
 .../libtirpc/remove-des-functionality.patch        |  39 +-
 meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb   |   4 +-
 4 files changed, 762 insertions(+), 86 deletions(-)
 delete mode 100644 meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/libtirpc-1.0.2-rc3.patch

diff --git a/meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch b/meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch
deleted file mode 100644
index 50613ba3123..00000000000
--- a/meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-Subject: [PATCH] Add missing rwlock_unlocks in xprt_register
-
-It looks like in b2c9430f46c4ac848957fb8adaac176a3f6ac03f when svc_run
-switched to poll, an early return was added, but the rwlock was not
-unlocked.
-
-I observed that rpcbind built against libtirpc-1.0.1 would handle only
-one request before hanging, and tracked it down to a missing
-rwlock_unlock here.
-
-Fixes: b2c9430f46c4 ('Use poll() instead of select() in svc_run()')
-
-Upstream-Status: Backport
-
-Signed-off-by: Michael Forney <mforney@mforney.org>
-Signed-off-by: Steve Dickson <steved@redhat.com>
-Signed-off-by: Maxin B. John <maxin.john@intel.com>
----
- src/svc.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/src/svc.c b/src/svc.c
-index 9c41445..b59467b 100644
---- a/src/svc.c
-+++ b/src/svc.c
-@@ -99,7 +99,7 @@ xprt_register (xprt)
-     {
-       __svc_xports = (SVCXPRT **) calloc (_rpc_dtablesize(), sizeof (SVCXPRT *));
-       if (__svc_xports == NULL)
--	return;
-+            goto unlock;
-     }
-   if (sock < _rpc_dtablesize())
-     {
-@@ -120,14 +120,14 @@ xprt_register (xprt)
-             svc_pollfd[i].fd = sock;
-             svc_pollfd[i].events = (POLLIN | POLLPRI |
-                                     POLLRDNORM | POLLRDBAND);
--            return;
-+            goto unlock;
-           }
- 
-       new_svc_pollfd = (struct pollfd *) realloc (svc_pollfd,
-                                                   sizeof (struct pollfd)
-                                                   * (svc_max_pollfd + 1));
-       if (new_svc_pollfd == NULL) /* Out of memory */
--        return;
-+        goto unlock;
-       svc_pollfd = new_svc_pollfd;
-       ++svc_max_pollfd;
- 
-@@ -135,6 +135,7 @@ xprt_register (xprt)
-       svc_pollfd[svc_max_pollfd - 1].events = (POLLIN | POLLPRI |
-                                                POLLRDNORM | POLLRDBAND);
-     }
-+unlock:
-   rwlock_unlock (&svc_fd_lock);
- }
- 
--- 
-2.5.3
-
diff --git a/meta/recipes-extended/libtirpc/libtirpc/libtirpc-1.0.2-rc3.patch b/meta/recipes-extended/libtirpc/libtirpc/libtirpc-1.0.2-rc3.patch
new file mode 100644
index 00000000000..113dabe13b7
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc/libtirpc-1.0.2-rc3.patch
@@ -0,0 +1,743 @@
+Backport the 1.0.2 RC3 changes, this fixes issues with gcc7
+
+Upstream-Status: Backport
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index e4ed8aa..fba2aa4 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -24,7 +24,7 @@ libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c cln
+         rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
+ 	svc_auth_des.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 auth_des.c authdes_prot.c debug.c des_crypt.c des_impl.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 xdr_sizeof.c
+diff --git a/src/auth_des.c b/src/auth_des.c
+index 4d3639e..af2f61f 100644
+--- a/src/auth_des.c
++++ b/src/auth_des.c
+@@ -46,8 +46,8 @@
+ #include <rpc/clnt.h>
+ #include <rpc/xdr.h>
+ #include <sys/socket.h>
+-#undef NIS
+-#include <rpcsvc/nis.h>
++
++#include "nis.h"
+ 
+ #if defined(LIBC_SCCS) && !defined(lint)
+ #endif
+diff --git a/src/auth_gss.c b/src/auth_gss.c
+index 9b88c38..5959893 100644
+--- a/src/auth_gss.c
++++ b/src/auth_gss.c
+@@ -526,6 +526,14 @@ _rpc_gss_refresh(AUTH *auth, rpc_gss_options_ret_t *options_ret)
+ 			     gr.gr_major != GSS_S_CONTINUE_NEEDED)) {
+ 				options_ret->major_status = gr.gr_major;
+ 				options_ret->minor_status = gr.gr_minor;
++				if (call_stat != RPC_SUCCESS) {
++					struct rpc_err err;
++					clnt_geterr(gd->clnt, &err);
++					LIBTIRPC_DEBUG(1, ("authgss_refresh: %s errno: %s",
++						clnt_sperrno(call_stat), strerror(err.re_errno)));
++				} else
++					gss_log_status("authgss_refresh:", 
++						gr.gr_major, gr.gr_minor);
+ 				return FALSE;
+ 			}
+ 
+diff --git a/src/auth_time.c b/src/auth_time.c
+index 10e58eb..7f83ab4 100644
+--- a/src/auth_time.c
++++ b/src/auth_time.c
+@@ -44,8 +44,8 @@
+ #include <rpc/rpcb_prot.h>
+ //#include <clnt_soc.h>
+ #include <sys/select.h>
+-#undef NIS
+-#include <rpcsvc/nis.h>
++
++#include "nis.h"
+ 
+ 
+ #ifdef TESTING
+diff --git a/src/des_impl.c b/src/des_impl.c
+index c5b7ed6..9dbccaf 100644
+--- a/src/des_impl.c
++++ b/src/des_impl.c
+@@ -6,7 +6,8 @@
+ /* see <http://www.gnu.org/licenses/> to obtain a copy.  */
+ #include <string.h>
+ #include <stdint.h>
+-#include <rpc/rpc_des.h>
++#include <sys/types.h>
++#include <rpc/des.h>
+ 
+ 
+ static const uint32_t des_SPtrans[8][64] =
+diff --git a/src/getpublickey.c b/src/getpublickey.c
+index 764a5f9..8cf4dc2 100644
+--- a/src/getpublickey.c
++++ b/src/getpublickey.c
+@@ -38,8 +38,10 @@
+ #include <pwd.h>
+ #include <rpc/rpc.h>
+ #include <rpc/key_prot.h>
++#ifdef YP
+ #include <rpcsvc/yp_prot.h>
+ #include <rpcsvc/ypclnt.h>
++#endif
+ #include <string.h>
+ #include <stdlib.h>
+ 
+diff --git a/src/nis.h b/src/nis.h
+new file mode 100644
+index 0000000..588c041
+--- /dev/null
++++ b/src/nis.h
+@@ -0,0 +1,70 @@
++/*
++ * Copyright (c) 2010, Oracle America, Inc.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are
++ * met:
++ *
++ *     * Redistributions of source code must retain the above copyright
++ *       notice, this list of conditions and the following disclaimer.
++ *     * 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.
++ *     * Neither the name of the "Oracle America, Inc." 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 COPYRIGHT HOLDERS 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
++ *   COPYRIGHT HOLDER 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.
++ */
++
++#ifndef _INTERNAL_NIS_H
++#define _INTERNAL_NIS_H 1
++
++/*  This file only contains the definition of nis_server, to be
++    able to compile libtirpc without the need to have a glibc
++    with sunrpc or a libnsl already installed. */
++
++#define NIS_PK_NONE 0
++
++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;
++
++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;
++
++#endif /* ! _INTERNAL_NIS_H */
+diff --git a/src/rpc_dtablesize.c b/src/rpc_dtablesize.c
+index 13d320c..3fe503a 100644
+--- a/src/rpc_dtablesize.c
++++ b/src/rpc_dtablesize.c
+@@ -27,22 +27,14 @@
+  */
+ 
+ #include <unistd.h>
+-
+ #include <sys/select.h>
+-
+-int _rpc_dtablesize(void);	/* XXX */
++#include <rpc/clnt.h>
++#include <rpc/rpc_com.h>
+ 
+ /*
+  * Cache the result of getdtablesize(), so we don't have to do an
+  * expensive system call every time.
+  */
+-/*
+- * XXX In FreeBSD 2.x, you can have the maximum number of open file
+- * descriptors be greater than FD_SETSIZE (which us 256 by default).
+- *
+- * Since old programs tend to use this call to determine the first arg
+- * for _select(), having this return > FD_SETSIZE is a Bad Idea(TM)!
+- */
+ int
+ _rpc_dtablesize(void)
+ {
+diff --git a/src/rpc_soc.c b/src/rpc_soc.c
+index 1ec7b3f..ed0892a 100644
+--- a/src/rpc_soc.c
++++ b/src/rpc_soc.c
+@@ -61,8 +61,8 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+-#include <rpcsvc/nis.h>
+ 
++#include "nis.h"
+ #include "rpc_com.h"
+ 
+ extern mutex_t	rpcsoc_lock;
+diff --git a/src/rtime.c b/src/rtime.c
+index c34e0af..b642840 100644
+--- a/src/rtime.c
++++ b/src/rtime.c
+@@ -46,6 +46,7 @@
+ #include <unistd.h>
+ #include <errno.h>
+ #include <sys/types.h>
++#include <sys/poll.h>
+ #include <sys/socket.h>
+ #include <sys/time.h>
+ #include <netinet/in.h>
+@@ -67,7 +68,8 @@ rtime(addrp, timep, timeout)
+ 	struct timeval *timeout;
+ {
+ 	int s;
+-	fd_set readfds;
++	struct pollfd fd;
++	int milliseconds;
+ 	int res;
+ 	unsigned long thetime;
+ 	struct sockaddr_in from;
+@@ -94,31 +96,32 @@ rtime(addrp, timep, timeout)
+ 	addrp->sin_port = serv->s_port;
+ 
+ 	if (type == SOCK_DGRAM) {
+-		res = sendto(s, (char *)&thetime, sizeof(thetime), 0, 
++		res = sendto(s, (char *)&thetime, sizeof(thetime), 0,
+ 			     (struct sockaddr *)addrp, sizeof(*addrp));
+ 		if (res < 0) {
+ 			do_close(s);
+-			return(-1);	
++			return(-1);
+ 		}
+-		do {
+-			FD_ZERO(&readfds);
+-			FD_SET(s, &readfds);
+-			res = select(_rpc_dtablesize(), &readfds,
+-				     (fd_set *)NULL, (fd_set *)NULL, timeout);
+-		} while (res < 0 && errno == EINTR);
++
++		milliseconds = (timeout->tv_sec * 1000) + (timeout->tv_usec / 1000);
++		fd.fd = s;
++		fd.events = POLLIN;
++		do
++		  res = poll (&fd, 1, milliseconds);
++		while (res < 0 && errno == EINTR);
+ 		if (res <= 0) {
+ 			if (res == 0) {
+ 				errno = ETIMEDOUT;
+ 			}
+ 			do_close(s);
+-			return(-1);	
++			return(-1);
+ 		}
+ 		fromlen = sizeof(from);
+-		res = recvfrom(s, (char *)&thetime, sizeof(thetime), 0, 
++		res = recvfrom(s, (char *)&thetime, sizeof(thetime), 0,
+ 			       (struct sockaddr *)&from, &fromlen);
+ 		do_close(s);
+ 		if (res < 0) {
+-			return(-1);	
++			return(-1);
+ 		}
+ 	} else {
+ 		if (connect(s, (struct sockaddr *)addrp, sizeof(*addrp)) < 0) {
+diff --git a/src/svc.c b/src/svc.c
+index 9c41445..b59467b 100644
+--- a/src/svc.c
++++ b/src/svc.c
+@@ -99,7 +99,7 @@ xprt_register (xprt)
+     {
+       __svc_xports = (SVCXPRT **) calloc (_rpc_dtablesize(), sizeof (SVCXPRT *));
+       if (__svc_xports == NULL)
+-	return;
++            goto unlock;
+     }
+   if (sock < _rpc_dtablesize())
+     {
+@@ -120,14 +120,14 @@ xprt_register (xprt)
+             svc_pollfd[i].fd = sock;
+             svc_pollfd[i].events = (POLLIN | POLLPRI |
+                                     POLLRDNORM | POLLRDBAND);
+-            return;
++            goto unlock;
+           }
+ 
+       new_svc_pollfd = (struct pollfd *) realloc (svc_pollfd,
+                                                   sizeof (struct pollfd)
+                                                   * (svc_max_pollfd + 1));
+       if (new_svc_pollfd == NULL) /* Out of memory */
+-        return;
++        goto unlock;
+       svc_pollfd = new_svc_pollfd;
+       ++svc_max_pollfd;
+ 
+@@ -135,6 +135,7 @@ xprt_register (xprt)
+       svc_pollfd[svc_max_pollfd - 1].events = (POLLIN | POLLPRI |
+                                                POLLRDNORM | POLLRDBAND);
+     }
++unlock:
+   rwlock_unlock (&svc_fd_lock);
+ }
+ 
+diff --git a/src/svc_auth_des.c b/src/svc_auth_des.c
+index 5bc264c..2e90146 100644
+--- a/src/svc_auth_des.c
++++ b/src/svc_auth_des.c
+@@ -86,13 +86,13 @@ static struct cache_entry *authdes_cache/* [AUTHDES_CACHESZ] */;
+ static short *authdes_lru/* [AUTHDES_CACHESZ] */;
+ 
+ static void cache_init();	/* initialize the cache */
+-static short cache_spot();	/* find an entry in the cache */
+-static void cache_ref(/*short sid*/);	/* note that sid was ref'd */
++static short cache_spot(des_block *key, char *name, struct timeval *timestamp);  /* find an entry in the cache */
++static void cache_ref(short sid);	/* note that sid was ref'd */
+ 
+-static void invalidate();	/* invalidate entry in cache */
++static void invalidate(char *cred);	/* invalidate entry in cache */
+ 
+ /*
+- * cache statistics 
++ * cache statistics
+  */
+ static struct {
+ 	u_long ncachehits;	/* times cache hit, and is not replay */
+diff --git a/src/svc_auth_gss.c b/src/svc_auth_gss.c
+index b6aa407..bece46a 100644
+--- a/src/svc_auth_gss.c
++++ b/src/svc_auth_gss.c
+@@ -129,6 +129,8 @@ struct svc_rpc_gss_data {
+ 	((struct svc_rpc_gss_data *)(auth)->svc_ah_private)
+ 
+ /* Global server credentials. */
++static u_int		_svcauth_req_time = 0;
++static gss_OID_set_desc	_svcauth_oid_set = {1, GSS_C_NULL_OID };
+ static gss_cred_id_t	_svcauth_gss_creds;
+ static gss_name_t	_svcauth_gss_name = GSS_C_NO_NAME;
+ static char *		_svcauth_svc_name = NULL;
+@@ -167,6 +169,7 @@ svcauth_gss_import_name(char *service)
+ 	gss_name_t	name;
+ 	gss_buffer_desc	namebuf;
+ 	OM_uint32	maj_stat, min_stat;
++	bool_t		result;
+ 
+ 	gss_log_debug("in svcauth_gss_import_name()");
+ 
+@@ -181,22 +184,21 @@ svcauth_gss_import_name(char *service)
+ 			maj_stat, min_stat);
+ 		return (FALSE);
+ 	}
+-	if (svcauth_gss_set_svc_name(name) != TRUE) {
+-		gss_release_name(&min_stat, &name);
+-		return (FALSE);
+-	}
+-	return (TRUE);
++	result = svcauth_gss_set_svc_name(name);
++	gss_release_name(&min_stat, &name);
++	return result;
+ }
+ 
+ static bool_t
+-svcauth_gss_acquire_cred(u_int req_time, gss_OID_set_desc *oid_set)
++svcauth_gss_acquire_cred(void)
+ {
+ 	OM_uint32	maj_stat, min_stat;
+ 
+ 	gss_log_debug("in svcauth_gss_acquire_cred()");
+ 
+-	maj_stat = gss_acquire_cred(&min_stat, _svcauth_gss_name, req_time,
+-				    oid_set, GSS_C_ACCEPT,
++	maj_stat = gss_acquire_cred(&min_stat, _svcauth_gss_name,
++				    _svcauth_req_time, &_svcauth_oid_set,
++				    GSS_C_ACCEPT,
+ 				    &_svcauth_gss_creds, NULL, NULL);
+ 
+ 	if (maj_stat != GSS_S_COMPLETE) {
+@@ -300,6 +302,8 @@ svcauth_gss_accept_sec_context(struct svc_req *rqst,
+ 					      NULL,
+ 					      &gd->deleg);
+ 
++	xdr_free((xdrproc_t)xdr_rpc_gss_init_args, (caddr_t)&recv_tok);
++
+ 	if (gr->gr_major != GSS_S_COMPLETE &&
+ 	    gr->gr_major != GSS_S_CONTINUE_NEEDED) {
+ 		gss_log_status("svcauth_gss_accept_sec_context: accept_sec_context",
+@@ -352,8 +356,11 @@ svcauth_gss_accept_sec_context(struct svc_req *rqst,
+ 			return (FALSE);
+ 
+ 		rqst->rq_xprt->xp_verf.oa_flavor = RPCSEC_GSS;
+-		rqst->rq_xprt->xp_verf.oa_base = checksum.value;
++		memcpy(rqst->rq_xprt->xp_verf.oa_base, checksum.value,
++			checksum.length);
+ 		rqst->rq_xprt->xp_verf.oa_length = checksum.length;
++
++		gss_release_buffer(&min_stat, &checksum);
+ 	}
+ 	return (TRUE);
+ }
+@@ -435,10 +442,13 @@ svcauth_gss_nextverf(struct svc_req *rqst, u_int num)
+ 			maj_stat, min_stat);
+ 		return (FALSE);
+ 	}
++
+ 	rqst->rq_xprt->xp_verf.oa_flavor = RPCSEC_GSS;
+-	rqst->rq_xprt->xp_verf.oa_base = (caddr_t)checksum.value;
++	memcpy(rqst->rq_xprt->xp_verf.oa_base, checksum.value, checksum.length);
+ 	rqst->rq_xprt->xp_verf.oa_length = (u_int)checksum.length;
+ 
++	gss_release_buffer(&min_stat, &checksum);
++
+ 	return (TRUE);
+ }
+ 
+@@ -568,6 +578,8 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch)
+ 	gss_qop_t		 qop;
+ 	struct svcauth_gss_cache_entry **ce;
+ 	time_t			 now;
++	enum auth_stat		 result = AUTH_OK;
++	OM_uint32		 min_stat;
+ 
+ 	gss_log_debug("in svcauth_gss()");
+ 
+@@ -621,19 +633,25 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch)
+ 	XDR_DESTROY(&xdrs);
+ 
+ 	/* Check version. */
+-	if (gc->gc_v != RPCSEC_GSS_VERSION)
+-		return (AUTH_BADCRED);
++	if (gc->gc_v != RPCSEC_GSS_VERSION) {
++		result = AUTH_BADCRED;
++		goto out;
++	}
+ 
+ 	/* Check RPCSEC_GSS service. */
+ 	if (gc->gc_svc != RPCSEC_GSS_SVC_NONE &&
+ 	    gc->gc_svc != RPCSEC_GSS_SVC_INTEGRITY &&
+-	    gc->gc_svc != RPCSEC_GSS_SVC_PRIVACY)
+-		return (AUTH_BADCRED);
++	    gc->gc_svc != RPCSEC_GSS_SVC_PRIVACY) {
++		result = AUTH_BADCRED;
++		goto out;
++	}
+ 
+ 	/* Check sequence number. */
+ 	if (gd->established) {
+-		if (gc->gc_seq > MAXSEQ)
+-			return (RPCSEC_GSS_CTXPROBLEM);
++		if (gc->gc_seq > MAXSEQ) {
++			result = RPCSEC_GSS_CTXPROBLEM;
++			goto out;
++		}
+ 
+ 		if ((offset = gd->seqlast - gc->gc_seq) < 0) {
+ 			gd->seqlast = gc->gc_seq;
+@@ -643,7 +661,8 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch)
+ 		}
+ 		else if (offset >= gd->win || (gd->seqmask & (1 << offset))) {
+ 			*no_dispatch = 1;
+-			return (RPCSEC_GSS_CTXPROBLEM);
++			result = RPCSEC_GSS_CTXPROBLEM;
++			goto out;
+ 		}
+ 		gd->seq = gc->gc_seq;
+ 		gd->seqmask |= (1 << offset);
+@@ -654,35 +673,52 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch)
+ 		rqst->rq_svcname = (char *)gd->ctx;
+ 	}
+ 
++	rqst->rq_xprt->xp_verf.oa_base = msg->rm_call.cb_verf.oa_base;
++
+ 	/* Handle RPCSEC_GSS control procedure. */
+ 	switch (gc->gc_proc) {
+ 
+ 	case RPCSEC_GSS_INIT:
+ 	case RPCSEC_GSS_CONTINUE_INIT:
+-		if (rqst->rq_proc != NULLPROC)
+-			return (AUTH_FAILED);		/* XXX ? */
++		if (rqst->rq_proc != NULLPROC) {
++			result = AUTH_FAILED;		/* XXX ? */
++			break;
++		}
+ 
+ 		if (_svcauth_gss_name == GSS_C_NO_NAME) {
+-			if (!svcauth_gss_import_name("nfs"))
+-				return (AUTH_FAILED);
++			if (!svcauth_gss_import_name("nfs")) {
++				result = AUTH_FAILED;
++				break;
++			}
+ 		}
+ 
+-		if (!svcauth_gss_acquire_cred(0, GSS_C_NULL_OID_SET))
+-			return (AUTH_FAILED);
++		if (!svcauth_gss_acquire_cred()) {
++			result = AUTH_FAILED;
++			break;
++		}
+ 
+-		if (!svcauth_gss_accept_sec_context(rqst, &gr))
+-			return (AUTH_REJECTEDCRED);
++		if (!svcauth_gss_accept_sec_context(rqst, &gr)) {
++			result = AUTH_REJECTEDCRED;
++			break;
++		}
+ 
+-		if (!svcauth_gss_nextverf(rqst, htonl(gr.gr_win)))
+-			return (AUTH_FAILED);
++		if (!svcauth_gss_nextverf(rqst, htonl(gr.gr_win))) {
++			result = AUTH_FAILED;
++			break;
++		}
+ 
+ 		*no_dispatch = TRUE;
+ 
+ 		call_stat = svc_sendreply(rqst->rq_xprt, 
+ 			(xdrproc_t)xdr_rpc_gss_init_res, (caddr_t)&gr);
+ 
+-		if (!call_stat)
+-			return (AUTH_FAILED);
++		gss_release_buffer(&min_stat, &gr.gr_token);
++		free(gr.gr_ctx.value);
++
++		if (!call_stat) {
++			result = AUTH_FAILED;
++			break;
++		}
+ 
+ 		if (gr.gr_major == GSS_S_COMPLETE)
+ 			gd->established = TRUE;
+@@ -690,27 +726,37 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch)
+ 		break;
+ 
+ 	case RPCSEC_GSS_DATA:
+-		if (!svcauth_gss_validate(gd, msg, &qop))
+-			return (RPCSEC_GSS_CREDPROBLEM);
++		if (!svcauth_gss_validate(gd, msg, &qop)) {
++			result = RPCSEC_GSS_CREDPROBLEM;
++			break;
++		}
+ 
+-		if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq)))
+-			return (AUTH_FAILED);
++		if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq))) {
++			result = AUTH_FAILED;
++			break;
++		}
+ 
+ 		if (!gd->callback_done) {
+ 			gd->callback_done = TRUE;
+ 			gd->sec.qop = qop;
+ 			(void)rpc_gss_num_to_qop(gd->rcred.mechanism,
+ 						gd->sec.qop, &gd->rcred.qop);
+-			if (!svcauth_gss_callback(rqst, gd))
+-				return (AUTH_REJECTEDCRED);
++			if (!svcauth_gss_callback(rqst, gd)) {
++				result = AUTH_REJECTEDCRED;
++				break;
++			}
+ 		}
+ 
+ 		if (gd->locked) {
+ 			if (gd->rcred.service !=
+-					_rpc_gss_svc_to_service(gc->gc_svc))
+-				return (AUTH_FAILED);
+-			if (gd->sec.qop != qop)
+-				return (AUTH_BADVERF);
++					_rpc_gss_svc_to_service(gc->gc_svc)) {
++				result = AUTH_FAILED;
++				break;
++			}
++			if (gd->sec.qop != qop) {
++				result = AUTH_BADVERF;
++				break;
++			}
+ 		}
+ 
+ 		if (gd->sec.qop != qop) {
+@@ -724,17 +770,25 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch)
+ 		break;
+ 
+ 	case RPCSEC_GSS_DESTROY:
+-		if (rqst->rq_proc != NULLPROC)
+-			return (AUTH_FAILED);		/* XXX ? */
++		if (rqst->rq_proc != NULLPROC) {
++			result = AUTH_FAILED;		/* XXX ? */
++			break;
++		}
+ 
+-		if (!svcauth_gss_validate(gd, msg, &qop))
+-			return (RPCSEC_GSS_CREDPROBLEM);
++		if (!svcauth_gss_validate(gd, msg, &qop)) {
++			result = RPCSEC_GSS_CREDPROBLEM;
++			break;
++		}
+ 
+-		if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq)))
+-			return (AUTH_FAILED);
++		if (!svcauth_gss_nextverf(rqst, htonl(gc->gc_seq))) {
++			result = AUTH_FAILED;
++			break;
++		}
+ 
+-		if (!svcauth_gss_release_cred())
+-			return (AUTH_FAILED);
++		if (!svcauth_gss_release_cred()) {
++			result = AUTH_FAILED;
++			break;
++		}
+ 
+ 		SVCAUTH_DESTROY(&SVC_XP_AUTH(rqst->rq_xprt));
+ 		SVC_XP_AUTH(rqst->rq_xprt).svc_ah_ops = svc_auth_none.svc_ah_ops;
+@@ -743,10 +797,12 @@ _svcauth_gss(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch)
+ 		break;
+ 
+ 	default:
+-		return (AUTH_REJECTEDCRED);
++		result = AUTH_REJECTEDCRED;
+ 		break;
+ 	}
+-	return (AUTH_OK);
++out:
++	xdr_free((xdrproc_t)xdr_rpc_gss_cred, (caddr_t)gc);
++	return result;
+ }
+ 
+ static bool_t
+@@ -890,7 +946,6 @@ bool_t
+ rpc_gss_set_svc_name(char *principal, char *mechanism, u_int req_time,
+ 		u_int UNUSED(program), u_int UNUSED(version))
+ {
+-	gss_OID_set_desc oid_set;
+ 	rpc_gss_OID oid;
+ 	char *save;
+ 
+@@ -902,14 +957,13 @@ rpc_gss_set_svc_name(char *principal, char *mechanism, u_int req_time,
+ 
+ 	if (!rpc_gss_mech_to_oid(mechanism, &oid))
+ 		goto out_err;
+-	oid_set.count = 1;
+-	oid_set.elements = (gss_OID)oid;
+ 
+ 	if (!svcauth_gss_import_name(principal))
+ 		goto out_err;
+-	if (!svcauth_gss_acquire_cred(req_time, &oid_set))
+-		goto out_err;
+ 
++	_svcauth_req_time = req_time;
++	_svcauth_oid_set.count = 1;
++	_svcauth_oid_set.elements = (gss_OID)oid;
+ 	free(_svcauth_svc_name);
+ 	_svcauth_svc_name = save;
+ 	return TRUE;
+diff --git a/src/svc_vc.c b/src/svc_vc.c
+index 6ae613d..97a76a3 100644
+--- a/src/svc_vc.c
++++ b/src/svc_vc.c
+@@ -270,14 +270,8 @@ makefd_xprt(fd, sendsize, recvsize)
+ 	struct cf_conn *cd;
+ 	const char *netid;
+ 	struct __rpc_sockinfo si;
+- 
+-	assert(fd != -1);
+ 
+-        if (fd >= FD_SETSIZE) {
+-                warnx("svc_vc: makefd_xprt: fd too high\n");
+-                xprt = NULL;
+-                goto done;
+-        }
++	assert(fd != -1);
+ 
+ 	xprt = mem_alloc(sizeof(SVCXPRT));
+ 	if (xprt == NULL) {
+@@ -338,22 +332,10 @@ rendezvous_request(xprt, msg)
+ 	r = (struct cf_rendezvous *)xprt->xp_p1;
+ again:
+ 	len = sizeof addr;
+-	if ((sock = accept(xprt->xp_fd, (struct sockaddr *)(void *)&addr,
+-	    &len)) < 0) {
++	sock = accept(xprt->xp_fd, (struct sockaddr *)(void *)&addr, &len);
++	if (sock < 0) {
+ 		if (errno == EINTR)
+ 			goto again;
+-
+-		if (errno == EMFILE || errno == ENFILE) {
+-		  /* If there are no file descriptors available, then accept will fail.
+-		     We want to delay here so the connection request can be dequeued;
+-		     otherwise we can bounce between polling and accepting, never
+-		     giving the request a chance to dequeue and eating an enormous
+-		     amount of cpu time in svc_run if we're polling on many file
+-		     descriptors.  */
+-		        struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+-                        nanosleep (&ts, NULL);
+-			goto again;
+-		}
+ 		return (FALSE);
+ 	}
+ 	/*
+diff --git a/tirpc/rpc/des.h b/tirpc/rpc/des.h
+index d2881ad..018aa48 100644
+--- a/tirpc/rpc/des.h
++++ b/tirpc/rpc/des.h
+@@ -82,6 +82,6 @@ struct desparams {
+ /*
+  * Software DES.
+  */
+-extern int _des_crypt( char *, int, struct desparams * );
++extern int _des_crypt( char *, unsigned, struct desparams * );
+ 
+ #endif
+diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
+index 147f909..e07503c 100644
+--- a/tirpc/rpc/rpcent.h
++++ b/tirpc/rpc/rpcent.h
+@@ -60,10 +60,11 @@ struct rpcent {
+ extern struct rpcent *getrpcbyname(const char *);
+ extern struct rpcent *getrpcbynumber(int);
+ extern struct rpcent *getrpcent(void);
+-#endif
+ 
+ extern void setrpcent(int);
+ extern void endrpcent(void);
++#endif
++
+ #ifdef __cplusplus
+ }
+ #endif
diff --git a/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch b/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch
index 512e93497d6..31e97744cbb 100644
--- a/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch
+++ b/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch
@@ -6,21 +6,22 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 Signed-off-by: Maxin B. John <maxin.john@intel.com>
 ---
-diff -Naur libtirpc-1.0.1-orig/src/Makefile.am libtirpc-1.0.1/src/Makefile.am
---- libtirpc-1.0.1-orig/src/Makefile.am	2015-10-30 17:15:14.000000000 +0200
-+++ libtirpc-1.0.1/src/Makefile.am	2015-12-21 15:56:17.094702429 +0200
-@@ -22,9 +22,8 @@
+Index: libtirpc-1.0.1/src/Makefile.am
+===================================================================
+--- libtirpc-1.0.1.orig/src/Makefile.am
++++ libtirpc-1.0.1/src/Makefile.am
+@@ -22,9 +22,8 @@ libtirpc_la_SOURCES = auth_none.c auth_u
          pmap_prot.c pmap_prot2.c pmap_rmt.c rpc_prot.c rpc_commondata.c \
          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_auth_des.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 auth_des.c authdes_prot.c debug.c des_crypt.c des_impl.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 xdr_sizeof.c
-@@ -41,8 +40,8 @@
+@@ -41,8 +40,8 @@ if GSS
      libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
  endif
  
@@ -31,18 +32,11 @@ diff -Naur libtirpc-1.0.1-orig/src/Makefile.am libtirpc-1.0.1/src/Makefile.am
  
  CLEANFILES	       = cscope.* *~
  DISTCLEANFILES	       = Makefile.in
-diff -Naur libtirpc-1.0.1-orig/src/rpc_soc.c libtirpc-1.0.1/src/rpc_soc.c
---- libtirpc-1.0.1-orig/src/rpc_soc.c	2015-10-30 17:15:14.000000000 +0200
-+++ libtirpc-1.0.1/src/rpc_soc.c	2015-12-21 15:56:17.095702416 +0200
-@@ -61,7 +61,6 @@
- #include <string.h>
- #include <unistd.h>
- #include <fcntl.h>
--#include <rpcsvc/nis.h>
- 
- #include "rpc_com.h"
- 
-@@ -522,86 +521,6 @@
+Index: libtirpc-1.0.1/src/rpc_soc.c
+===================================================================
+--- libtirpc-1.0.1.orig/src/rpc_soc.c
++++ libtirpc-1.0.1/src/rpc_soc.c
+@@ -522,86 +522,6 @@ clnt_broadcast(prog, vers, proc, xargs,
  }
  
  /*
@@ -129,10 +123,11 @@ diff -Naur libtirpc-1.0.1-orig/src/rpc_soc.c libtirpc-1.0.1/src/rpc_soc.c
   * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
   */
  CLIENT *
-diff -Naur libtirpc-1.0.1-orig/src/svc_auth.c libtirpc-1.0.1/src/svc_auth.c
---- libtirpc-1.0.1-orig/src/svc_auth.c	2015-10-30 17:15:14.000000000 +0200
-+++ libtirpc-1.0.1/src/svc_auth.c	2015-12-21 15:56:17.095702416 +0200
-@@ -114,9 +114,6 @@
+Index: libtirpc-1.0.1/src/svc_auth.c
+===================================================================
+--- libtirpc-1.0.1.orig/src/svc_auth.c
++++ libtirpc-1.0.1/src/svc_auth.c
+@@ -114,9 +114,6 @@ _gss_authenticate(rqst, msg, no_dispatch
  	case AUTH_SHORT:
  		dummy = _svcauth_short(rqst, msg);
  		return (dummy);
diff --git a/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb b/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
index e321d479ecf..8ba547506bf 100644
--- a/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
+++ b/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
@@ -11,8 +11,8 @@ PROVIDES = "virtual/librpc"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2;name=libtirpc \
            ${GENTOO_MIRROR}/${BPN}-glibc-nfs.tar.xz;name=glibc-nfs \
+           file://libtirpc-1.0.2-rc3.patch \
            file://libtirpc-0.2.1-fortify.patch \
-           file://0001-Add-missing-rwlock_unlocks-in-xprt_register.patch \
           "
 
 SRC_URI_append_libc-uclibc = " file://remove-des-functionality.patch \
@@ -32,7 +32,7 @@ inherit autotools pkgconfig
 EXTRA_OECONF = "--disable-gssapi"
 
 do_configure_prepend () {
-        cp -r ${S}/../tirpc ${S}
+        cp -r ${WORKDIR}/tirpc ${S}
 }
 
 do_install_append() {
-- 
2.12.2



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

* [PATCH 2/5] libtirpc: Expose key_secretkey_is_set API
  2017-04-19  1:58 [PATCH 1/5] libtirpc: Backport fixes from 1.0.2rc3 Khem Raj
@ 2017-04-19  1:58 ` Khem Raj
  2017-04-19  8:52   ` Burton, Ross
  2017-04-19  1:58 ` [PATCH 3/5] libtirpc: Enable des APIs for musl Khem Raj
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Khem Raj @ 2017-04-19  1:58 UTC (permalink / raw)
  To: openembedded-core

libnsl needs this API

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../libtirpc/export_key_secretkey_is_set.patch        | 19 +++++++++++++++++++
 meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb      |  1 +
 2 files changed, 20 insertions(+)
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/export_key_secretkey_is_set.patch

diff --git a/meta/recipes-extended/libtirpc/libtirpc/export_key_secretkey_is_set.patch b/meta/recipes-extended/libtirpc/libtirpc/export_key_secretkey_is_set.patch
new file mode 100644
index 00000000000..bde7951ec1a
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc/export_key_secretkey_is_set.patch
@@ -0,0 +1,19 @@
+Add key_secretkey_is_set to exported symbols map
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libtirpc-1.0.1/src/libtirpc.map
+===================================================================
+--- libtirpc-1.0.1.orig/src/libtirpc.map
++++ libtirpc-1.0.1/src/libtirpc.map
+@@ -298,7 +298,7 @@ TIRPC_0.3.2 {
+     key_gendes;
+     key_get_conv;
+     key_setsecret;
+-    key_secret_is_set;
++    key_secretkey_is_set;
+     key_setnet;
+     netname2host;
+     netname2user;
diff --git a/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb b/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
index 8ba547506bf..b96abc4d57e 100644
--- a/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
+++ b/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
@@ -13,6 +13,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2;name=libtirpc \
            ${GENTOO_MIRROR}/${BPN}-glibc-nfs.tar.xz;name=glibc-nfs \
            file://libtirpc-1.0.2-rc3.patch \
            file://libtirpc-0.2.1-fortify.patch \
+           file://export_key_secretkey_is_set.patch \
           "
 
 SRC_URI_append_libc-uclibc = " file://remove-des-functionality.patch \
-- 
2.12.2



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

* [PATCH 3/5] libtirpc: Enable des APIs for musl
  2017-04-19  1:58 [PATCH 1/5] libtirpc: Backport fixes from 1.0.2rc3 Khem Raj
  2017-04-19  1:58 ` [PATCH 2/5] libtirpc: Expose key_secretkey_is_set API Khem Raj
@ 2017-04-19  1:58 ` Khem Raj
  2017-04-19  8:57   ` André Draszik
  2017-04-19  1:58 ` [PATCH 4/5] rpcbind: Remove uneeded patches Khem Raj
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Khem Raj @ 2017-04-19  1:58 UTC (permalink / raw)
  To: openembedded-core

Use memset() API instead of __bzero()
Drop the patch removing des_* functions for musl

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../0001-replace-__bzero-with-memset-API.patch     |  28 +++++
 .../libtirpc/remove-des-functionality.patch        | 139 ---------------------
 meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb   |   5 +-
 3 files changed, 31 insertions(+), 141 deletions(-)
 create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch
 delete mode 100644 meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch

diff --git a/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch b/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch
new file mode 100644
index 00000000000..ef7ddb7d99b
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch
@@ -0,0 +1,28 @@
+From 20badc3e3608953fb5b36bb2e16fa51bd731aebc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 18 Apr 2017 09:35:35 -0700
+Subject: [PATCH] replace __bzero() with memset() API
+
+memset is available across all libc implementation
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/des_impl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/des_impl.c b/src/des_impl.c
+index 9dbccaf..15bec2a 100644
+--- a/src/des_impl.c
++++ b/src/des_impl.c
+@@ -588,7 +588,7 @@ _des_crypt (char *buf, unsigned len, struct desparams *desp)
+     }
+   tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0;
+   tbuf[0] = tbuf[1] = 0;
+-  __bzero (schedule, sizeof (schedule));
++  memset (schedule, 0, sizeof (schedule));
+ 
+   return (1);
+ }
+-- 
+2.12.2
+
diff --git a/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch b/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch
deleted file mode 100644
index 31e97744cbb..00000000000
--- a/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-uclibc and musl does not provide des functionality. Lets disable it.
-
-Upstream-Status: Inappropriate [uclibc and musl specific]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-Signed-off-by: Maxin B. John <maxin.john@intel.com>
----
-Index: libtirpc-1.0.1/src/Makefile.am
-===================================================================
---- libtirpc-1.0.1.orig/src/Makefile.am
-+++ libtirpc-1.0.1/src/Makefile.am
-@@ -22,9 +22,8 @@ libtirpc_la_SOURCES = auth_none.c auth_u
-         pmap_prot.c pmap_prot2.c pmap_rmt.c rpc_prot.c rpc_commondata.c \
-         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_auth_des.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 des_crypt.c des_impl.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 xdr_sizeof.c
-@@ -41,8 +40,8 @@ if GSS
-     libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
- endif
- 
--libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
--libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
-+#libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
-+#libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
- 
- CLEANFILES	       = cscope.* *~
- DISTCLEANFILES	       = Makefile.in
-Index: libtirpc-1.0.1/src/rpc_soc.c
-===================================================================
---- libtirpc-1.0.1.orig/src/rpc_soc.c
-+++ libtirpc-1.0.1/src/rpc_soc.c
-@@ -522,86 +522,6 @@ clnt_broadcast(prog, vers, proc, xargs,
- }
- 
- /*
-- * Create the client des authentication object. Obsoleted by
-- * authdes_seccreate().
-- */
--AUTH *
--authdes_create(servername, window, syncaddr, ckey)
--	char *servername;		/* network name of server */
--	u_int window;			/* time to live */
--	struct sockaddr *syncaddr;	/* optional hostaddr to sync with */
--	des_block *ckey;		/* optional conversation key to use */
--{
--	AUTH *nauth;
--	char hostname[NI_MAXHOST];
--
--	if (syncaddr) {
--		/*
--		 * Change addr to hostname, because that is the way
--		 * new interface takes it.
--		 */
--	        switch (syncaddr->sa_family) {
--		case AF_INET:
--		  if (getnameinfo(syncaddr, sizeof(struct sockaddr_in), hostname,
--				  sizeof hostname, NULL, 0, 0) != 0)
--		    goto fallback;
--		  break;
--		case AF_INET6:
--		  if (getnameinfo(syncaddr, sizeof(struct sockaddr_in6), hostname,
--				  sizeof hostname, NULL, 0, 0) != 0)
--		    goto fallback;
--		  break;
--		default:
--		  goto fallback;
--		}
--		nauth = authdes_seccreate(servername, window, hostname, ckey);
--		return (nauth);
--	}
--fallback:
--	return authdes_seccreate(servername, window, NULL, ckey);
--}
--
--/*
-- * Create the client des authentication object. Obsoleted by
-- * authdes_pk_seccreate().
-- */
--extern AUTH *authdes_pk_seccreate(const char *, netobj *, u_int, const char *,
--        const des_block *, nis_server *);
--
--AUTH *
--authdes_pk_create(servername, pkey, window, syncaddr, ckey)
--	char *servername;		/* network name of server */
--	netobj *pkey;			/* public key */
--	u_int window;			/* time to live */
--	struct sockaddr *syncaddr;	/* optional hostaddr to sync with */
--	des_block *ckey;		/* optional conversation key to use */
--{
--	AUTH *nauth;
--	char hostname[NI_MAXHOST];
--
--	if (syncaddr) {
--		/*
--		 * Change addr to hostname, because that is the way
--		 * new interface takes it.
--		 */
--	        switch (syncaddr->sa_family) {
--		case AF_INET:
--		  if (getnameinfo(syncaddr, sizeof(struct sockaddr_in), hostname,
--				  sizeof hostname, NULL, 0, 0) != 0)
--		    goto fallback;
--		  break;
--		default:
--		  goto fallback;
--		}
--		nauth = authdes_pk_seccreate(servername, pkey, window, hostname, ckey, NULL);
--		return (nauth);
--	}
--fallback:
--	return authdes_pk_seccreate(servername, pkey, window, NULL, ckey, NULL);
--}
--
--
--/*
-  * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
-  */
- CLIENT *
-Index: libtirpc-1.0.1/src/svc_auth.c
-===================================================================
---- libtirpc-1.0.1.orig/src/svc_auth.c
-+++ libtirpc-1.0.1/src/svc_auth.c
-@@ -114,9 +114,6 @@ _gss_authenticate(rqst, msg, no_dispatch
- 	case AUTH_SHORT:
- 		dummy = _svcauth_short(rqst, msg);
- 		return (dummy);
--	case AUTH_DES:
--		dummy = _svcauth_des(rqst, msg);
--		return (dummy);
- #ifdef HAVE_RPCSEC_GSS
- 	case RPCSEC_GSS:
- 		dummy = _svcauth_gss(rqst, msg, no_dispatch);
diff --git a/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb b/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
index b96abc4d57e..662c8999c20 100644
--- a/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
+++ b/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
@@ -14,12 +14,13 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2;name=libtirpc \
            file://libtirpc-1.0.2-rc3.patch \
            file://libtirpc-0.2.1-fortify.patch \
            file://export_key_secretkey_is_set.patch \
-          "
+           file://0001-replace-__bzero-with-memset-API.patch \
+           "
 
 SRC_URI_append_libc-uclibc = " file://remove-des-functionality.patch \
                              "
 
-SRC_URI_append_libc-musl = " file://remove-des-functionality.patch \
+SRC_URI_append_libc-musl = " \
                              file://Use-netbsd-queue.h.patch \
                            "
 
-- 
2.12.2



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

* [PATCH 4/5] rpcbind: Remove uneeded patches
  2017-04-19  1:58 [PATCH 1/5] libtirpc: Backport fixes from 1.0.2rc3 Khem Raj
  2017-04-19  1:58 ` [PATCH 2/5] libtirpc: Expose key_secretkey_is_set API Khem Raj
  2017-04-19  1:58 ` [PATCH 3/5] libtirpc: Enable des APIs for musl Khem Raj
@ 2017-04-19  1:58 ` Khem Raj
  2017-04-19  1:58 ` [PATCH 5/5] libidn: Fix build with gcc7 Khem Raj
  2017-04-19  2:01 ` ✗ patchtest: failure for "libtirpc: Backport fixes from ..." and 4 more Patchwork
  4 siblings, 0 replies; 15+ messages in thread
From: Khem Raj @ 2017-04-19  1:58 UTC (permalink / raw)
  To: openembedded-core

We were carrying patches which are no longer
needed when building rpcbind for musl

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../rpcbind/rpcbind/musl-sunrpc.patch              | 30 ----------------------
 .../rpcbind/rpcbind/remove-sys-queue.patch         | 22 ----------------
 meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb     |  8 ------
 3 files changed, 60 deletions(-)
 delete mode 100644 meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch
 delete mode 100644 meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch

diff --git a/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch b/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch
deleted file mode 100644
index 6fbc6364cb6..00000000000
--- a/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-The musl implementation of getaddrinfo and getservbyname does not
-aliases. As a workaround we use "sunprc" instead of "portmapper"
-
-ported from alpine linux
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Pending
-
-Index: rpcbind-0.2.2/src/rpcbind.c
-===================================================================
---- rpcbind-0.2.2.orig/src/rpcbind.c
-+++ rpcbind-0.2.2/src/rpcbind.c
-@@ -491,7 +491,7 @@ init_transport(struct netconfig *nconf)
- 			if ((aicode = getaddrinfo(hosts[nhostsbak],
- 			    servname, &hints, &res)) != 0) {
- 			  if ((aicode = getaddrinfo(hosts[nhostsbak],
--						    "portmapper", &hints, &res)) != 0) {
-+						    "sunrpc", &hints, &res)) != 0) {
- 				syslog(LOG_ERR,
- 				    "cannot get local address for %s: %s",
- 				    nconf->nc_netid, gai_strerror(aicode));
-@@ -564,7 +564,7 @@ init_transport(struct netconfig *nconf)
- 		if ((strcmp(nconf->nc_netid, "local") != 0) &&
- 		    (strcmp(nconf->nc_netid, "unix") != 0)) {
- 			if ((aicode = getaddrinfo(NULL, servname, &hints, &res))!= 0) {
--			  if ((aicode = getaddrinfo(NULL, "portmapper", &hints, &res))!= 0) {
-+			  if ((aicode = getaddrinfo(NULL, "sunrpc", &hints, &res))!= 0) {
- 			  printf("cannot get local address for %s: %s",  nconf->nc_netid, gai_strerror(aicode));
- 			  syslog(LOG_ERR,
- 				    "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
deleted file mode 100644
index 84fc974fdf1..00000000000
--- a/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-musl does not provide this header and here is reasoning
-http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_sys.2Fqueue.h_not_included_.3F
-
-So include it only when __GLIBC__ is defined which is true for uclibc and glibc
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Pending
-
-Index: rpcbind-0.2.2/src/util.c
-===================================================================
---- rpcbind-0.2.2.orig/src/util.c
-+++ rpcbind-0.2.2/src/util.c
-@@ -41,7 +41,9 @@
- 
- #include <sys/types.h>
- #include <sys/socket.h>
-+#ifdef __GLIBC__
- #include <sys/queue.h>
-+#endif
- #include <net/if.h>
- #include <netinet/in.h>
- #include <ifaddrs.h>
diff --git a/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb b/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb
index 4911fe51e83..d3ebcb3b254 100644
--- a/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb
+++ b/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb
@@ -12,18 +12,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b46486e4c4a416602693a711bb5bfa39 \
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \
            file://init.d \
-           file://remove-sys-queue.patch \
-           ${UCLIBCPATCHES} \
-           ${MUSLPATCHES} \
            file://rpcbind.conf \
            file://rpcbind.socket \
            file://rpcbind.service \
           "
-MUSLPATCHES_libc-musl = "file://musl-sunrpc.patch"
-
-UCLIBCPATCHES ?= ""
-MUSLPATCHES ?= ""
-
 SRC_URI[md5sum] = "cf10cd41ed8228fc54c316191c1f07fe"
 SRC_URI[sha256sum] = "074a9a530dc7c11e0d905aa59bcb0847c009313f02e98d3d798aa9568f414c66"
 
-- 
2.12.2



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

* [PATCH 5/5] libidn: Fix build with gcc7
  2017-04-19  1:58 [PATCH 1/5] libtirpc: Backport fixes from 1.0.2rc3 Khem Raj
                   ` (2 preceding siblings ...)
  2017-04-19  1:58 ` [PATCH 4/5] rpcbind: Remove uneeded patches Khem Raj
@ 2017-04-19  1:58 ` Khem Raj
  2017-04-19 15:06   ` André Draszik
  2017-04-19  2:01 ` ✗ patchtest: failure for "libtirpc: Backport fixes from ..." and 4 more Patchwork
  4 siblings, 1 reply; 15+ messages in thread
From: Khem Raj @ 2017-04-19  1:58 UTC (permalink / raw)
  To: openembedded-core

Replace a local patch for format warning with the one
that got committed upstream

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...1-idn-fix-printf-format-security-warnings.patch | 825 +++++++++++++++++----
 .../libidn/libidn/gcc7-compatibility.patch         | 334 +++++++++
 meta/recipes-extended/libidn/libidn_1.33.bb        |   1 +
 3 files changed, 1004 insertions(+), 156 deletions(-)
 create mode 100644 meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch

diff --git a/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch b/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch
index 5adc7d9fd98..2d5faabb240 100644
--- a/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch
+++ b/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch
@@ -1,181 +1,694 @@
-From 82f98dcbc429bbe89a9837c533cbcbc02e77c790 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
-Date: Tue, 28 Jun 2016 12:43:31 +0100
-Subject: [PATCH] idn: fix printf() format security warnings
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
+From 7148adf34dae30345c2e4d9d437838a45ba6f6e8 Mon Sep 17 00:00:00 2001
+From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
+Date: Wed, 1 Feb 2017 11:06:39 +0100
+Subject: [PATCH] Fix -Wformat warnings
 
-| ../../libidn-1.32/src/idn.c: In function 'main':
-| ../../libidn-1.32/src/idn.c:172:7: error: format not a string literal and no format arguments [-Werror=format-security]
-|        error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be specified"));
-|        ^~~~~
-| ../../libidn-1.32/src/idn.c:187:5: error: format not a string literal and no format arguments [-Werror=format-security]
-|      fprintf (stderr, _("Type each input string on a line by itself, "
-|      ^~~~~~~
-| ../../libidn-1.32/src/idn.c:202:4: error: format not a string literal and no format arguments [-Werror=format-security]
-|     error (EXIT_FAILURE, errno, _("input error"));
-|     ^~~~~
-| ../../libidn-1.32/src/idn.c:220:8: error: format not a string literal and no format arguments [-Werror=format-security]
-|         _("could not convert from UTF-8 to UCS-4"));
-|         ^
-| ../../libidn-1.32/src/idn.c:245:8: error: format not a string literal and no format arguments [-Werror=format-security]
-|         _("could not convert from UTF-8 to UCS-4"));
-|         ^
-| ../../libidn-1.32/src/idn.c:281:6: error: format not a string literal and no format arguments [-Werror=format-security]
-|       _("could not convert from UTF-8 to UCS-4"));
-|       ^
-| ../../libidn-1.32/src/idn.c:340:6: error: format not a string literal and no format arguments [-Werror=format-security]
-|       _("could not convert from UCS-4 to UTF-8"));
-|       ^
-| ../../libidn-1.32/src/idn.c:364:6: error: format not a string literal and no format arguments [-Werror=format-security]
-|       _("could not convert from UCS-4 to UTF-8"));
-|       ^
-| ../../libidn-1.32/src/idn.c:442:8: error: format not a string literal and no format arguments [-Werror=format-security]
-|         _("could not convert from UCS-4 to UTF-8"));
-|         ^
-| ../../libidn-1.32/src/idn.c:498:6: error: format not a string literal and no format arguments [-Werror=format-security]
-|       _("could not convert from UTF-8 to UCS-4"));
-|       ^
-| ../../libidn-1.32/src/idn.c:527:5: error: format not a string literal and no format arguments [-Werror=format-security]
-|      _("could not convert from UTF-8 to UCS-4"));
-|      ^
-| ../../libidn-1.32/src/idn.c:540:6: error: format not a string literal and no format arguments [-Werror=format-security]
-|       error (EXIT_FAILURE, 0, _("could not do NFKC normalization"));
-|       ^~~~~
-| ../../libidn-1.32/src/idn.c:551:5: error: format not a string literal and no format arguments [-Werror=format-security]
-|      _("could not convert from UTF-8 to UCS-4"));
-|      ^
-
-Signed-off-by: André Draszik <adraszik@tycoint.com>
 ---
-Upstream-Status: Pending
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
- src/idn.c | 27 ++++++++++++++-------------
- 1 file changed, 14 insertions(+), 13 deletions(-)
+ examples/example.c     |  6 +++---
+ examples/example3.c    |  4 ++--
+ examples/example4.c    |  4 ++--
+ examples/example5.c    |  2 +-
+ src/idn.c              |  2 +-
+ tests/tst_idna.c       | 25 +++++++++++++------------
+ tests/tst_idna2.c      |  8 ++++----
+ tests/tst_idna3.c      |  8 ++++----
+ tests/tst_nfkc.c       |  8 ++++----
+ tests/tst_pr29.c       | 12 ++++++------
+ tests/tst_punycode.c   | 13 +++++++------
+ tests/tst_strerror.c   | 20 ++++++++++----------
+ tests/tst_stringprep.c | 12 ++++++------
+ tests/tst_tld.c        | 20 ++++++++++----------
+ tests/utils.c          |  6 +++---
+ 15 files changed, 76 insertions(+), 74 deletions(-)
 
+diff --git a/examples/example.c b/examples/example.c
+index 6e91783..24f64e0 100644
+--- a/examples/example.c
++++ b/examples/example.c
+@@ -55,7 +55,7 @@ main (void)
+ 
+   printf ("Before locale2utf8 (length %ld): ", (long int) strlen (buf));
+   for (i = 0; i < strlen (buf); i++)
+-    printf ("%02x ", buf[i] & 0xFF);
++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
+   printf ("\n");
+ 
+   p = stringprep_locale_to_utf8 (buf);
+@@ -69,7 +69,7 @@ main (void)
+ 
+   printf ("Before stringprep (length %ld): ", (long int) strlen (buf));
+   for (i = 0; i < strlen (buf); i++)
+-    printf ("%02x ", buf[i] & 0xFF);
++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
+   printf ("\n");
+ 
+   rc = stringprep (buf, BUFSIZ, 0, stringprep_nameprep);
+@@ -79,7 +79,7 @@ main (void)
+     {
+       printf ("After stringprep (length %ld): ", (long int) strlen (buf));
+       for (i = 0; i < strlen (buf); i++)
+-	printf ("%02x ", buf[i] & 0xFF);
++	printf ("%02x ", (unsigned) buf[i] & 0xFF);
+       printf ("\n");
+     }
+ 
+diff --git a/examples/example3.c b/examples/example3.c
+index fc11c1c..ffb9042 100644
+--- a/examples/example3.c
++++ b/examples/example3.c
+@@ -56,7 +56,7 @@ main (void)
+ 
+   printf ("Read string (length %ld): ", (long int) strlen (buf));
+   for (i = 0; i < strlen (buf); i++)
+-    printf ("%02x ", buf[i] & 0xFF);
++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
+   printf ("\n");
+ 
+   rc = idna_to_ascii_lz (buf, &p, 0);
+@@ -68,7 +68,7 @@ main (void)
+ 
+   printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p);
+   for (i = 0; i < strlen (p); i++)
+-    printf ("%02x ", p[i] & 0xFF);
++    printf ("%02x ", (unsigned) p[i] & 0xFF);
+   printf ("\n");
+ 
+   free (p);
+diff --git a/examples/example4.c b/examples/example4.c
+index 1b319c9..a3315a1 100644
+--- a/examples/example4.c
++++ b/examples/example4.c
+@@ -56,7 +56,7 @@ main (void)
+ 
+   printf ("Read string (length %ld): ", (long int) strlen (buf));
+   for (i = 0; i < strlen (buf); i++)
+-    printf ("%02x ", buf[i] & 0xFF);
++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
+   printf ("\n");
+ 
+   rc = idna_to_unicode_lzlz (buf, &p, 0);
+@@ -68,7 +68,7 @@ main (void)
+ 
+   printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p);
+   for (i = 0; i < strlen (p); i++)
+-    printf ("%02x ", p[i] & 0xFF);
++    printf ("%02x ", (unsigned) p[i] & 0xFF);
+   printf ("\n");
+ 
+   free (p);
+diff --git a/examples/example5.c b/examples/example5.c
+index df55798..29d40b9 100644
+--- a/examples/example5.c
++++ b/examples/example5.c
+@@ -68,7 +68,7 @@ main (void)
+ 
+   printf ("Read string (length %ld): ", (long int) strlen (buf));
+   for (i = 0; i < strlen (buf); i++)
+-    printf ("%02x ", buf[i] & 0xFF);
++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
+   printf ("\n");
+ 
+   p = stringprep_locale_to_utf8 (buf);
 diff --git a/src/idn.c b/src/idn.c
-index be1c7d1..68e4291 100644
+index be1c7d1..13eb3c9 100644
 --- a/src/idn.c
 +++ b/src/idn.c
-@@ -170,7 +170,7 @@ main (int argc, char *argv[])
-       (args_info.idna_to_unicode_given ? 1 : 0) +
-       (args_info.nfkc_given ? 1 : 0) != 1)
+@@ -419,7 +419,7 @@ main (int argc, char *argv[])
+ 	      size_t i;
+ 	      for (i = 0; p[i]; i++)
+ 		fprintf (stderr, "output[%lu] = U+%04x\n",
+-			 (unsigned long) i, p[i]);
++			 (unsigned long) i, (unsigned) p[i]);
+ 	    }
+ 
+ 	  fprintf (stdout, "%s\n", p);
+diff --git a/tests/tst_idna.c b/tests/tst_idna.c
+index 415764e..4ac046f 100644
+--- a/tests/tst_idna.c
++++ b/tests/tst_idna.c
+@@ -220,13 +220,14 @@ doit (void)
+   char label[100];
+   uint32_t *ucs4label = NULL;
+   uint32_t tmp[100];
+-  size_t len, len2, i;
++  size_t len, len2;
+   int rc;
++  unsigned i;
+ 
+   for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++)
      {
--      error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be specified"));
-+      error (0, 0, "%s", _("only one of -s, -e, -d, -a, -u or -n can be specified"));
-       usage (EXIT_FAILURE);
-     }
+       if (debug)
+-	printf ("IDNA entry %ld: %s\n", i, idna[i].name);
++	printf ("IDNA entry %u: %s\n", i, idna[i].name);
  
-@@ -185,7 +185,7 @@ main (int argc, char *argv[])
-   if (!args_info.quiet_given
-       && args_info.inputs_num == 0
-       && isatty (fileno (stdin)))
--    fprintf (stderr, _("Type each input string on a line by itself, "
-+    fprintf (stderr, "%s", _("Type each input string on a line by itself, "
- 		       "terminated by a newline character.\n"));
- 
-   do
-@@ -197,7 +197,7 @@ main (int argc, char *argv[])
- 	  if (feof (stdin))
- 	    break;
+       if (debug)
+ 	{
+@@ -237,7 +238,7 @@ doit (void)
+       rc = idna_to_ascii_4i (idna[i].in, idna[i].inlen, label, idna[i].flags);
+       if (rc != idna[i].toasciirc)
+ 	{
+-	  fail ("IDNA entry %ld failed: %d\n", i, rc);
++	  fail ("IDNA entry %u failed: %d\n", i, rc);
+ 	  if (debug)
+ 	    printf ("FATAL\n");
+ 	  continue;
+@@ -256,7 +257,7 @@ doit (void)
+ 	  if (strlen (idna[i].out) != strlen (label) ||
+ 	      strcasecmp (idna[i].out, label) != 0)
+ 	    {
+-	      fail ("IDNA entry %ld failed\n", i);
++	      fail ("IDNA entry %u failed\n", i);
+ 	      if (debug)
+ 		printf ("ERROR\n");
+ 	    }
+@@ -273,8 +274,8 @@ doit (void)
  
--	  error (EXIT_FAILURE, errno, _("input error"));
-+	  error (EXIT_FAILURE, errno, "%s", _("input error"));
+       if (debug)
+ 	{
+-	  printf ("in: %s (%ld==%ld)\n", idna[i].out, strlen (idna[i].out),
+-		  len);
++	  printf ("in: %s (%d==%d)\n", idna[i].out, (int) strlen (idna[i].out),
++		  (int) len);
+ 	  ucs4print (ucs4label, len);
  	}
  
-       if (strlen (line) > 0)
-@@ -215,7 +215,7 @@ main (int argc, char *argv[])
- 	  if (!q)
+@@ -282,20 +283,20 @@ doit (void)
+       rc = idna_to_unicode_44i (ucs4label, len, tmp, &len2, idna[i].flags);
+       if (debug)
+ 	{
+-	  printf ("expected out (%ld):\n",
++	  printf ("expected out (%lu):\n",
+ 		  rc == IDNA_SUCCESS ? idna[i].inlen : len);
+ 	  if (rc == IDNA_SUCCESS)
+ 	    ucs4print (idna[i].in, idna[i].inlen);
+ 	  else
+ 	    ucs4print (ucs4label, len);
+ 
+-	  printf ("computed out (%ld):\n", len2);
++	  printf ("computed out (%d):\n", (int) len2);
+ 	  ucs4print (tmp, len2);
+ 	}
+ 
+       if (rc != idna[i].tounicoderc)
+ 	{
+-	  fail ("IDNA entry %ld failed: %d\n", i, rc);
++	  fail ("IDNA entry %u failed: %d\n", i, rc);
+ 	  if (debug)
+ 	    printf ("FATAL\n");
+ 	  continue;
+@@ -309,11 +310,11 @@ doit (void)
+ 	  if (debug)
  	    {
- 	      free (p);
--	      error (EXIT_FAILURE, 0,
-+	      error (EXIT_FAILURE, 0, "%s",
- 		     _("could not convert from UTF-8 to UCS-4"));
+ 	      if (rc == IDNA_SUCCESS)
+-		printf ("len=%ld len2=%ld\n", len2, idna[i].inlen);
++		printf ("len=%d len2=%d\n", (int) len2, (int) idna[i].inlen);
+ 	      else
+-		printf ("len=%ld len2=%ld\n", len, len2);
++		printf ("len=%d len2=%d\n", (int) len, (int) len2);
  	    }
+-	  fail ("IDNA entry %ld failed\n", i);
++	  fail ("IDNA entry %u failed\n", i);
+ 	  if (debug)
+ 	    printf ("ERROR\n");
+ 	}
+diff --git a/tests/tst_idna2.c b/tests/tst_idna2.c
+index 65b3a4d..38932ca 100644
+--- a/tests/tst_idna2.c
++++ b/tests/tst_idna2.c
+@@ -461,14 +461,14 @@ static const struct idna idna[] = {
+ void
+ doit (void)
+ {
+-  size_t i;
++  unsigned i;
+   char *out;
+   int rc;
+ 
+   for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++)
+     {
+       if (debug)
+-	printf ("IDNA2 entry %ld\n", i);
++	printf ("IDNA2 entry %u\n", i);
+ 
+       if (debug)
+ 	{
+@@ -487,7 +487,7 @@ doit (void)
+ 			     IDNA_USE_STD3_ASCII_RULES);
+       if (rc != IDNA_SUCCESS && strlen (idna[i].out) > 0)
+ 	{
+-	  fail ("IDNA2 entry %ld failed: %d\n", i, rc);
++	  fail ("IDNA2 entry %u failed: %d\n", i, rc);
+ 	  continue;
+ 	}
  
-@@ -240,7 +240,7 @@ main (int argc, char *argv[])
- 	  if (!q)
+@@ -504,7 +504,7 @@ doit (void)
+ 	  if (strlen (idna[i].out) != strlen (out) ||
+ 	      strcasecmp (idna[i].out, out) != 0)
  	    {
- 	      free (r);
--	      error (EXIT_FAILURE, 0,
-+	      error (EXIT_FAILURE, 0, "%s",
- 		     _("could not convert from UTF-8 to UCS-4"));
+-	      fail ("IDNA2 entry %ld failed\n", i);
++	      fail ("IDNA2 entry %u failed\n", i);
+ 	      if (debug)
+ 		printf ("ERROR\n");
  	    }
+diff --git a/tests/tst_idna3.c b/tests/tst_idna3.c
+index a189378..f65628c 100644
+--- a/tests/tst_idna3.c
++++ b/tests/tst_idna3.c
+@@ -59,13 +59,13 @@ doit (void)
+ {
+   int rc;
+   char *out = NULL;
+-  size_t i;
++  unsigned i;
+ 
+   for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++)
+     {
+       rc = idna_to_unicode_8z8z (idna[i].in, &out, 0);
+       if (rc != IDNA_SUCCESS)
+-	fail ("IDNA3[%ld] failed %d\n", i, rc);
++	fail ("IDNA3[%u] failed %d\n", i, rc);
  
-@@ -277,7 +277,7 @@ main (int argc, char *argv[])
- 	  q = stringprep_utf8_to_ucs4 (p, -1, &len);
- 	  free (p);
- 	  if (!q)
--	    error (EXIT_FAILURE, 0,
-+	    error (EXIT_FAILURE, 0, "%s",
- 		   _("could not convert from UTF-8 to UCS-4"));
- 
- 	  if (args_info.debug_given)
-@@ -336,7 +336,7 @@ main (int argc, char *argv[])
- 	  r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
- 	  free (q);
- 	  if (!r)
--	    error (EXIT_FAILURE, 0,
-+	    error (EXIT_FAILURE, 0, "%s",
- 		   _("could not convert from UCS-4 to UTF-8"));
- 
- 	  p = stringprep_utf8_to_locale (r);
-@@ -360,7 +360,7 @@ main (int argc, char *argv[])
- 	  q = stringprep_utf8_to_ucs4 (p, -1, NULL);
- 	  free (p);
- 	  if (!q)
--	    error (EXIT_FAILURE, 0,
-+	    error (EXIT_FAILURE, 0, "%s",
- 		   _("could not convert from UCS-4 to UTF-8"));
- 
- 	  if (args_info.debug_given)
-@@ -438,7 +438,7 @@ main (int argc, char *argv[])
- 	  if (!q)
+       if (debug && rc == IDNA_SUCCESS)
+ 	{
+@@ -75,9 +75,9 @@ doit (void)
+ 	}
+ 
+       if (strcmp (out, idna[i].out) != 0)
+-	fail ("IDNA3[%ld] failed\n", i);
++	fail ("IDNA3[%u] failed\n", i);
+       else if (debug)
+-	printf ("IDNA3[%ld] success\n", i);
++	printf ("IDNA3[%u] success\n", i);
+ 
+       if (out)
+ 	idn_free (out);
+diff --git a/tests/tst_nfkc.c b/tests/tst_nfkc.c
+index d150fec..f5af9c6 100644
+--- a/tests/tst_nfkc.c
++++ b/tests/tst_nfkc.c
+@@ -68,18 +68,18 @@ void
+ doit (void)
+ {
+   char *out;
+-  size_t i;
++  unsigned i;
+ 
+   for (i = 0; i < sizeof (nfkc) / sizeof (nfkc[0]); i++)
+     {
+       if (debug)
+-	printf ("NFKC entry %ld\n", i);
++	printf ("NFKC entry %u\n", i);
+ 
+       out = stringprep_utf8_nfkc_normalize (nfkc[i].in,
+ 					    (ssize_t) strlen (nfkc[i].in));
+       if (out == NULL)
+ 	{
+-	  fail ("NFKC entry %ld failed fatally\n", i);
++	  fail ("NFKC entry %u failed fatally\n", i);
+ 	  continue;
+ 	}
+ 
+@@ -114,7 +114,7 @@ doit (void)
+       if (strlen (nfkc[i].out) != strlen (out) ||
+ 	  memcmp (nfkc[i].out, out, strlen (out)) != 0)
+ 	{
+-	  fail ("NFKC entry %ld failed\n", i);
++	  fail ("NFKC entry %u failed\n", i);
+ 	  if (debug)
+ 	    printf ("ERROR\n");
+ 	}
+diff --git a/tests/tst_pr29.c b/tests/tst_pr29.c
+index 3dc5466..11d0ede 100644
+--- a/tests/tst_pr29.c
++++ b/tests/tst_pr29.c
+@@ -91,7 +91,7 @@ static const struct tv tv[] = {
+ void
+ doit (void)
+ {
+-  size_t i;
++  unsigned i;
+   int rc;
+ 
+   for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++)
+@@ -100,7 +100,7 @@ doit (void)
+ 	{
+ 	  uint32_t *p, *q;
+ 
+-	  printf ("PR29 entry %ld: %s\n", i, tv[i].name);
++	  printf ("PR29 entry %u: %s\n", i, tv[i].name);
+ 
+ 	  printf ("in:\n");
+ 	  ucs4print (tv[i].in, tv[i].inlen);
+@@ -120,7 +120,7 @@ doit (void)
+       rc = pr29_4 (tv[i].in, tv[i].inlen);
+       if (rc != tv[i].rc)
+ 	{
+-	  fail ("PR29 entry %ld failed (expected %d): %d\n", i, tv[i].rc, rc);
++	  fail ("PR29 entry %u failed (expected %d): %d\n", i, tv[i].rc, rc);
+ 	  if (debug)
+ 	    printf ("FATAL\n");
+ 	  continue;
+@@ -129,7 +129,7 @@ doit (void)
+       rc = pr29_4z (tv[i].in);
+       if (rc != tv[i].rc)
+ 	{
+-	  fail ("PR29 entry %ld failed (expected %d): %d\n", i, tv[i].rc, rc);
++	  fail ("PR29 entry %u failed (expected %d): %d\n", i, tv[i].rc, rc);
+ 	  if (debug)
+ 	    printf ("FATAL\n");
+ 	  continue;
+@@ -142,7 +142,7 @@ doit (void)
+ 	p = stringprep_ucs4_to_utf8 (tv[i].in, (ssize_t) tv[i].inlen,
+ 				     &items_read, &items_written);
+ 	if (p == NULL)
+-	  fail ("FAIL: stringprep_ucs4_to_utf8(tv[%ld]) == NULL\n", i);
++	  fail ("FAIL: stringprep_ucs4_to_utf8(tv[%u]) == NULL\n", i);
+ 	if (debug)
+ 	  hexprint (p, strlen (p));
+ 
+@@ -150,7 +150,7 @@ doit (void)
+ 	free (p);
+ 	if (rc != tv[i].rc)
+ 	  {
+-	    fail ("PR29 entry %ld failed (expected %d): %d\n",
++	    fail ("PR29 entry %u failed (expected %d): %d\n",
+ 		  i, tv[i].rc, rc);
+ 	    if (debug)
+ 	      printf ("FATAL\n");
+diff --git a/tests/tst_punycode.c b/tests/tst_punycode.c
+index 493b8a2..997744a 100644
+--- a/tests/tst_punycode.c
++++ b/tests/tst_punycode.c
+@@ -173,7 +173,8 @@ doit (void)
+   char *p;
+   uint32_t *q;
+   int rc;
+-  size_t i, outlen;
++  size_t outlen;
++  unsigned i;
+ 
+   p = malloc (sizeof (*p) * BUFSIZ);
+   if (p == NULL)
+@@ -186,7 +187,7 @@ doit (void)
+   for (i = 0; i < sizeof (punycode) / sizeof (punycode[0]); i++)
+     {
+       if (debug)
+-	printf ("PUNYCODE entry %ld: %s\n", i, punycode[i].name);
++	printf ("PUNYCODE entry %u: %s\n", i, punycode[i].name);
+ 
+       if (debug)
+ 	{
+@@ -199,7 +200,7 @@ doit (void)
+ 			    NULL, &outlen, p);
+       if (rc != punycode[i].rc)
+ 	{
+-	  fail ("punycode_encode() entry %ld failed: %d\n", i, rc);
++	  fail ("punycode_encode() entry %u failed: %d\n", i, rc);
+ 	  if (debug)
+ 	    printf ("FATAL\n");
+ 	  continue;
+@@ -221,7 +222,7 @@ doit (void)
+ 	  if (strlen (punycode[i].out) != strlen (p) ||
+ 	      memcmp (punycode[i].out, p, strlen (p)) != 0)
+ 	    {
+-	      fail ("punycode() entry %ld failed\n", i);
++	      fail ("punycode() entry %u failed\n", i);
+ 	      if (debug)
+ 		printf ("ERROR\n");
+ 	    }
+@@ -241,7 +242,7 @@ doit (void)
+ 			    &outlen, q, NULL);
+       if (rc != punycode[i].rc)
+ 	{
+-	  fail ("punycode() entry %ld failed: %d\n", i, rc);
++	  fail ("punycode() entry %u failed: %d\n", i, rc);
+ 	  if (debug)
+ 	    printf ("FATAL\n");
+ 	  continue;
+@@ -262,7 +263,7 @@ doit (void)
+ 	  if (punycode[i].inlen != outlen ||
+ 	      memcmp (punycode[i].in, q, outlen) != 0)
  	    {
- 	      free (p);
--	      error (EXIT_FAILURE, 0,
-+	      error (EXIT_FAILURE, 0, "%s",
- 		     _("could not convert from UCS-4 to UTF-8"));
+-	      fail ("punycode_decode() entry %ld failed\n", i);
++	      fail ("punycode_decode() entry %u failed\n", i);
+ 	      if (debug)
+ 		printf ("ERROR\n");
  	    }
+diff --git a/tests/tst_strerror.c b/tests/tst_strerror.c
+index 71fff59..730f5e4 100644
+--- a/tests/tst_strerror.c
++++ b/tests/tst_strerror.c
+@@ -110,7 +110,7 @@ doit (void)
+   /* Iterate through all error codes. */
+ 
+   {
+-    size_t i;
++    unsigned i;
+     const char *last_p = NULL;
+ 
+     for (i = 0;; i++)
+@@ -126,13 +126,13 @@ doit (void)
+ 	    break;
+ 	  }
+ 	if (debug)
+-	  printf ("idna %ld: %s\n", i, p);
++	  printf ("idna %u: %s\n", i, p);
+ 	last_p = p;
+       }
+   }
+ 
+   {
+-    size_t i;
++    unsigned i;
+     const char *last_p = NULL;
+ 
+     for (i = 0;; i++)
+@@ -141,13 +141,13 @@ doit (void)
+ 	if (p == last_p)
+ 	  break;
+ 	if (debug)
+-	  printf ("pr29 %ld: %s\n", i, p);
++	  printf ("pr29 %u: %s\n", i, p);
+ 	last_p = p;
+       }
+   }
+ 
+   {
+-    size_t i;
++    unsigned i;
+     const char *last_p = NULL;
+ 
+     for (i = 0;; i++)
+@@ -156,13 +156,13 @@ doit (void)
+ 	if (p == last_p)
+ 	  break;
+ 	if (debug)
+-	  printf ("punycode %ld: %s\n", i, p);
++	  printf ("punycode %u: %s\n", i, p);
+ 	last_p = p;
+       }
+   }
  
-@@ -494,7 +494,7 @@ main (int argc, char *argv[])
- 	  r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
- 	  free (q);
- 	  if (!r)
--	    error (EXIT_FAILURE, 0,
-+	    error (EXIT_FAILURE, 0, "%s",
- 		   _("could not convert from UTF-8 to UCS-4"));
- 
- 	  p = stringprep_utf8_to_locale (r);
-@@ -523,7 +523,7 @@ main (int argc, char *argv[])
- 	      if (!q)
- 		{
- 		  free (p);
--		  error (EXIT_FAILURE, 0,
-+		  error (EXIT_FAILURE, 0, "%s",
- 			 _("could not convert from UTF-8 to UCS-4"));
- 		}
- 
-@@ -537,7 +537,8 @@ main (int argc, char *argv[])
- 	  r = stringprep_utf8_nfkc_normalize (p, -1);
- 	  free (p);
- 	  if (!r)
--	    error (EXIT_FAILURE, 0, _("could not do NFKC normalization"));
-+	    error (EXIT_FAILURE, 0, "%s",
-+		   _("could not do NFKC normalization"));
- 
- 	  if (args_info.debug_given)
+   {
+-    size_t i;
++    unsigned i;
+     const char *last_p = NULL;
+ 
+     for (i = 0;; i++)
+@@ -183,13 +183,13 @@ doit (void)
+ 	    break;
+ 	  }
+ 	if (debug)
+-	  printf ("stringprep %ld: %s\n", i, p);
++	  printf ("stringprep %u: %s\n", i, p);
+ 	last_p = p;
+       }
+   }
+ 
+   {
+-    size_t i;
++    unsigned i;
+     const char *last_p = NULL;
+ 
+     for (i = 0;; i++)
+@@ -198,7 +198,7 @@ doit (void)
+ 	if (p == last_p)
+ 	  break;
+ 	if (debug)
+-	  printf ("tld %ld: %s\n", i, p);
++	  printf ("tld %u: %s\n", i, p);
+ 	last_p = p;
+       }
+   }
+diff --git a/tests/tst_stringprep.c b/tests/tst_stringprep.c
+index 149ce6f..7c9ab06 100644
+--- a/tests/tst_stringprep.c
++++ b/tests/tst_stringprep.c
+@@ -205,7 +205,7 @@ doit (void)
+ {
+   char *p;
+   int rc;
+-  size_t i;
++  unsigned i;
+ 
+   if (!stringprep_check_version (STRINGPREP_VERSION))
+     fail ("stringprep_check_version failed (header %s runtime %s)\n",
+@@ -224,7 +224,7 @@ doit (void)
+   for (i = 0; i < sizeof (strprep) / sizeof (strprep[0]); i++)
+     {
+       if (debug)
+-	printf ("STRINGPREP entry %ld\n", i);
++	printf ("STRINGPREP entry %u\n", i);
+ 
+       if (debug)
+ 	{
+@@ -247,12 +247,12 @@ doit (void)
+ 	  continue;
+ 	else if (l == NULL)
+ 	  {
+-	    fail ("bad UTF-8 in entry %ld\n", i);
++	    fail ("bad UTF-8 in entry %u\n", i);
+ 	    continue;
+ 	  }
+ 	else if (strcmp (strprep[i].in, x) != 0)
+ 	  {
+-	    fail ("bad UTF-8 in entry %ld\n", i);
++	    fail ("bad UTF-8 in entry %u\n", i);
+ 	    if (debug)
+ 	      {
+ 		puts ("expected:");
+@@ -274,7 +274,7 @@ doit (void)
+ 			       "Nameprep", strprep[i].flags);
+       if (rc != strprep[i].rc)
+ 	{
+-	  fail ("stringprep() entry %ld failed: %d\n", i, rc);
++	  fail ("stringprep() entry %u failed: %d\n", i, rc);
+ 	  if (debug)
+ 	    printf ("FATAL\n");
+ 	  if (rc == STRINGPREP_OK)
+@@ -302,7 +302,7 @@ doit (void)
+ 	  if (strlen (strprep[i].out) != strlen (p) ||
+ 	      memcmp (strprep[i].out, p, strlen (p)) != 0)
  	    {
-@@ -547,7 +548,7 @@ main (int argc, char *argv[])
- 	      if (!q)
- 		{
- 		  free (r);
--		  error (EXIT_FAILURE, 0,
-+		  error (EXIT_FAILURE, 0, "%s",
- 			 _("could not convert from UTF-8 to UCS-4"));
- 		}
+-	      fail ("stringprep() entry %ld failed\n", i);
++	      fail ("stringprep() entry %ld failed\n", (long) i);
+ 	      if (debug)
+ 		printf ("ERROR\n");
+ 	    }
+diff --git a/tests/tst_tld.c b/tests/tst_tld.c
+index 2f8e12e..d038c79 100644
+--- a/tests/tst_tld.c
++++ b/tests/tst_tld.c
+@@ -80,7 +80,7 @@ const Tld_table * my_tld_tables[] =
+ void
+ doit (void)
+ {
+-  size_t i;
++  unsigned i;
+   const Tld_table *tldtable;
+   char *out;
+   size_t errpos;
+@@ -206,7 +206,7 @@ doit (void)
+   for (i = 0; i < sizeof (tld) / sizeof (tld[0]); i++)
+     {
+       if (debug)
+-	printf ("TLD entry %ld: %s\n", i, tld[i].name);
++	printf ("TLD entry %u: %s\n", i, tld[i].name);
+ 
+       if (debug)
+ 	{
+@@ -217,7 +217,7 @@ doit (void)
+       tldtable = tld_default_table (tld[i].tld, NULL);
+       if (tldtable == NULL)
+ 	{
+-	  fail ("TLD entry %ld tld_get_table (%s)\n", i, tld[i].tld);
++	  fail ("TLD entry %u tld_get_table (%s)\n", i, tld[i].tld);
+ 	  if (debug)
+ 	    printf ("FATAL\n");
+ 	  continue;
+@@ -226,7 +226,7 @@ doit (void)
+       rc = tld_check_4t (tld[i].in, tld[i].inlen, &errpos, tldtable);
+       if (rc != tld[i].rc)
+ 	{
+-	  fail ("TLD entry %ld failed: %d\n", i, rc);
++	  fail ("TLD entry %u failed: %d\n", i, rc);
+ 	  if (debug)
+ 	    printf ("FATAL\n");
+ 	  continue;
+@@ -237,7 +237,7 @@ doit (void)
  
+       if (rc != tld[i].rc)
+ 	{
+-	  fail ("TLD entry %ld failed\n", i);
++	  fail ("TLD entry %u failed\n", i);
+ 	  if (debug)
+ 	    printf ("ERROR\n");
+ 	}
+@@ -245,12 +245,12 @@ doit (void)
+ 	{
+ 	  if (debug)
+ 	    printf ("returned errpos %ld expected errpos %ld\n",
+-		    errpos, tld[i].errpos);
++		    (long) errpos, (long) tld[i].errpos);
+ 
+ 	  if (tld[i].errpos != errpos)
+ 	    {
+-	      fail ("TLD entry %ld failed because errpos %ld != %ld\n", i,
+-		    tld[i].errpos, errpos);
++	      fail ("TLD entry %u failed because errpos %ld != %ld\n", i,
++		    (long) tld[i].errpos, (long) errpos);
+ 	      if (debug)
+ 		printf ("ERROR\n");
+ 	    }
+@@ -262,12 +262,12 @@ doit (void)
+ 	rc = tld_check_8z (tld[i].example, &errpos, NULL);
+ 	if (rc != tld[i].rc)
+ 	  {
+-	    fail ("TLD entry %ld failed\n", i);
++	    fail ("TLD entry %u failed\n", i);
+ 	    if (debug)
+ 	      printf ("ERROR\n");
+ 	  }
+ 	if (debug)
+-	  printf ("TLD entry %ld tld_check_8z (%s)\n", i, tld[i].example);
++	  printf ("TLD entry %u tld_check_8z (%s)\n", i, tld[i].example);
+       }
+     }
+ }
+diff --git a/tests/utils.c b/tests/utils.c
+index 717ee01..5577dc3 100644
+--- a/tests/utils.c
++++ b/tests/utils.c
+@@ -49,7 +49,7 @@ escapeprint (const char *str, size_t len)
+ {
+   size_t i;
+ 
+-  printf (" (length %ld bytes):\n\t", len);
++  printf (" (length %ld bytes):\n\t", (long) len);
+   for (i = 0; i < len; i++)
+     {
+       if (((str[i] & 0xFF) >= 'A' && (str[i] & 0xFF) <= 'Z') ||
+@@ -58,7 +58,7 @@ escapeprint (const char *str, size_t len)
+ 	  || (str[i] & 0xFF) == ' ' || (str[i] & 0xFF) == '.')
+ 	printf ("%c", (str[i] & 0xFF));
+       else
+-	printf ("\\x%02X", (str[i] & 0xFF));
++	printf ("\\x%02X", (unsigned) (str[i] & 0xFF));
+       if ((i + 1) % 16 == 0 && (i + 1) < len)
+ 	printf ("'\n\t'");
+     }
+@@ -73,7 +73,7 @@ hexprint (const char *str, size_t len)
+   printf ("\t;; ");
+   for (i = 0; i < len; i++)
+     {
+-      printf ("%02x ", (str[i] & 0xFF));
++      printf ("%02x ", (unsigned) (str[i] & 0xFF));
+       if ((i + 1) % 8 == 0)
+ 	printf (" ");
+       if ((i + 1) % 16 == 0 && i + 1 < len)
 -- 
-2.8.1
+1.9.1
 
diff --git a/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch b/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch
new file mode 100644
index 00000000000..546a6eaafcf
--- /dev/null
+++ b/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch
@@ -0,0 +1,334 @@
+From 230930b3bc3e431b819eb45420cb42475d83ca93 Mon Sep 17 00:00:00 2001
+From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
+Date: Wed, 1 Feb 2017 10:44:36 +0100
+Subject: [PATCH] Update intprops.h for gcc-7 compatibility
+
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ gl/intprops.h          | 65 ++++++++++++++++++++++++++++++--------------------
+ lib/gltests/intprops.h | 65 ++++++++++++++++++++++++++++++--------------------
+ 2 files changed, 78 insertions(+), 52 deletions(-)
+
+diff --git a/gl/intprops.h b/gl/intprops.h
+index e1fce5c..eb06b69 100644
+--- a/gl/intprops.h
++++ b/gl/intprops.h
+@@ -1,18 +1,18 @@
+ /* intprops.h -- properties of integer types
+ 
+-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
++   Copyright (C) 2001-2017 Free Software Foundation, Inc.
+ 
+    This program is free software: you can redistribute it and/or modify it
+-   under the terms of the GNU General Public License as published
+-   by the Free Software Foundation; either version 3 of the License, or
++   under the terms of the GNU Lesser General Public License as published
++   by the Free Software Foundation; either version 2.1 of the License, or
+    (at your option) any later version.
+ 
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-   GNU General Public License for more details.
++   GNU Lesser General Public License for more details.
+ 
+-   You should have received a copy of the GNU General Public License
++   You should have received a copy of the GNU Lesser General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ 
+ /* Written by Paul Eggert.  */
+@@ -47,12 +47,16 @@
+ 
+ /* Minimum and maximum values for integer types and expressions.  */
+ 
++/* The width in bits of the integer type or expression T.
++   Padding bits are not supported; this is checked at compile-time below.  */
++#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
++
+ /* The maximum and minimum values for the integer type T.  */
+ #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
+ #define TYPE_MAXIMUM(t)                                                 \
+   ((t) (! TYPE_SIGNED (t)                                               \
+         ? (t) -1                                                        \
+-        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
++        : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
+ 
+ /* The maximum and minimum values for the type of the expression E,
+    after integer promotion.  E should not have side effects.  */
+@@ -65,7 +69,13 @@
+    ? _GL_SIGNED_INT_MAXIMUM (e)                                         \
+    : _GL_INT_NEGATE_CONVERT (e, 1))
+ #define _GL_SIGNED_INT_MAXIMUM(e)                                       \
+-  (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
++  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
++
++/* Work around OpenVMS incompatibility with C99.  */
++#if !defined LLONG_MAX && defined __INT64_MAX
++# define LLONG_MAX __INT64_MAX
++# define LLONG_MIN __INT64_MIN
++#endif
+ 
+ /* This include file assumes that signed types are two's complement without
+    padding bits; the above macros have undefined behavior otherwise.
+@@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX);
+ verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
+ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ #endif
++/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined.  */
++#ifdef UINT_WIDTH
++verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
++#endif
+ 
+ /* Does the __typeof__ keyword work?  This could be done by
+    'configure', but for now it's easier to do it by hand.  */
+-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
++#if (2 <= __GNUC__ \
++     || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
+      || (0x5110 <= __SUNPRO_C && !__STDC__))
+ # define _GL_HAVE___TYPEOF__ 1
+ #else
+@@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+    signed, this macro may overestimate the true bound by one byte when
+    applied to unsigned types of size 2, 4, 16, ... bytes.  */
+ #define INT_STRLEN_BOUND(t)                                     \
+-  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT                 \
+-                          - _GL_SIGNED_TYPE_OR_EXPR (t))        \
++  (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
+    + _GL_SIGNED_TYPE_OR_EXPR (t))
+ 
+ /* Bound on buffer size needed to represent an integer type or expression T,
+@@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+    ? (a) < (min) >> (b)                                 \
+    : (max) >> (b) < (a))
+ 
+-/* True if __builtin_add_overflow (A, B, P) works when P is null.  */
+-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
++/* True if __builtin_add_overflow (A, B, P) works when P is non-null.  */
++#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__)
++
++/* True if __builtin_add_overflow_p (A, B, C) works.  */
++#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+ 
+ /* The _GL*_OVERFLOW macros have the same restrictions as the
+    *_RANGE_OVERFLOW macros, except that they do not assume that operands
+    (e.g., A and B) have the same type as MIN and MAX.  Instead, they assume
+    that the result (e.g., A + B) has that type.  */
+-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+-# define _GL_ADD_OVERFLOW(a, b, min, max)
+-   __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
+-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
+-   __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
+-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
+-   __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
++#if _GL_HAS_BUILTIN_OVERFLOW_P
++# define _GL_ADD_OVERFLOW(a, b, min, max)                               \
++   __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                          \
++   __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                          \
++   __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
+ #else
+ # define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+    ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max)                  \
+@@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+   _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
+ #define INT_SUBTRACT_OVERFLOW(a, b) \
+   _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
+-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
++#if _GL_HAS_BUILTIN_OVERFLOW_P
+ # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
+ #else
+ # define INT_NEGATE_OVERFLOW(a) \
+@@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ #define INT_MULTIPLY_WRAPV(a, b, r) \
+   _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
+ 
+-#ifndef __has_builtin
+-# define __has_builtin(x) 0
+-#endif
+-
+ /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390.  See:
+    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
+    https://llvm.org/bugs/show_bug.cgi?id=25390
+@@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+    the operation.  BUILTIN is the builtin operation, and OVERFLOW the
+    overflow predicate.  Return 1 if the result overflows.  See above
+    for restrictions.  */
+-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
++#if _GL_HAS_BUILTIN_OVERFLOW
+ # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
+ #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
+ # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+@@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ # else
+ #  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+     _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+-                     long int, LONG_MIN, LONG_MAX))
++                     long int, LONG_MIN, LONG_MAX)
+ # endif
+ #endif
+ 
+diff --git a/lib/gltests/intprops.h b/lib/gltests/intprops.h
+index e1fce5c..eb06b69 100644
+--- a/lib/gltests/intprops.h
++++ b/lib/gltests/intprops.h
+@@ -1,18 +1,18 @@
+ /* intprops.h -- properties of integer types
+ 
+-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
++   Copyright (C) 2001-2017 Free Software Foundation, Inc.
+ 
+    This program is free software: you can redistribute it and/or modify it
+-   under the terms of the GNU General Public License as published
+-   by the Free Software Foundation; either version 3 of the License, or
++   under the terms of the GNU Lesser General Public License as published
++   by the Free Software Foundation; either version 2.1 of the License, or
+    (at your option) any later version.
+ 
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-   GNU General Public License for more details.
++   GNU Lesser General Public License for more details.
+ 
+-   You should have received a copy of the GNU General Public License
++   You should have received a copy of the GNU Lesser General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ 
+ /* Written by Paul Eggert.  */
+@@ -47,12 +47,16 @@
+ 
+ /* Minimum and maximum values for integer types and expressions.  */
+ 
++/* The width in bits of the integer type or expression T.
++   Padding bits are not supported; this is checked at compile-time below.  */
++#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
++
+ /* The maximum and minimum values for the integer type T.  */
+ #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
+ #define TYPE_MAXIMUM(t)                                                 \
+   ((t) (! TYPE_SIGNED (t)                                               \
+         ? (t) -1                                                        \
+-        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
++        : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
+ 
+ /* The maximum and minimum values for the type of the expression E,
+    after integer promotion.  E should not have side effects.  */
+@@ -65,7 +69,13 @@
+    ? _GL_SIGNED_INT_MAXIMUM (e)                                         \
+    : _GL_INT_NEGATE_CONVERT (e, 1))
+ #define _GL_SIGNED_INT_MAXIMUM(e)                                       \
+-  (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
++  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
++
++/* Work around OpenVMS incompatibility with C99.  */
++#if !defined LLONG_MAX && defined __INT64_MAX
++# define LLONG_MAX __INT64_MAX
++# define LLONG_MIN __INT64_MIN
++#endif
+ 
+ /* This include file assumes that signed types are two's complement without
+    padding bits; the above macros have undefined behavior otherwise.
+@@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX);
+ verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
+ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ #endif
++/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined.  */
++#ifdef UINT_WIDTH
++verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
++#endif
+ 
+ /* Does the __typeof__ keyword work?  This could be done by
+    'configure', but for now it's easier to do it by hand.  */
+-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
++#if (2 <= __GNUC__ \
++     || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
+      || (0x5110 <= __SUNPRO_C && !__STDC__))
+ # define _GL_HAVE___TYPEOF__ 1
+ #else
+@@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+    signed, this macro may overestimate the true bound by one byte when
+    applied to unsigned types of size 2, 4, 16, ... bytes.  */
+ #define INT_STRLEN_BOUND(t)                                     \
+-  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT                 \
+-                          - _GL_SIGNED_TYPE_OR_EXPR (t))        \
++  (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
+    + _GL_SIGNED_TYPE_OR_EXPR (t))
+ 
+ /* Bound on buffer size needed to represent an integer type or expression T,
+@@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+    ? (a) < (min) >> (b)                                 \
+    : (max) >> (b) < (a))
+ 
+-/* True if __builtin_add_overflow (A, B, P) works when P is null.  */
+-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
++/* True if __builtin_add_overflow (A, B, P) works when P is non-null.  */
++#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__)
++
++/* True if __builtin_add_overflow_p (A, B, C) works.  */
++#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+ 
+ /* The _GL*_OVERFLOW macros have the same restrictions as the
+    *_RANGE_OVERFLOW macros, except that they do not assume that operands
+    (e.g., A and B) have the same type as MIN and MAX.  Instead, they assume
+    that the result (e.g., A + B) has that type.  */
+-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+-# define _GL_ADD_OVERFLOW(a, b, min, max)
+-   __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
+-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
+-   __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
+-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
+-   __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
++#if _GL_HAS_BUILTIN_OVERFLOW_P
++# define _GL_ADD_OVERFLOW(a, b, min, max)                               \
++   __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                          \
++   __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                          \
++   __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
+ #else
+ # define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+    ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max)                  \
+@@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+   _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
+ #define INT_SUBTRACT_OVERFLOW(a, b) \
+   _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
+-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
++#if _GL_HAS_BUILTIN_OVERFLOW_P
+ # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
+ #else
+ # define INT_NEGATE_OVERFLOW(a) \
+@@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ #define INT_MULTIPLY_WRAPV(a, b, r) \
+   _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
+ 
+-#ifndef __has_builtin
+-# define __has_builtin(x) 0
+-#endif
+-
+ /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390.  See:
+    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
+    https://llvm.org/bugs/show_bug.cgi?id=25390
+@@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+    the operation.  BUILTIN is the builtin operation, and OVERFLOW the
+    overflow predicate.  Return 1 if the result overflows.  See above
+    for restrictions.  */
+-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
++#if _GL_HAS_BUILTIN_OVERFLOW
+ # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
+ #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
+ # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+@@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ # else
+ #  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+     _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+-                     long int, LONG_MIN, LONG_MAX))
++                     long int, LONG_MIN, LONG_MAX)
+ # endif
+ #endif
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-extended/libidn/libidn_1.33.bb b/meta/recipes-extended/libidn/libidn_1.33.bb
index d3d0f557bba..109cc7f3f55 100644
--- a/meta/recipes-extended/libidn/libidn_1.33.bb
+++ b/meta/recipes-extended/libidn/libidn_1.33.bb
@@ -19,6 +19,7 @@ SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \
            file://avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch \
            file://dont-depend-on-help2man.patch \
            file://0001-idn-fix-printf-format-security-warnings.patch \
+           file://gcc7-compatibility.patch \
 "
 
 SRC_URI[md5sum] = "a9aa7e003665de9c82bd3f9fc6ccf308"
-- 
2.12.2



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

* ✗ patchtest: failure for "libtirpc: Backport fixes from ..." and 4 more
  2017-04-19  1:58 [PATCH 1/5] libtirpc: Backport fixes from 1.0.2rc3 Khem Raj
                   ` (3 preceding siblings ...)
  2017-04-19  1:58 ` [PATCH 5/5] libidn: Fix build with gcc7 Khem Raj
@ 2017-04-19  2:01 ` Patchwork
  4 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2017-04-19  2:01 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

== Series Details ==

Series: "libtirpc: Backport fixes from ..." and 4 more
Revision: 1
URL   : https://patchwork.openembedded.org/series/6407/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Added patch file is missing Upstream-Status in the header [test_upstream_status_presence] 
  Suggested fix    Add Upstream-Status: <status> to the header of meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch (possible values: Pending, Submitted, Accepted, Backport, Denied, Inappropriate)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



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

* Re: [PATCH 2/5] libtirpc: Expose key_secretkey_is_set API
  2017-04-19  1:58 ` [PATCH 2/5] libtirpc: Expose key_secretkey_is_set API Khem Raj
@ 2017-04-19  8:52   ` Burton, Ross
  2017-04-19 16:25     ` Khem Raj
  0 siblings, 1 reply; 15+ messages in thread
From: Burton, Ross @ 2017-04-19  8:52 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

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

On 19 April 2017 at 02:58, Khem Raj <raj.khem@gmail.com> wrote:

> +-    key_secret_is_set;
> ++    key_secretkey_is_set;
>

This removes key_secret_is_set, was this a typo upstream or a mistake in
the patch?

Ross

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

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

* Re: [PATCH 3/5] libtirpc: Enable des APIs for musl
  2017-04-19  1:58 ` [PATCH 3/5] libtirpc: Enable des APIs for musl Khem Raj
@ 2017-04-19  8:57   ` André Draszik
  2017-04-19 12:53     ` Burton, Ross
  2017-04-19 16:34     ` Khem Raj
  0 siblings, 2 replies; 15+ messages in thread
From: André Draszik @ 2017-04-19  8:57 UTC (permalink / raw)
  To: openembedded-core

On Tue, 2017-04-18 at 18:58 -0700, Khem Raj wrote:
> Use memset() API instead of __bzero()
> Drop the patch removing des_* functions for musl
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  .../0001-replace-__bzero-with-memset-API.patch     |  28 +++++
>  .../libtirpc/remove-des-functionality.patch        | 139 ----------------
> -----
>  meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb   |   5 +-
>  3 files changed, 31 insertions(+), 141 deletions(-)
>  create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0001-replace-
> __bzero-with-memset-API.patch
>  delete mode 100644 meta/recipes-extended/libtirpc/libtirpc/remove-des-
> functionality.patch
> 
> [...]
> 
>  
>  SRC_URI_append_libc-uclibc = " file://remove-des-functionality.patch \

This patch is being removed with this change, and so uclibc builds will
fail. Is it time to remove all remaining references to uclibc?

Cheers,
Andre'



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

* Re: [PATCH 3/5] libtirpc: Enable des APIs for musl
  2017-04-19  8:57   ` André Draszik
@ 2017-04-19 12:53     ` Burton, Ross
  2017-04-19 16:34     ` Khem Raj
  1 sibling, 0 replies; 15+ messages in thread
From: Burton, Ross @ 2017-04-19 12:53 UTC (permalink / raw)
  To: André Draszik; +Cc: OE-core

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

On 19 April 2017 at 09:57, André Draszik <git@andred.net> wrote:

> This patch is being removed with this change, and so uclibc builds will
> fail. Is it time to remove all remaining references to uclibc?
>

Yes!

Ross

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

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

* Re: [PATCH 5/5] libidn: Fix build with gcc7
  2017-04-19  1:58 ` [PATCH 5/5] libidn: Fix build with gcc7 Khem Raj
@ 2017-04-19 15:06   ` André Draszik
  2017-04-19 16:36     ` Khem Raj
  0 siblings, 1 reply; 15+ messages in thread
From: André Draszik @ 2017-04-19 15:06 UTC (permalink / raw)
  To: openembedded-core

On Tue, 2017-04-18 at 18:58 -0700, Khem Raj wrote:
> Replace a local patch for format warning with the one
> that got committed upstream

This commit message is confusing, as the two patches are unrelated and they
are addressing different issues.

You are:
- removing a patch that fixed Wformat-security warnings / errors
  (not upstreamed)
- adding a patch that fixes other (unrelated) Wformat warnings
  (from upstream)


Cheers,
Andre'

> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  ...1-idn-fix-printf-format-security-warnings.patch | 825
> +++++++++++++++++----
>  .../libidn/libidn/gcc7-compatibility.patch         | 334 +++++++++
>  meta/recipes-extended/libidn/libidn_1.33.bb        |   1 +
>  3 files changed, 1004 insertions(+), 156 deletions(-)
>  create mode 100644 meta/recipes-extended/libidn/libidn/gcc7-
> compatibility.patch
> 
> diff --git a/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-
> format-security-warnings.patch b/meta/recipes-extended/libidn/libidn/0001-
> idn-fix-printf-format-security-warnings.patch
> index 5adc7d9fd98..2d5faabb240 100644
> --- a/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-
> security-warnings.patch
> +++ b/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-
> security-warnings.patch
> @@ -1,181 +1,694 @@
> -From 82f98dcbc429bbe89a9837c533cbcbc02e77c790 Mon Sep 17 00:00:00 2001
> -From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
> -Date: Tue, 28 Jun 2016 12:43:31 +0100
> -Subject: [PATCH] idn: fix printf() format security warnings
> -MIME-Version: 1.0
> -Content-Type: text/plain; charset=UTF-8
> -Content-Transfer-Encoding: 8bit
> +From 7148adf34dae30345c2e4d9d437838a45ba6f6e8 Mon Sep 17 00:00:00 2001
> +From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
> +Date: Wed, 1 Feb 2017 11:06:39 +0100
> +Subject: [PATCH] Fix -Wformat warnings
>  
> -| ../../libidn-1.32/src/idn.c: In function 'main':
> -| ../../libidn-1.32/src/idn.c:172:7: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|        error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be
> specified"));
> -|        ^~~~~
> -| ../../libidn-1.32/src/idn.c:187:5: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|      fprintf (stderr, _("Type each input string on a line by itself, "
> -|      ^~~~~~~
> -| ../../libidn-1.32/src/idn.c:202:4: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|     error (EXIT_FAILURE, errno, _("input error"));
> -|     ^~~~~
> -| ../../libidn-1.32/src/idn.c:220:8: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|         _("could not convert from UTF-8 to UCS-4"));
> -|         ^
> -| ../../libidn-1.32/src/idn.c:245:8: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|         _("could not convert from UTF-8 to UCS-4"));
> -|         ^
> -| ../../libidn-1.32/src/idn.c:281:6: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|       _("could not convert from UTF-8 to UCS-4"));
> -|       ^
> -| ../../libidn-1.32/src/idn.c:340:6: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|       _("could not convert from UCS-4 to UTF-8"));
> -|       ^
> -| ../../libidn-1.32/src/idn.c:364:6: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|       _("could not convert from UCS-4 to UTF-8"));
> -|       ^
> -| ../../libidn-1.32/src/idn.c:442:8: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|         _("could not convert from UCS-4 to UTF-8"));
> -|         ^
> -| ../../libidn-1.32/src/idn.c:498:6: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|       _("could not convert from UTF-8 to UCS-4"));
> -|       ^
> -| ../../libidn-1.32/src/idn.c:527:5: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|      _("could not convert from UTF-8 to UCS-4"));
> -|      ^
> -| ../../libidn-1.32/src/idn.c:540:6: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|       error (EXIT_FAILURE, 0, _("could not do NFKC normalization"));
> -|       ^~~~~
> -| ../../libidn-1.32/src/idn.c:551:5: error: format not a string literal
> and no format arguments [-Werror=format-security]
> -|      _("could not convert from UTF-8 to UCS-4"));
> -|      ^
> -
> -Signed-off-by: André Draszik <adraszik@tycoint.com>
>  ---
> -Upstream-Status: Pending
> +Upstream-Status: Backport
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>  
> - src/idn.c | 27 ++++++++++++++-------------
> - 1 file changed, 14 insertions(+), 13 deletions(-)
> + examples/example.c     |  6 +++---
> + examples/example3.c    |  4 ++--
> + examples/example4.c    |  4 ++--
> + examples/example5.c    |  2 +-
> + src/idn.c              |  2 +-
> + tests/tst_idna.c       | 25 +++++++++++++------------
> + tests/tst_idna2.c      |  8 ++++----
> + tests/tst_idna3.c      |  8 ++++----
> + tests/tst_nfkc.c       |  8 ++++----
> + tests/tst_pr29.c       | 12 ++++++------
> + tests/tst_punycode.c   | 13 +++++++------
> + tests/tst_strerror.c   | 20 ++++++++++----------
> + tests/tst_stringprep.c | 12 ++++++------
> + tests/tst_tld.c        | 20 ++++++++++----------
> + tests/utils.c          |  6 +++---
> + 15 files changed, 76 insertions(+), 74 deletions(-)
>  
> +diff --git a/examples/example.c b/examples/example.c
> +index 6e91783..24f64e0 100644
> +--- a/examples/example.c
> ++++ b/examples/example.c
> +@@ -55,7 +55,7 @@ main (void)
> + 
> +   printf ("Before locale2utf8 (length %ld): ", (long int) strlen (buf));
> +   for (i = 0; i < strlen (buf); i++)
> +-    printf ("%02x ", buf[i] & 0xFF);
> ++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
> +   printf ("\n");
> + 
> +   p = stringprep_locale_to_utf8 (buf);
> +@@ -69,7 +69,7 @@ main (void)
> + 
> +   printf ("Before stringprep (length %ld): ", (long int) strlen (buf));
> +   for (i = 0; i < strlen (buf); i++)
> +-    printf ("%02x ", buf[i] & 0xFF);
> ++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
> +   printf ("\n");
> + 
> +   rc = stringprep (buf, BUFSIZ, 0, stringprep_nameprep);
> +@@ -79,7 +79,7 @@ main (void)
> +     {
> +       printf ("After stringprep (length %ld): ", (long int) strlen
> (buf));
> +       for (i = 0; i < strlen (buf); i++)
> +-	printf ("%02x ", buf[i] & 0xFF);
> ++	printf ("%02x ", (unsigned) buf[i] & 0xFF);
> +       printf ("\n");
> +     }
> + 
> +diff --git a/examples/example3.c b/examples/example3.c
> +index fc11c1c..ffb9042 100644
> +--- a/examples/example3.c
> ++++ b/examples/example3.c
> +@@ -56,7 +56,7 @@ main (void)
> + 
> +   printf ("Read string (length %ld): ", (long int) strlen (buf));
> +   for (i = 0; i < strlen (buf); i++)
> +-    printf ("%02x ", buf[i] & 0xFF);
> ++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
> +   printf ("\n");
> + 
> +   rc = idna_to_ascii_lz (buf, &p, 0);
> +@@ -68,7 +68,7 @@ main (void)
> + 
> +   printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p);
> +   for (i = 0; i < strlen (p); i++)
> +-    printf ("%02x ", p[i] & 0xFF);
> ++    printf ("%02x ", (unsigned) p[i] & 0xFF);
> +   printf ("\n");
> + 
> +   free (p);
> +diff --git a/examples/example4.c b/examples/example4.c
> +index 1b319c9..a3315a1 100644
> +--- a/examples/example4.c
> ++++ b/examples/example4.c
> +@@ -56,7 +56,7 @@ main (void)
> + 
> +   printf ("Read string (length %ld): ", (long int) strlen (buf));
> +   for (i = 0; i < strlen (buf); i++)
> +-    printf ("%02x ", buf[i] & 0xFF);
> ++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
> +   printf ("\n");
> + 
> +   rc = idna_to_unicode_lzlz (buf, &p, 0);
> +@@ -68,7 +68,7 @@ main (void)
> + 
> +   printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p);
> +   for (i = 0; i < strlen (p); i++)
> +-    printf ("%02x ", p[i] & 0xFF);
> ++    printf ("%02x ", (unsigned) p[i] & 0xFF);
> +   printf ("\n");
> + 
> +   free (p);
> +diff --git a/examples/example5.c b/examples/example5.c
> +index df55798..29d40b9 100644
> +--- a/examples/example5.c
> ++++ b/examples/example5.c
> +@@ -68,7 +68,7 @@ main (void)
> + 
> +   printf ("Read string (length %ld): ", (long int) strlen (buf));
> +   for (i = 0; i < strlen (buf); i++)
> +-    printf ("%02x ", buf[i] & 0xFF);
> ++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
> +   printf ("\n");
> + 
> +   p = stringprep_locale_to_utf8 (buf);
>  diff --git a/src/idn.c b/src/idn.c
> -index be1c7d1..68e4291 100644
> +index be1c7d1..13eb3c9 100644
>  --- a/src/idn.c
>  +++ b/src/idn.c
> -@@ -170,7 +170,7 @@ main (int argc, char *argv[])
> -       (args_info.idna_to_unicode_given ? 1 : 0) +
> -       (args_info.nfkc_given ? 1 : 0) != 1)
> +@@ -419,7 +419,7 @@ main (int argc, char *argv[])
> + 	      size_t i;
> + 	      for (i = 0; p[i]; i++)
> + 		fprintf (stderr, "output[%lu] = U+%04x\n",
> +-			 (unsigned long) i, p[i]);
> ++			 (unsigned long) i, (unsigned) p[i]);
> + 	    }
> + 
> + 	  fprintf (stdout, "%s\n", p);
> +diff --git a/tests/tst_idna.c b/tests/tst_idna.c
> +index 415764e..4ac046f 100644
> +--- a/tests/tst_idna.c
> ++++ b/tests/tst_idna.c
> +@@ -220,13 +220,14 @@ doit (void)
> +   char label[100];
> +   uint32_t *ucs4label = NULL;
> +   uint32_t tmp[100];
> +-  size_t len, len2, i;
> ++  size_t len, len2;
> +   int rc;
> ++  unsigned i;
> + 
> +   for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++)
>       {
> --      error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be
> specified"));
> -+      error (0, 0, "%s", _("only one of -s, -e, -d, -a, -u or -n can be
> specified"));
> -       usage (EXIT_FAILURE);
> -     }
> +       if (debug)
> +-	printf ("IDNA entry %ld: %s\n", i, idna[i].name);
> ++	printf ("IDNA entry %u: %s\n", i, idna[i].name);
>   
> -@@ -185,7 +185,7 @@ main (int argc, char *argv[])
> -   if (!args_info.quiet_given
> -       && args_info.inputs_num == 0
> -       && isatty (fileno (stdin)))
> --    fprintf (stderr, _("Type each input string on a line by itself, "
> -+    fprintf (stderr, "%s", _("Type each input string on a line by
> itself, "
> - 		       "terminated by a newline character.\n"));
> - 
> -   do
> -@@ -197,7 +197,7 @@ main (int argc, char *argv[])
> - 	  if (feof (stdin))
> - 	    break;
> +       if (debug)
> + 	{
> +@@ -237,7 +238,7 @@ doit (void)
> +       rc = idna_to_ascii_4i (idna[i].in, idna[i].inlen, label,
> idna[i].flags);
> +       if (rc != idna[i].toasciirc)
> + 	{
> +-	  fail ("IDNA entry %ld failed: %d\n", i, rc);
> ++	  fail ("IDNA entry %u failed: %d\n", i, rc);
> + 	  if (debug)
> + 	    printf ("FATAL\n");
> + 	  continue;
> +@@ -256,7 +257,7 @@ doit (void)
> + 	  if (strlen (idna[i].out) != strlen (label) ||
> + 	      strcasecmp (idna[i].out, label) != 0)
> + 	    {
> +-	      fail ("IDNA entry %ld failed\n", i);
> ++	      fail ("IDNA entry %u failed\n", i);
> + 	      if (debug)
> + 		printf ("ERROR\n");
> + 	    }
> +@@ -273,8 +274,8 @@ doit (void)
>   
> --	  error (EXIT_FAILURE, errno, _("input error"));
> -+	  error (EXIT_FAILURE, errno, "%s", _("input error"));
> +       if (debug)
> + 	{
> +-	  printf ("in: %s (%ld==%ld)\n", idna[i].out, strlen
> (idna[i].out),
> +-		  len);
> ++	  printf ("in: %s (%d==%d)\n", idna[i].out, (int) strlen
> (idna[i].out),
> ++		  (int) len);
> + 	  ucs4print (ucs4label, len);
>   	}
>   
> -       if (strlen (line) > 0)
> -@@ -215,7 +215,7 @@ main (int argc, char *argv[])
> - 	  if (!q)
> +@@ -282,20 +283,20 @@ doit (void)
> +       rc = idna_to_unicode_44i (ucs4label, len, tmp, &len2,
> idna[i].flags);
> +       if (debug)
> + 	{
> +-	  printf ("expected out (%ld):\n",
> ++	  printf ("expected out (%lu):\n",
> + 		  rc == IDNA_SUCCESS ? idna[i].inlen : len);
> + 	  if (rc == IDNA_SUCCESS)
> + 	    ucs4print (idna[i].in, idna[i].inlen);
> + 	  else
> + 	    ucs4print (ucs4label, len);
> + 
> +-	  printf ("computed out (%ld):\n", len2);
> ++	  printf ("computed out (%d):\n", (int) len2);
> + 	  ucs4print (tmp, len2);
> + 	}
> + 
> +       if (rc != idna[i].tounicoderc)
> + 	{
> +-	  fail ("IDNA entry %ld failed: %d\n", i, rc);
> ++	  fail ("IDNA entry %u failed: %d\n", i, rc);
> + 	  if (debug)
> + 	    printf ("FATAL\n");
> + 	  continue;
> +@@ -309,11 +310,11 @@ doit (void)
> + 	  if (debug)
>   	    {
> - 	      free (p);
> --	      error (EXIT_FAILURE, 0,
> -+	      error (EXIT_FAILURE, 0, "%s",
> - 		     _("could not convert from UTF-8 to UCS-4"));
> + 	      if (rc == IDNA_SUCCESS)
> +-		printf ("len=%ld len2=%ld\n", len2, idna[i].inlen);
> ++		printf ("len=%d len2=%d\n", (int) len2, (int)
> idna[i].inlen);
> + 	      else
> +-		printf ("len=%ld len2=%ld\n", len, len2);
> ++		printf ("len=%d len2=%d\n", (int) len, (int) len2);
>   	    }
> +-	  fail ("IDNA entry %ld failed\n", i);
> ++	  fail ("IDNA entry %u failed\n", i);
> + 	  if (debug)
> + 	    printf ("ERROR\n");
> + 	}
> +diff --git a/tests/tst_idna2.c b/tests/tst_idna2.c
> +index 65b3a4d..38932ca 100644
> +--- a/tests/tst_idna2.c
> ++++ b/tests/tst_idna2.c
> +@@ -461,14 +461,14 @@ static const struct idna idna[] = {
> + void
> + doit (void)
> + {
> +-  size_t i;
> ++  unsigned i;
> +   char *out;
> +   int rc;
> + 
> +   for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++)
> +     {
> +       if (debug)
> +-	printf ("IDNA2 entry %ld\n", i);
> ++	printf ("IDNA2 entry %u\n", i);
> + 
> +       if (debug)
> + 	{
> +@@ -487,7 +487,7 @@ doit (void)
> + 			     IDNA_USE_STD3_ASCII_RULES);
> +       if (rc != IDNA_SUCCESS && strlen (idna[i].out) > 0)
> + 	{
> +-	  fail ("IDNA2 entry %ld failed: %d\n", i, rc);
> ++	  fail ("IDNA2 entry %u failed: %d\n", i, rc);
> + 	  continue;
> + 	}
>   
> -@@ -240,7 +240,7 @@ main (int argc, char *argv[])
> - 	  if (!q)
> +@@ -504,7 +504,7 @@ doit (void)
> + 	  if (strlen (idna[i].out) != strlen (out) ||
> + 	      strcasecmp (idna[i].out, out) != 0)
>   	    {
> - 	      free (r);
> --	      error (EXIT_FAILURE, 0,
> -+	      error (EXIT_FAILURE, 0, "%s",
> - 		     _("could not convert from UTF-8 to UCS-4"));
> +-	      fail ("IDNA2 entry %ld failed\n", i);
> ++	      fail ("IDNA2 entry %u failed\n", i);
> + 	      if (debug)
> + 		printf ("ERROR\n");
>   	    }
> +diff --git a/tests/tst_idna3.c b/tests/tst_idna3.c
> +index a189378..f65628c 100644
> +--- a/tests/tst_idna3.c
> ++++ b/tests/tst_idna3.c
> +@@ -59,13 +59,13 @@ doit (void)
> + {
> +   int rc;
> +   char *out = NULL;
> +-  size_t i;
> ++  unsigned i;
> + 
> +   for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++)
> +     {
> +       rc = idna_to_unicode_8z8z (idna[i].in, &out, 0);
> +       if (rc != IDNA_SUCCESS)
> +-	fail ("IDNA3[%ld] failed %d\n", i, rc);
> ++	fail ("IDNA3[%u] failed %d\n", i, rc);
>   
> -@@ -277,7 +277,7 @@ main (int argc, char *argv[])
> - 	  q = stringprep_utf8_to_ucs4 (p, -1, &len);
> - 	  free (p);
> - 	  if (!q)
> --	    error (EXIT_FAILURE, 0,
> -+	    error (EXIT_FAILURE, 0, "%s",
> - 		   _("could not convert from UTF-8 to UCS-4"));
> - 
> - 	  if (args_info.debug_given)
> -@@ -336,7 +336,7 @@ main (int argc, char *argv[])
> - 	  r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
> - 	  free (q);
> - 	  if (!r)
> --	    error (EXIT_FAILURE, 0,
> -+	    error (EXIT_FAILURE, 0, "%s",
> - 		   _("could not convert from UCS-4 to UTF-8"));
> - 
> - 	  p = stringprep_utf8_to_locale (r);
> -@@ -360,7 +360,7 @@ main (int argc, char *argv[])
> - 	  q = stringprep_utf8_to_ucs4 (p, -1, NULL);
> - 	  free (p);
> - 	  if (!q)
> --	    error (EXIT_FAILURE, 0,
> -+	    error (EXIT_FAILURE, 0, "%s",
> - 		   _("could not convert from UCS-4 to UTF-8"));
> - 
> - 	  if (args_info.debug_given)
> -@@ -438,7 +438,7 @@ main (int argc, char *argv[])
> - 	  if (!q)
> +       if (debug && rc == IDNA_SUCCESS)
> + 	{
> +@@ -75,9 +75,9 @@ doit (void)
> + 	}
> + 
> +       if (strcmp (out, idna[i].out) != 0)
> +-	fail ("IDNA3[%ld] failed\n", i);
> ++	fail ("IDNA3[%u] failed\n", i);
> +       else if (debug)
> +-	printf ("IDNA3[%ld] success\n", i);
> ++	printf ("IDNA3[%u] success\n", i);
> + 
> +       if (out)
> + 	idn_free (out);
> +diff --git a/tests/tst_nfkc.c b/tests/tst_nfkc.c
> +index d150fec..f5af9c6 100644
> +--- a/tests/tst_nfkc.c
> ++++ b/tests/tst_nfkc.c
> +@@ -68,18 +68,18 @@ void
> + doit (void)
> + {
> +   char *out;
> +-  size_t i;
> ++  unsigned i;
> + 
> +   for (i = 0; i < sizeof (nfkc) / sizeof (nfkc[0]); i++)
> +     {
> +       if (debug)
> +-	printf ("NFKC entry %ld\n", i);
> ++	printf ("NFKC entry %u\n", i);
> + 
> +       out = stringprep_utf8_nfkc_normalize (nfkc[i].in,
> + 					    (ssize_t) strlen
> (nfkc[i].in));
> +       if (out == NULL)
> + 	{
> +-	  fail ("NFKC entry %ld failed fatally\n", i);
> ++	  fail ("NFKC entry %u failed fatally\n", i);
> + 	  continue;
> + 	}
> + 
> +@@ -114,7 +114,7 @@ doit (void)
> +       if (strlen (nfkc[i].out) != strlen (out) ||
> + 	  memcmp (nfkc[i].out, out, strlen (out)) != 0)
> + 	{
> +-	  fail ("NFKC entry %ld failed\n", i);
> ++	  fail ("NFKC entry %u failed\n", i);
> + 	  if (debug)
> + 	    printf ("ERROR\n");
> + 	}
> +diff --git a/tests/tst_pr29.c b/tests/tst_pr29.c
> +index 3dc5466..11d0ede 100644
> +--- a/tests/tst_pr29.c
> ++++ b/tests/tst_pr29.c
> +@@ -91,7 +91,7 @@ static const struct tv tv[] = {
> + void
> + doit (void)
> + {
> +-  size_t i;
> ++  unsigned i;
> +   int rc;
> + 
> +   for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++)
> +@@ -100,7 +100,7 @@ doit (void)
> + 	{
> + 	  uint32_t *p, *q;
> + 
> +-	  printf ("PR29 entry %ld: %s\n", i, tv[i].name);
> ++	  printf ("PR29 entry %u: %s\n", i, tv[i].name);
> + 
> + 	  printf ("in:\n");
> + 	  ucs4print (tv[i].in, tv[i].inlen);
> +@@ -120,7 +120,7 @@ doit (void)
> +       rc = pr29_4 (tv[i].in, tv[i].inlen);
> +       if (rc != tv[i].rc)
> + 	{
> +-	  fail ("PR29 entry %ld failed (expected %d): %d\n", i,
> tv[i].rc, rc);
> ++	  fail ("PR29 entry %u failed (expected %d): %d\n", i, tv[i].rc,
> rc);
> + 	  if (debug)
> + 	    printf ("FATAL\n");
> + 	  continue;
> +@@ -129,7 +129,7 @@ doit (void)
> +       rc = pr29_4z (tv[i].in);
> +       if (rc != tv[i].rc)
> + 	{
> +-	  fail ("PR29 entry %ld failed (expected %d): %d\n", i,
> tv[i].rc, rc);
> ++	  fail ("PR29 entry %u failed (expected %d): %d\n", i, tv[i].rc,
> rc);
> + 	  if (debug)
> + 	    printf ("FATAL\n");
> + 	  continue;
> +@@ -142,7 +142,7 @@ doit (void)
> + 	p = stringprep_ucs4_to_utf8 (tv[i].in, (ssize_t) tv[i].inlen,
> + 				     &items_read, &items_written);
> + 	if (p == NULL)
> +-	  fail ("FAIL: stringprep_ucs4_to_utf8(tv[%ld]) == NULL\n", i);
> ++	  fail ("FAIL: stringprep_ucs4_to_utf8(tv[%u]) == NULL\n", i);
> + 	if (debug)
> + 	  hexprint (p, strlen (p));
> + 
> +@@ -150,7 +150,7 @@ doit (void)
> + 	free (p);
> + 	if (rc != tv[i].rc)
> + 	  {
> +-	    fail ("PR29 entry %ld failed (expected %d): %d\n",
> ++	    fail ("PR29 entry %u failed (expected %d): %d\n",
> + 		  i, tv[i].rc, rc);
> + 	    if (debug)
> + 	      printf ("FATAL\n");
> +diff --git a/tests/tst_punycode.c b/tests/tst_punycode.c
> +index 493b8a2..997744a 100644
> +--- a/tests/tst_punycode.c
> ++++ b/tests/tst_punycode.c
> +@@ -173,7 +173,8 @@ doit (void)
> +   char *p;
> +   uint32_t *q;
> +   int rc;
> +-  size_t i, outlen;
> ++  size_t outlen;
> ++  unsigned i;
> + 
> +   p = malloc (sizeof (*p) * BUFSIZ);
> +   if (p == NULL)
> +@@ -186,7 +187,7 @@ doit (void)
> +   for (i = 0; i < sizeof (punycode) / sizeof (punycode[0]); i++)
> +     {
> +       if (debug)
> +-	printf ("PUNYCODE entry %ld: %s\n", i, punycode[i].name);
> ++	printf ("PUNYCODE entry %u: %s\n", i, punycode[i].name);
> + 
> +       if (debug)
> + 	{
> +@@ -199,7 +200,7 @@ doit (void)
> + 			    NULL, &outlen, p);
> +       if (rc != punycode[i].rc)
> + 	{
> +-	  fail ("punycode_encode() entry %ld failed: %d\n", i, rc);
> ++	  fail ("punycode_encode() entry %u failed: %d\n", i, rc);
> + 	  if (debug)
> + 	    printf ("FATAL\n");
> + 	  continue;
> +@@ -221,7 +222,7 @@ doit (void)
> + 	  if (strlen (punycode[i].out) != strlen (p) ||
> + 	      memcmp (punycode[i].out, p, strlen (p)) != 0)
> + 	    {
> +-	      fail ("punycode() entry %ld failed\n", i);
> ++	      fail ("punycode() entry %u failed\n", i);
> + 	      if (debug)
> + 		printf ("ERROR\n");
> + 	    }
> +@@ -241,7 +242,7 @@ doit (void)
> + 			    &outlen, q, NULL);
> +       if (rc != punycode[i].rc)
> + 	{
> +-	  fail ("punycode() entry %ld failed: %d\n", i, rc);
> ++	  fail ("punycode() entry %u failed: %d\n", i, rc);
> + 	  if (debug)
> + 	    printf ("FATAL\n");
> + 	  continue;
> +@@ -262,7 +263,7 @@ doit (void)
> + 	  if (punycode[i].inlen != outlen ||
> + 	      memcmp (punycode[i].in, q, outlen) != 0)
>   	    {
> - 	      free (p);
> --	      error (EXIT_FAILURE, 0,
> -+	      error (EXIT_FAILURE, 0, "%s",
> - 		     _("could not convert from UCS-4 to UTF-8"));
> +-	      fail ("punycode_decode() entry %ld failed\n", i);
> ++	      fail ("punycode_decode() entry %u failed\n", i);
> + 	      if (debug)
> + 		printf ("ERROR\n");
>   	    }
> +diff --git a/tests/tst_strerror.c b/tests/tst_strerror.c
> +index 71fff59..730f5e4 100644
> +--- a/tests/tst_strerror.c
> ++++ b/tests/tst_strerror.c
> +@@ -110,7 +110,7 @@ doit (void)
> +   /* Iterate through all error codes. */
> + 
> +   {
> +-    size_t i;
> ++    unsigned i;
> +     const char *last_p = NULL;
> + 
> +     for (i = 0;; i++)
> +@@ -126,13 +126,13 @@ doit (void)
> + 	    break;
> + 	  }
> + 	if (debug)
> +-	  printf ("idna %ld: %s\n", i, p);
> ++	  printf ("idna %u: %s\n", i, p);
> + 	last_p = p;
> +       }
> +   }
> + 
> +   {
> +-    size_t i;
> ++    unsigned i;
> +     const char *last_p = NULL;
> + 
> +     for (i = 0;; i++)
> +@@ -141,13 +141,13 @@ doit (void)
> + 	if (p == last_p)
> + 	  break;
> + 	if (debug)
> +-	  printf ("pr29 %ld: %s\n", i, p);
> ++	  printf ("pr29 %u: %s\n", i, p);
> + 	last_p = p;
> +       }
> +   }
> + 
> +   {
> +-    size_t i;
> ++    unsigned i;
> +     const char *last_p = NULL;
> + 
> +     for (i = 0;; i++)
> +@@ -156,13 +156,13 @@ doit (void)
> + 	if (p == last_p)
> + 	  break;
> + 	if (debug)
> +-	  printf ("punycode %ld: %s\n", i, p);
> ++	  printf ("punycode %u: %s\n", i, p);
> + 	last_p = p;
> +       }
> +   }
>   
> -@@ -494,7 +494,7 @@ main (int argc, char *argv[])
> - 	  r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
> - 	  free (q);
> - 	  if (!r)
> --	    error (EXIT_FAILURE, 0,
> -+	    error (EXIT_FAILURE, 0, "%s",
> - 		   _("could not convert from UTF-8 to UCS-4"));
> - 
> - 	  p = stringprep_utf8_to_locale (r);
> -@@ -523,7 +523,7 @@ main (int argc, char *argv[])
> - 	      if (!q)
> - 		{
> - 		  free (p);
> --		  error (EXIT_FAILURE, 0,
> -+		  error (EXIT_FAILURE, 0, "%s",
> - 			 _("could not convert from UTF-8 to UCS-4"));
> - 		}
> - 
> -@@ -537,7 +537,8 @@ main (int argc, char *argv[])
> - 	  r = stringprep_utf8_nfkc_normalize (p, -1);
> - 	  free (p);
> - 	  if (!r)
> --	    error (EXIT_FAILURE, 0, _("could not do NFKC
> normalization"));
> -+	    error (EXIT_FAILURE, 0, "%s",
> -+		   _("could not do NFKC normalization"));
> - 
> - 	  if (args_info.debug_given)
> +   {
> +-    size_t i;
> ++    unsigned i;
> +     const char *last_p = NULL;
> + 
> +     for (i = 0;; i++)
> +@@ -183,13 +183,13 @@ doit (void)
> + 	    break;
> + 	  }
> + 	if (debug)
> +-	  printf ("stringprep %ld: %s\n", i, p);
> ++	  printf ("stringprep %u: %s\n", i, p);
> + 	last_p = p;
> +       }
> +   }
> + 
> +   {
> +-    size_t i;
> ++    unsigned i;
> +     const char *last_p = NULL;
> + 
> +     for (i = 0;; i++)
> +@@ -198,7 +198,7 @@ doit (void)
> + 	if (p == last_p)
> + 	  break;
> + 	if (debug)
> +-	  printf ("tld %ld: %s\n", i, p);
> ++	  printf ("tld %u: %s\n", i, p);
> + 	last_p = p;
> +       }
> +   }
> +diff --git a/tests/tst_stringprep.c b/tests/tst_stringprep.c
> +index 149ce6f..7c9ab06 100644
> +--- a/tests/tst_stringprep.c
> ++++ b/tests/tst_stringprep.c
> +@@ -205,7 +205,7 @@ doit (void)
> + {
> +   char *p;
> +   int rc;
> +-  size_t i;
> ++  unsigned i;
> + 
> +   if (!stringprep_check_version (STRINGPREP_VERSION))
> +     fail ("stringprep_check_version failed (header %s runtime %s)\n",
> +@@ -224,7 +224,7 @@ doit (void)
> +   for (i = 0; i < sizeof (strprep) / sizeof (strprep[0]); i++)
> +     {
> +       if (debug)
> +-	printf ("STRINGPREP entry %ld\n", i);
> ++	printf ("STRINGPREP entry %u\n", i);
> + 
> +       if (debug)
> + 	{
> +@@ -247,12 +247,12 @@ doit (void)
> + 	  continue;
> + 	else if (l == NULL)
> + 	  {
> +-	    fail ("bad UTF-8 in entry %ld\n", i);
> ++	    fail ("bad UTF-8 in entry %u\n", i);
> + 	    continue;
> + 	  }
> + 	else if (strcmp (strprep[i].in, x) != 0)
> + 	  {
> +-	    fail ("bad UTF-8 in entry %ld\n", i);
> ++	    fail ("bad UTF-8 in entry %u\n", i);
> + 	    if (debug)
> + 	      {
> + 		puts ("expected:");
> +@@ -274,7 +274,7 @@ doit (void)
> + 			       "Nameprep", strprep[i].flags);
> +       if (rc != strprep[i].rc)
> + 	{
> +-	  fail ("stringprep() entry %ld failed: %d\n", i, rc);
> ++	  fail ("stringprep() entry %u failed: %d\n", i, rc);
> + 	  if (debug)
> + 	    printf ("FATAL\n");
> + 	  if (rc == STRINGPREP_OK)
> +@@ -302,7 +302,7 @@ doit (void)
> + 	  if (strlen (strprep[i].out) != strlen (p) ||
> + 	      memcmp (strprep[i].out, p, strlen (p)) != 0)
>   	    {
> -@@ -547,7 +548,7 @@ main (int argc, char *argv[])
> - 	      if (!q)
> - 		{
> - 		  free (r);
> --		  error (EXIT_FAILURE, 0,
> -+		  error (EXIT_FAILURE, 0, "%s",
> - 			 _("could not convert from UTF-8 to UCS-4"));
> - 		}
> +-	      fail ("stringprep() entry %ld failed\n", i);
> ++	      fail ("stringprep() entry %ld failed\n", (long) i);
> + 	      if (debug)
> + 		printf ("ERROR\n");
> + 	    }
> +diff --git a/tests/tst_tld.c b/tests/tst_tld.c
> +index 2f8e12e..d038c79 100644
> +--- a/tests/tst_tld.c
> ++++ b/tests/tst_tld.c
> +@@ -80,7 +80,7 @@ const Tld_table * my_tld_tables[] =
> + void
> + doit (void)
> + {
> +-  size_t i;
> ++  unsigned i;
> +   const Tld_table *tldtable;
> +   char *out;
> +   size_t errpos;
> +@@ -206,7 +206,7 @@ doit (void)
> +   for (i = 0; i < sizeof (tld) / sizeof (tld[0]); i++)
> +     {
> +       if (debug)
> +-	printf ("TLD entry %ld: %s\n", i, tld[i].name);
> ++	printf ("TLD entry %u: %s\n", i, tld[i].name);
> + 
> +       if (debug)
> + 	{
> +@@ -217,7 +217,7 @@ doit (void)
> +       tldtable = tld_default_table (tld[i].tld, NULL);
> +       if (tldtable == NULL)
> + 	{
> +-	  fail ("TLD entry %ld tld_get_table (%s)\n", i, tld[i].tld);
> ++	  fail ("TLD entry %u tld_get_table (%s)\n", i, tld[i].tld);
> + 	  if (debug)
> + 	    printf ("FATAL\n");
> + 	  continue;
> +@@ -226,7 +226,7 @@ doit (void)
> +       rc = tld_check_4t (tld[i].in, tld[i].inlen, &errpos, tldtable);
> +       if (rc != tld[i].rc)
> + 	{
> +-	  fail ("TLD entry %ld failed: %d\n", i, rc);
> ++	  fail ("TLD entry %u failed: %d\n", i, rc);
> + 	  if (debug)
> + 	    printf ("FATAL\n");
> + 	  continue;
> +@@ -237,7 +237,7 @@ doit (void)
>   
> +       if (rc != tld[i].rc)
> + 	{
> +-	  fail ("TLD entry %ld failed\n", i);
> ++	  fail ("TLD entry %u failed\n", i);
> + 	  if (debug)
> + 	    printf ("ERROR\n");
> + 	}
> +@@ -245,12 +245,12 @@ doit (void)
> + 	{
> + 	  if (debug)
> + 	    printf ("returned errpos %ld expected errpos %ld\n",
> +-		    errpos, tld[i].errpos);
> ++		    (long) errpos, (long) tld[i].errpos);
> + 
> + 	  if (tld[i].errpos != errpos)
> + 	    {
> +-	      fail ("TLD entry %ld failed because errpos %ld != %ld\n",
> i,
> +-		    tld[i].errpos, errpos);
> ++	      fail ("TLD entry %u failed because errpos %ld != %ld\n",
> i,
> ++		    (long) tld[i].errpos, (long) errpos);
> + 	      if (debug)
> + 		printf ("ERROR\n");
> + 	    }
> +@@ -262,12 +262,12 @@ doit (void)
> + 	rc = tld_check_8z (tld[i].example, &errpos, NULL);
> + 	if (rc != tld[i].rc)
> + 	  {
> +-	    fail ("TLD entry %ld failed\n", i);
> ++	    fail ("TLD entry %u failed\n", i);
> + 	    if (debug)
> + 	      printf ("ERROR\n");
> + 	  }
> + 	if (debug)
> +-	  printf ("TLD entry %ld tld_check_8z (%s)\n", i,
> tld[i].example);
> ++	  printf ("TLD entry %u tld_check_8z (%s)\n", i,
> tld[i].example);
> +       }
> +     }
> + }
> +diff --git a/tests/utils.c b/tests/utils.c
> +index 717ee01..5577dc3 100644
> +--- a/tests/utils.c
> ++++ b/tests/utils.c
> +@@ -49,7 +49,7 @@ escapeprint (const char *str, size_t len)
> + {
> +   size_t i;
> + 
> +-  printf (" (length %ld bytes):\n\t", len);
> ++  printf (" (length %ld bytes):\n\t", (long) len);
> +   for (i = 0; i < len; i++)
> +     {
> +       if (((str[i] & 0xFF) >= 'A' && (str[i] & 0xFF) <= 'Z') ||
> +@@ -58,7 +58,7 @@ escapeprint (const char *str, size_t len)
> + 	  || (str[i] & 0xFF) == ' ' || (str[i] & 0xFF) == '.')
> + 	printf ("%c", (str[i] & 0xFF));
> +       else
> +-	printf ("\\x%02X", (str[i] & 0xFF));
> ++	printf ("\\x%02X", (unsigned) (str[i] & 0xFF));
> +       if ((i + 1) % 16 == 0 && (i + 1) < len)
> + 	printf ("'\n\t'");
> +     }
> +@@ -73,7 +73,7 @@ hexprint (const char *str, size_t len)
> +   printf ("\t;; ");
> +   for (i = 0; i < len; i++)
> +     {
> +-      printf ("%02x ", (str[i] & 0xFF));
> ++      printf ("%02x ", (unsigned) (str[i] & 0xFF));
> +       if ((i + 1) % 8 == 0)
> + 	printf (" ");
> +       if ((i + 1) % 16 == 0 && i + 1 < len)
>  -- 
> -2.8.1
> +1.9.1
>  
> diff --git a/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch
> b/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch
> new file mode 100644
> index 00000000000..546a6eaafcf
> --- /dev/null
> +++ b/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch
> @@ -0,0 +1,334 @@
> +From 230930b3bc3e431b819eb45420cb42475d83ca93 Mon Sep 17 00:00:00 2001
> +From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
> +Date: Wed, 1 Feb 2017 10:44:36 +0100
> +Subject: [PATCH] Update intprops.h for gcc-7 compatibility
> +
> +---
> +Upstream-Status: Backport
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +
> + gl/intprops.h          | 65 ++++++++++++++++++++++++++++++------------
> --------
> + lib/gltests/intprops.h | 65 ++++++++++++++++++++++++++++++------------
> --------
> + 2 files changed, 78 insertions(+), 52 deletions(-)
> +
> +diff --git a/gl/intprops.h b/gl/intprops.h
> +index e1fce5c..eb06b69 100644
> +--- a/gl/intprops.h
> ++++ b/gl/intprops.h
> +@@ -1,18 +1,18 @@
> + /* intprops.h -- properties of integer types
> + 
> +-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
> ++   Copyright (C) 2001-2017 Free Software Foundation, Inc.
> + 
> +    This program is free software: you can redistribute it and/or modify
> it
> +-   under the terms of the GNU General Public License as published
> +-   by the Free Software Foundation; either version 3 of the License, or
> ++   under the terms of the GNU Lesser General Public License as published
> ++   by the Free Software Foundation; either version 2.1 of the License,
> or
> +    (at your option) any later version.
> + 
> +    This program is distributed in the hope that it will be useful,
> +    but WITHOUT ANY WARRANTY; without even the implied warranty of
> +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +-   GNU General Public License for more details.
> ++   GNU Lesser General Public License for more details.
> + 
> +-   You should have received a copy of the GNU General Public License
> ++   You should have received a copy of the GNU Lesser General Public
> License
> +    along with this program.  If not, see <http://www.gnu.org/licenses/>.
>   */
> + 
> + /* Written by Paul Eggert.  */
> +@@ -47,12 +47,16 @@
> + 
> + /* Minimum and maximum values for integer types and expressions.  */
> + 
> ++/* The width in bits of the integer type or expression T.
> ++   Padding bits are not supported; this is checked at compile-time
> below.  */
> ++#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
> ++
> + /* The maximum and minimum values for the integer type T.  */
> + #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
> + #define
> TYPE_MAXIMUM(t)                                                 \
> +   ((t) (! TYPE_SIGNED
> (t)                                               \
> +         ? (t)
> -1                                                        \
> +-        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
> ++        : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
> + 
> + /* The maximum and minimum values for the type of the expression E,
> +    after integer promotion.  E should not have side effects.  */
> +@@ -65,7 +69,13 @@
> +    ? _GL_SIGNED_INT_MAXIMUM
> (e)                                         \
> +    : _GL_INT_NEGATE_CONVERT (e, 1))
> + #define
> _GL_SIGNED_INT_MAXIMUM(e)                                       \
> +-  (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) *
> 2 + 1)
> ++  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
> ++
> ++/* Work around OpenVMS incompatibility with C99.  */
> ++#if !defined LLONG_MAX && defined __INT64_MAX
> ++# define LLONG_MAX __INT64_MAX
> ++# define LLONG_MIN __INT64_MIN
> ++#endif
> + 
> + /* This include file assumes that signed types are two's complement
> without
> +    padding bits; the above macros have undefined behavior otherwise.
> +@@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX);
> + verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
> + verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> + #endif
> ++/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if
> defined.  */
> ++#ifdef UINT_WIDTH
> ++verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
> ++#endif
> + 
> + /* Does the __typeof__ keyword work?  This could be done by
> +    'configure', but for now it's easier to do it by hand.  */
> +-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
> ++#if (2 <= __GNUC__ \
> ++     || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
> +      || (0x5110 <= __SUNPRO_C && !__STDC__))
> + # define _GL_HAVE___TYPEOF__ 1
> + #else
> +@@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> +    signed, this macro may overestimate the true bound by one byte when
> +    applied to unsigned types of size 2, 4, 16, ... bytes.  */
> + #define INT_STRLEN_BOUND(t)                                     \
> +-  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT                 \
> +-                          - _GL_SIGNED_TYPE_OR_EXPR (t))        \
> ++  (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t))
> \
> +    + _GL_SIGNED_TYPE_OR_EXPR (t))
> + 
> + /* Bound on buffer size needed to represent an integer type or
> expression T,
> +@@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> +    ? (a) < (min) >> (b)                                 \
> +    : (max) >> (b) < (a))
> + 
> +-/* True if __builtin_add_overflow (A, B, P) works when P is null.  */
> +-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
> ++/* True if __builtin_add_overflow (A, B, P) works when P is non-
> null.  */
> ++#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__)
> ++
> ++/* True if __builtin_add_overflow_p (A, B, C) works.  */
> ++#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
> + 
> + /* The _GL*_OVERFLOW macros have the same restrictions as the
> +    *_RANGE_OVERFLOW macros, except that they do not assume that operands
> +    (e.g., A and B) have the same type as MIN and MAX.  Instead, they
> assume
> +    that the result (e.g., A + B) has that type.  */
> +-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
> +-# define _GL_ADD_OVERFLOW(a, b, min, max)
> +-   __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
> +-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
> +-   __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
> +-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
> +-   __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
> ++#if _GL_HAS_BUILTIN_OVERFLOW_P
> ++# define _GL_ADD_OVERFLOW(a, b, min,
> max)                               \
> ++   __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
> ++# define _GL_SUBTRACT_OVERFLOW(a, b, min,
> max)                          \
> ++   __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
> ++# define _GL_MULTIPLY_OVERFLOW(a, b, min,
> max)                          \
> ++   __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
> + #else
> + # define _GL_ADD_OVERFLOW(a, b, min,
> max)                                \
> +    ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min,
> max)                  \
> +@@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> +   _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
> + #define INT_SUBTRACT_OVERFLOW(a, b) \
> +   _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
> +-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
> ++#if _GL_HAS_BUILTIN_OVERFLOW_P
> + # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
> + #else
> + # define INT_NEGATE_OVERFLOW(a) \
> +@@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> + #define INT_MULTIPLY_WRAPV(a, b, r) \
> +   _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow,
> INT_MULTIPLY_OVERFLOW)
> + 
> +-#ifndef __has_builtin
> +-# define __has_builtin(x) 0
> +-#endif
> +-
> + /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390.  See:
> +    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
> +    https://llvm.org/bugs/show_bug.cgi?id=25390
> +@@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> +    the operation.  BUILTIN is the builtin operation, and OVERFLOW the
> +    overflow predicate.  Return 1 if the result overflows.  See above
> +    for restrictions.  */
> +-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
> ++#if _GL_HAS_BUILTIN_OVERFLOW
> + # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b,
> r)
> + #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
> + # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
> +@@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> + # else
> + #  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
> +     _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
> +-                     long int, LONG_MIN, LONG_MAX))
> ++                     long int, LONG_MIN, LONG_MAX)
> + # endif
> + #endif
> + 
> +diff --git a/lib/gltests/intprops.h b/lib/gltests/intprops.h
> +index e1fce5c..eb06b69 100644
> +--- a/lib/gltests/intprops.h
> ++++ b/lib/gltests/intprops.h
> +@@ -1,18 +1,18 @@
> + /* intprops.h -- properties of integer types
> + 
> +-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
> ++   Copyright (C) 2001-2017 Free Software Foundation, Inc.
> + 
> +    This program is free software: you can redistribute it and/or modify
> it
> +-   under the terms of the GNU General Public License as published
> +-   by the Free Software Foundation; either version 3 of the License, or
> ++   under the terms of the GNU Lesser General Public License as published
> ++   by the Free Software Foundation; either version 2.1 of the License,
> or
> +    (at your option) any later version.
> + 
> +    This program is distributed in the hope that it will be useful,
> +    but WITHOUT ANY WARRANTY; without even the implied warranty of
> +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +-   GNU General Public License for more details.
> ++   GNU Lesser General Public License for more details.
> + 
> +-   You should have received a copy of the GNU General Public License
> ++   You should have received a copy of the GNU Lesser General Public
> License
> +    along with this program.  If not, see <http://www.gnu.org/licenses/>.
>   */
> + 
> + /* Written by Paul Eggert.  */
> +@@ -47,12 +47,16 @@
> + 
> + /* Minimum and maximum values for integer types and expressions.  */
> + 
> ++/* The width in bits of the integer type or expression T.
> ++   Padding bits are not supported; this is checked at compile-time
> below.  */
> ++#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
> ++
> + /* The maximum and minimum values for the integer type T.  */
> + #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
> + #define
> TYPE_MAXIMUM(t)                                                 \
> +   ((t) (! TYPE_SIGNED
> (t)                                               \
> +         ? (t)
> -1                                                        \
> +-        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
> ++        : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
> + 
> + /* The maximum and minimum values for the type of the expression E,
> +    after integer promotion.  E should not have side effects.  */
> +@@ -65,7 +69,13 @@
> +    ? _GL_SIGNED_INT_MAXIMUM
> (e)                                         \
> +    : _GL_INT_NEGATE_CONVERT (e, 1))
> + #define
> _GL_SIGNED_INT_MAXIMUM(e)                                       \
> +-  (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) *
> 2 + 1)
> ++  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
> ++
> ++/* Work around OpenVMS incompatibility with C99.  */
> ++#if !defined LLONG_MAX && defined __INT64_MAX
> ++# define LLONG_MAX __INT64_MAX
> ++# define LLONG_MIN __INT64_MIN
> ++#endif
> + 
> + /* This include file assumes that signed types are two's complement
> without
> +    padding bits; the above macros have undefined behavior otherwise.
> +@@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX);
> + verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
> + verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> + #endif
> ++/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if
> defined.  */
> ++#ifdef UINT_WIDTH
> ++verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
> ++#endif
> + 
> + /* Does the __typeof__ keyword work?  This could be done by
> +    'configure', but for now it's easier to do it by hand.  */
> +-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
> ++#if (2 <= __GNUC__ \
> ++     || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
> +      || (0x5110 <= __SUNPRO_C && !__STDC__))
> + # define _GL_HAVE___TYPEOF__ 1
> + #else
> +@@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> +    signed, this macro may overestimate the true bound by one byte when
> +    applied to unsigned types of size 2, 4, 16, ... bytes.  */
> + #define INT_STRLEN_BOUND(t)                                     \
> +-  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT                 \
> +-                          - _GL_SIGNED_TYPE_OR_EXPR (t))        \
> ++  (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t))
> \
> +    + _GL_SIGNED_TYPE_OR_EXPR (t))
> + 
> + /* Bound on buffer size needed to represent an integer type or
> expression T,
> +@@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> +    ? (a) < (min) >> (b)                                 \
> +    : (max) >> (b) < (a))
> + 
> +-/* True if __builtin_add_overflow (A, B, P) works when P is null.  */
> +-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
> ++/* True if __builtin_add_overflow (A, B, P) works when P is non-
> null.  */
> ++#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__)
> ++
> ++/* True if __builtin_add_overflow_p (A, B, C) works.  */
> ++#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
> + 
> + /* The _GL*_OVERFLOW macros have the same restrictions as the
> +    *_RANGE_OVERFLOW macros, except that they do not assume that operands
> +    (e.g., A and B) have the same type as MIN and MAX.  Instead, they
> assume
> +    that the result (e.g., A + B) has that type.  */
> +-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
> +-# define _GL_ADD_OVERFLOW(a, b, min, max)
> +-   __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
> +-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
> +-   __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
> +-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
> +-   __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
> ++#if _GL_HAS_BUILTIN_OVERFLOW_P
> ++# define _GL_ADD_OVERFLOW(a, b, min,
> max)                               \
> ++   __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
> ++# define _GL_SUBTRACT_OVERFLOW(a, b, min,
> max)                          \
> ++   __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
> ++# define _GL_MULTIPLY_OVERFLOW(a, b, min,
> max)                          \
> ++   __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
> + #else
> + # define _GL_ADD_OVERFLOW(a, b, min,
> max)                                \
> +    ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min,
> max)                  \
> +@@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> +   _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
> + #define INT_SUBTRACT_OVERFLOW(a, b) \
> +   _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
> +-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
> ++#if _GL_HAS_BUILTIN_OVERFLOW_P
> + # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
> + #else
> + # define INT_NEGATE_OVERFLOW(a) \
> +@@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> + #define INT_MULTIPLY_WRAPV(a, b, r) \
> +   _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow,
> INT_MULTIPLY_OVERFLOW)
> + 
> +-#ifndef __has_builtin
> +-# define __has_builtin(x) 0
> +-#endif
> +-
> + /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390.  See:
> +    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
> +    https://llvm.org/bugs/show_bug.cgi?id=25390
> +@@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> +    the operation.  BUILTIN is the builtin operation, and OVERFLOW the
> +    overflow predicate.  Return 1 if the result overflows.  See above
> +    for restrictions.  */
> +-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
> ++#if _GL_HAS_BUILTIN_OVERFLOW
> + # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b,
> r)
> + #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
> + # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
> +@@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
> + # else
> + #  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
> +     _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
> +-                     long int, LONG_MIN, LONG_MAX))
> ++                     long int, LONG_MIN, LONG_MAX)
> + # endif
> + #endif
> + 
> +-- 
> +1.9.1
> +
> diff --git a/meta/recipes-extended/libidn/libidn_1.33.bb b/meta/recipes-
> extended/libidn/libidn_1.33.bb
> index d3d0f557bba..109cc7f3f55 100644
> --- a/meta/recipes-extended/libidn/libidn_1.33.bb
> +++ b/meta/recipes-extended/libidn/libidn_1.33.bb
> @@ -19,6 +19,7 @@ SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \
>             file://avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.
> patch \
>             file://dont-depend-on-help2man.patch \
>             file://0001-idn-fix-printf-format-security-warnings.patch \
> +           file://gcc7-compatibility.patch \
>  "
>  
>  SRC_URI[md5sum] = "a9aa7e003665de9c82bd3f9fc6ccf308"
> -- 
> 2.12.2
> 


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

* Re: [PATCH 2/5] libtirpc: Expose key_secretkey_is_set API
  2017-04-19  8:52   ` Burton, Ross
@ 2017-04-19 16:25     ` Khem Raj
  2017-04-19 16:36       ` Burton, Ross
  0 siblings, 1 reply; 15+ messages in thread
From: Khem Raj @ 2017-04-19 16:25 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Wed, Apr 19, 2017 at 1:52 AM, Burton, Ross <ross.burton@intel.com> wrote:
>
> On 19 April 2017 at 02:58, Khem Raj <raj.khem@gmail.com> wrote:
>>
>> +-    key_secret_is_set;
>> ++    key_secretkey_is_set;
>
>
> This removes key_secret_is_set, was this a typo upstream or a mistake in the
> patch?

key_secret_is_set is a typo in libtirpc map file which is fixed here.

>
> Ross


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

* Re: [PATCH 3/5] libtirpc: Enable des APIs for musl
  2017-04-19  8:57   ` André Draszik
  2017-04-19 12:53     ` Burton, Ross
@ 2017-04-19 16:34     ` Khem Raj
  1 sibling, 0 replies; 15+ messages in thread
From: Khem Raj @ 2017-04-19 16:34 UTC (permalink / raw)
  To: André Draszik; +Cc: Patches and discussions about the oe-core layer

On Wed, Apr 19, 2017 at 1:57 AM, André Draszik <git@andred.net> wrote:
> On Tue, 2017-04-18 at 18:58 -0700, Khem Raj wrote:
>> Use memset() API instead of __bzero()
>> Drop the patch removing des_* functions for musl
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>  .../0001-replace-__bzero-with-memset-API.patch     |  28 +++++
>>  .../libtirpc/remove-des-functionality.patch        | 139 ----------------
>> -----
>>  meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb   |   5 +-
>>  3 files changed, 31 insertions(+), 141 deletions(-)
>>  create mode 100644 meta/recipes-extended/libtirpc/libtirpc/0001-replace-
>> __bzero-with-memset-API.patch
>>  delete mode 100644 meta/recipes-extended/libtirpc/libtirpc/remove-des-
>> functionality.patch
>>
>> [...]
>>
>>
>>  SRC_URI_append_libc-uclibc = " file://remove-des-functionality.patch \
>
> This patch is being removed with this change, and so uclibc builds will
> fail.

yes I know. one should move it to bbappend in own layer if using uclibc.

 Is it time to remove all remaining references to uclibc?

Probably.

>
> Cheers,
> Andre'
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH 2/5] libtirpc: Expose key_secretkey_is_set API
  2017-04-19 16:25     ` Khem Raj
@ 2017-04-19 16:36       ` Burton, Ross
  2017-04-19 16:37         ` Khem Raj
  0 siblings, 1 reply; 15+ messages in thread
From: Burton, Ross @ 2017-04-19 16:36 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

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

On 19 April 2017 at 17:25, Khem Raj <raj.khem@gmail.com> wrote:

> key_secret_is_set is a typo in libtirpc map file which is fixed here.
>

Can you resubmit with that in the commit log.  Are you pushing these
upstream?

Ross

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

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

* Re: [PATCH 5/5] libidn: Fix build with gcc7
  2017-04-19 15:06   ` André Draszik
@ 2017-04-19 16:36     ` Khem Raj
  0 siblings, 0 replies; 15+ messages in thread
From: Khem Raj @ 2017-04-19 16:36 UTC (permalink / raw)
  To: André Draszik; +Cc: Patches and discussions about the oe-core layer

On Wed, Apr 19, 2017 at 8:06 AM, André Draszik <git@andred.net> wrote:
> On Tue, 2017-04-18 at 18:58 -0700, Khem Raj wrote:
>> Replace a local patch for format warning with the one
>> that got committed upstream
>
> This commit message is confusing, as the two patches are unrelated and they
> are addressing different issues.
>
> You are:
> - removing a patch that fixed Wformat-security warnings / errors
>   (not upstreamed)
> - adding a patch that fixes other (unrelated) Wformat warnings
>   (from upstream)
>


The backport obviously is a different patch and works fine with
security flags turned on. Can you point
whats missing from outgoing patch that we need ?

>
> Cheers,
> Andre'
>
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>  ...1-idn-fix-printf-format-security-warnings.patch | 825
>> +++++++++++++++++----
>>  .../libidn/libidn/gcc7-compatibility.patch         | 334 +++++++++
>>  meta/recipes-extended/libidn/libidn_1.33.bb        |   1 +
>>  3 files changed, 1004 insertions(+), 156 deletions(-)
>>  create mode 100644 meta/recipes-extended/libidn/libidn/gcc7-
>> compatibility.patch
>>
>> diff --git a/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-
>> format-security-warnings.patch b/meta/recipes-extended/libidn/libidn/0001-
>> idn-fix-printf-format-security-warnings.patch
>> index 5adc7d9fd98..2d5faabb240 100644
>> --- a/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-
>> security-warnings.patch
>> +++ b/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-
>> security-warnings.patch
>> @@ -1,181 +1,694 @@
>> -From 82f98dcbc429bbe89a9837c533cbcbc02e77c790 Mon Sep 17 00:00:00 2001
>> -From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
>> -Date: Tue, 28 Jun 2016 12:43:31 +0100
>> -Subject: [PATCH] idn: fix printf() format security warnings
>> -MIME-Version: 1.0
>> -Content-Type: text/plain; charset=UTF-8
>> -Content-Transfer-Encoding: 8bit
>> +From 7148adf34dae30345c2e4d9d437838a45ba6f6e8 Mon Sep 17 00:00:00 2001
>> +From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
>> +Date: Wed, 1 Feb 2017 11:06:39 +0100
>> +Subject: [PATCH] Fix -Wformat warnings
>>
>> -| ../../libidn-1.32/src/idn.c: In function 'main':
>> -| ../../libidn-1.32/src/idn.c:172:7: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|        error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be
>> specified"));
>> -|        ^~~~~
>> -| ../../libidn-1.32/src/idn.c:187:5: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|      fprintf (stderr, _("Type each input string on a line by itself, "
>> -|      ^~~~~~~
>> -| ../../libidn-1.32/src/idn.c:202:4: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|     error (EXIT_FAILURE, errno, _("input error"));
>> -|     ^~~~~
>> -| ../../libidn-1.32/src/idn.c:220:8: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|         _("could not convert from UTF-8 to UCS-4"));
>> -|         ^
>> -| ../../libidn-1.32/src/idn.c:245:8: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|         _("could not convert from UTF-8 to UCS-4"));
>> -|         ^
>> -| ../../libidn-1.32/src/idn.c:281:6: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|       _("could not convert from UTF-8 to UCS-4"));
>> -|       ^
>> -| ../../libidn-1.32/src/idn.c:340:6: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|       _("could not convert from UCS-4 to UTF-8"));
>> -|       ^
>> -| ../../libidn-1.32/src/idn.c:364:6: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|       _("could not convert from UCS-4 to UTF-8"));
>> -|       ^
>> -| ../../libidn-1.32/src/idn.c:442:8: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|         _("could not convert from UCS-4 to UTF-8"));
>> -|         ^
>> -| ../../libidn-1.32/src/idn.c:498:6: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|       _("could not convert from UTF-8 to UCS-4"));
>> -|       ^
>> -| ../../libidn-1.32/src/idn.c:527:5: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|      _("could not convert from UTF-8 to UCS-4"));
>> -|      ^
>> -| ../../libidn-1.32/src/idn.c:540:6: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|       error (EXIT_FAILURE, 0, _("could not do NFKC normalization"));
>> -|       ^~~~~
>> -| ../../libidn-1.32/src/idn.c:551:5: error: format not a string literal
>> and no format arguments [-Werror=format-security]
>> -|      _("could not convert from UTF-8 to UCS-4"));
>> -|      ^
>> -
>> -Signed-off-by: André Draszik <adraszik@tycoint.com>
>>  ---
>> -Upstream-Status: Pending
>> +Upstream-Status: Backport
>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>
>> - src/idn.c | 27 ++++++++++++++-------------
>> - 1 file changed, 14 insertions(+), 13 deletions(-)
>> + examples/example.c     |  6 +++---
>> + examples/example3.c    |  4 ++--
>> + examples/example4.c    |  4 ++--
>> + examples/example5.c    |  2 +-
>> + src/idn.c              |  2 +-
>> + tests/tst_idna.c       | 25 +++++++++++++------------
>> + tests/tst_idna2.c      |  8 ++++----
>> + tests/tst_idna3.c      |  8 ++++----
>> + tests/tst_nfkc.c       |  8 ++++----
>> + tests/tst_pr29.c       | 12 ++++++------
>> + tests/tst_punycode.c   | 13 +++++++------
>> + tests/tst_strerror.c   | 20 ++++++++++----------
>> + tests/tst_stringprep.c | 12 ++++++------
>> + tests/tst_tld.c        | 20 ++++++++++----------
>> + tests/utils.c          |  6 +++---
>> + 15 files changed, 76 insertions(+), 74 deletions(-)
>>
>> +diff --git a/examples/example.c b/examples/example.c
>> +index 6e91783..24f64e0 100644
>> +--- a/examples/example.c
>> ++++ b/examples/example.c
>> +@@ -55,7 +55,7 @@ main (void)
>> +
>> +   printf ("Before locale2utf8 (length %ld): ", (long int) strlen (buf));
>> +   for (i = 0; i < strlen (buf); i++)
>> +-    printf ("%02x ", buf[i] & 0xFF);
>> ++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
>> +   printf ("\n");
>> +
>> +   p = stringprep_locale_to_utf8 (buf);
>> +@@ -69,7 +69,7 @@ main (void)
>> +
>> +   printf ("Before stringprep (length %ld): ", (long int) strlen (buf));
>> +   for (i = 0; i < strlen (buf); i++)
>> +-    printf ("%02x ", buf[i] & 0xFF);
>> ++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
>> +   printf ("\n");
>> +
>> +   rc = stringprep (buf, BUFSIZ, 0, stringprep_nameprep);
>> +@@ -79,7 +79,7 @@ main (void)
>> +     {
>> +       printf ("After stringprep (length %ld): ", (long int) strlen
>> (buf));
>> +       for (i = 0; i < strlen (buf); i++)
>> +-    printf ("%02x ", buf[i] & 0xFF);
>> ++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
>> +       printf ("\n");
>> +     }
>> +
>> +diff --git a/examples/example3.c b/examples/example3.c
>> +index fc11c1c..ffb9042 100644
>> +--- a/examples/example3.c
>> ++++ b/examples/example3.c
>> +@@ -56,7 +56,7 @@ main (void)
>> +
>> +   printf ("Read string (length %ld): ", (long int) strlen (buf));
>> +   for (i = 0; i < strlen (buf); i++)
>> +-    printf ("%02x ", buf[i] & 0xFF);
>> ++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
>> +   printf ("\n");
>> +
>> +   rc = idna_to_ascii_lz (buf, &p, 0);
>> +@@ -68,7 +68,7 @@ main (void)
>> +
>> +   printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p);
>> +   for (i = 0; i < strlen (p); i++)
>> +-    printf ("%02x ", p[i] & 0xFF);
>> ++    printf ("%02x ", (unsigned) p[i] & 0xFF);
>> +   printf ("\n");
>> +
>> +   free (p);
>> +diff --git a/examples/example4.c b/examples/example4.c
>> +index 1b319c9..a3315a1 100644
>> +--- a/examples/example4.c
>> ++++ b/examples/example4.c
>> +@@ -56,7 +56,7 @@ main (void)
>> +
>> +   printf ("Read string (length %ld): ", (long int) strlen (buf));
>> +   for (i = 0; i < strlen (buf); i++)
>> +-    printf ("%02x ", buf[i] & 0xFF);
>> ++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
>> +   printf ("\n");
>> +
>> +   rc = idna_to_unicode_lzlz (buf, &p, 0);
>> +@@ -68,7 +68,7 @@ main (void)
>> +
>> +   printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p);
>> +   for (i = 0; i < strlen (p); i++)
>> +-    printf ("%02x ", p[i] & 0xFF);
>> ++    printf ("%02x ", (unsigned) p[i] & 0xFF);
>> +   printf ("\n");
>> +
>> +   free (p);
>> +diff --git a/examples/example5.c b/examples/example5.c
>> +index df55798..29d40b9 100644
>> +--- a/examples/example5.c
>> ++++ b/examples/example5.c
>> +@@ -68,7 +68,7 @@ main (void)
>> +
>> +   printf ("Read string (length %ld): ", (long int) strlen (buf));
>> +   for (i = 0; i < strlen (buf); i++)
>> +-    printf ("%02x ", buf[i] & 0xFF);
>> ++    printf ("%02x ", (unsigned) buf[i] & 0xFF);
>> +   printf ("\n");
>> +
>> +   p = stringprep_locale_to_utf8 (buf);
>>  diff --git a/src/idn.c b/src/idn.c
>> -index be1c7d1..68e4291 100644
>> +index be1c7d1..13eb3c9 100644
>>  --- a/src/idn.c
>>  +++ b/src/idn.c
>> -@@ -170,7 +170,7 @@ main (int argc, char *argv[])
>> -       (args_info.idna_to_unicode_given ? 1 : 0) +
>> -       (args_info.nfkc_given ? 1 : 0) != 1)
>> +@@ -419,7 +419,7 @@ main (int argc, char *argv[])
>> +           size_t i;
>> +           for (i = 0; p[i]; i++)
>> +             fprintf (stderr, "output[%lu] = U+%04x\n",
>> +-                     (unsigned long) i, p[i]);
>> ++                     (unsigned long) i, (unsigned) p[i]);
>> +         }
>> +
>> +       fprintf (stdout, "%s\n", p);
>> +diff --git a/tests/tst_idna.c b/tests/tst_idna.c
>> +index 415764e..4ac046f 100644
>> +--- a/tests/tst_idna.c
>> ++++ b/tests/tst_idna.c
>> +@@ -220,13 +220,14 @@ doit (void)
>> +   char label[100];
>> +   uint32_t *ucs4label = NULL;
>> +   uint32_t tmp[100];
>> +-  size_t len, len2, i;
>> ++  size_t len, len2;
>> +   int rc;
>> ++  unsigned i;
>> +
>> +   for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++)
>>       {
>> --      error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be
>> specified"));
>> -+      error (0, 0, "%s", _("only one of -s, -e, -d, -a, -u or -n can be
>> specified"));
>> -       usage (EXIT_FAILURE);
>> -     }
>> +       if (debug)
>> +-    printf ("IDNA entry %ld: %s\n", i, idna[i].name);
>> ++    printf ("IDNA entry %u: %s\n", i, idna[i].name);
>>
>> -@@ -185,7 +185,7 @@ main (int argc, char *argv[])
>> -   if (!args_info.quiet_given
>> -       && args_info.inputs_num == 0
>> -       && isatty (fileno (stdin)))
>> --    fprintf (stderr, _("Type each input string on a line by itself, "
>> -+    fprintf (stderr, "%s", _("Type each input string on a line by
>> itself, "
>> -                    "terminated by a newline character.\n"));
>> -
>> -   do
>> -@@ -197,7 +197,7 @@ main (int argc, char *argv[])
>> -       if (feof (stdin))
>> -         break;
>> +       if (debug)
>> +     {
>> +@@ -237,7 +238,7 @@ doit (void)
>> +       rc = idna_to_ascii_4i (idna[i].in, idna[i].inlen, label,
>> idna[i].flags);
>> +       if (rc != idna[i].toasciirc)
>> +     {
>> +-      fail ("IDNA entry %ld failed: %d\n", i, rc);
>> ++      fail ("IDNA entry %u failed: %d\n", i, rc);
>> +       if (debug)
>> +         printf ("FATAL\n");
>> +       continue;
>> +@@ -256,7 +257,7 @@ doit (void)
>> +       if (strlen (idna[i].out) != strlen (label) ||
>> +           strcasecmp (idna[i].out, label) != 0)
>> +         {
>> +-          fail ("IDNA entry %ld failed\n", i);
>> ++          fail ("IDNA entry %u failed\n", i);
>> +           if (debug)
>> +             printf ("ERROR\n");
>> +         }
>> +@@ -273,8 +274,8 @@ doit (void)
>>
>> --      error (EXIT_FAILURE, errno, _("input error"));
>> -+      error (EXIT_FAILURE, errno, "%s", _("input error"));
>> +       if (debug)
>> +     {
>> +-      printf ("in: %s (%ld==%ld)\n", idna[i].out, strlen
>> (idna[i].out),
>> +-              len);
>> ++      printf ("in: %s (%d==%d)\n", idna[i].out, (int) strlen
>> (idna[i].out),
>> ++              (int) len);
>> +       ucs4print (ucs4label, len);
>>       }
>>
>> -       if (strlen (line) > 0)
>> -@@ -215,7 +215,7 @@ main (int argc, char *argv[])
>> -       if (!q)
>> +@@ -282,20 +283,20 @@ doit (void)
>> +       rc = idna_to_unicode_44i (ucs4label, len, tmp, &len2,
>> idna[i].flags);
>> +       if (debug)
>> +     {
>> +-      printf ("expected out (%ld):\n",
>> ++      printf ("expected out (%lu):\n",
>> +               rc == IDNA_SUCCESS ? idna[i].inlen : len);
>> +       if (rc == IDNA_SUCCESS)
>> +         ucs4print (idna[i].in, idna[i].inlen);
>> +       else
>> +         ucs4print (ucs4label, len);
>> +
>> +-      printf ("computed out (%ld):\n", len2);
>> ++      printf ("computed out (%d):\n", (int) len2);
>> +       ucs4print (tmp, len2);
>> +     }
>> +
>> +       if (rc != idna[i].tounicoderc)
>> +     {
>> +-      fail ("IDNA entry %ld failed: %d\n", i, rc);
>> ++      fail ("IDNA entry %u failed: %d\n", i, rc);
>> +       if (debug)
>> +         printf ("FATAL\n");
>> +       continue;
>> +@@ -309,11 +310,11 @@ doit (void)
>> +       if (debug)
>>           {
>> -           free (p);
>> --          error (EXIT_FAILURE, 0,
>> -+          error (EXIT_FAILURE, 0, "%s",
>> -                  _("could not convert from UTF-8 to UCS-4"));
>> +           if (rc == IDNA_SUCCESS)
>> +-            printf ("len=%ld len2=%ld\n", len2, idna[i].inlen);
>> ++            printf ("len=%d len2=%d\n", (int) len2, (int)
>> idna[i].inlen);
>> +           else
>> +-            printf ("len=%ld len2=%ld\n", len, len2);
>> ++            printf ("len=%d len2=%d\n", (int) len, (int) len2);
>>           }
>> +-      fail ("IDNA entry %ld failed\n", i);
>> ++      fail ("IDNA entry %u failed\n", i);
>> +       if (debug)
>> +         printf ("ERROR\n");
>> +     }
>> +diff --git a/tests/tst_idna2.c b/tests/tst_idna2.c
>> +index 65b3a4d..38932ca 100644
>> +--- a/tests/tst_idna2.c
>> ++++ b/tests/tst_idna2.c
>> +@@ -461,14 +461,14 @@ static const struct idna idna[] = {
>> + void
>> + doit (void)
>> + {
>> +-  size_t i;
>> ++  unsigned i;
>> +   char *out;
>> +   int rc;
>> +
>> +   for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++)
>> +     {
>> +       if (debug)
>> +-    printf ("IDNA2 entry %ld\n", i);
>> ++    printf ("IDNA2 entry %u\n", i);
>> +
>> +       if (debug)
>> +     {
>> +@@ -487,7 +487,7 @@ doit (void)
>> +                          IDNA_USE_STD3_ASCII_RULES);
>> +       if (rc != IDNA_SUCCESS && strlen (idna[i].out) > 0)
>> +     {
>> +-      fail ("IDNA2 entry %ld failed: %d\n", i, rc);
>> ++      fail ("IDNA2 entry %u failed: %d\n", i, rc);
>> +       continue;
>> +     }
>>
>> -@@ -240,7 +240,7 @@ main (int argc, char *argv[])
>> -       if (!q)
>> +@@ -504,7 +504,7 @@ doit (void)
>> +       if (strlen (idna[i].out) != strlen (out) ||
>> +           strcasecmp (idna[i].out, out) != 0)
>>           {
>> -           free (r);
>> --          error (EXIT_FAILURE, 0,
>> -+          error (EXIT_FAILURE, 0, "%s",
>> -                  _("could not convert from UTF-8 to UCS-4"));
>> +-          fail ("IDNA2 entry %ld failed\n", i);
>> ++          fail ("IDNA2 entry %u failed\n", i);
>> +           if (debug)
>> +             printf ("ERROR\n");
>>           }
>> +diff --git a/tests/tst_idna3.c b/tests/tst_idna3.c
>> +index a189378..f65628c 100644
>> +--- a/tests/tst_idna3.c
>> ++++ b/tests/tst_idna3.c
>> +@@ -59,13 +59,13 @@ doit (void)
>> + {
>> +   int rc;
>> +   char *out = NULL;
>> +-  size_t i;
>> ++  unsigned i;
>> +
>> +   for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++)
>> +     {
>> +       rc = idna_to_unicode_8z8z (idna[i].in, &out, 0);
>> +       if (rc != IDNA_SUCCESS)
>> +-    fail ("IDNA3[%ld] failed %d\n", i, rc);
>> ++    fail ("IDNA3[%u] failed %d\n", i, rc);
>>
>> -@@ -277,7 +277,7 @@ main (int argc, char *argv[])
>> -       q = stringprep_utf8_to_ucs4 (p, -1, &len);
>> -       free (p);
>> -       if (!q)
>> --        error (EXIT_FAILURE, 0,
>> -+        error (EXIT_FAILURE, 0, "%s",
>> -                _("could not convert from UTF-8 to UCS-4"));
>> -
>> -       if (args_info.debug_given)
>> -@@ -336,7 +336,7 @@ main (int argc, char *argv[])
>> -       r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
>> -       free (q);
>> -       if (!r)
>> --        error (EXIT_FAILURE, 0,
>> -+        error (EXIT_FAILURE, 0, "%s",
>> -                _("could not convert from UCS-4 to UTF-8"));
>> -
>> -       p = stringprep_utf8_to_locale (r);
>> -@@ -360,7 +360,7 @@ main (int argc, char *argv[])
>> -       q = stringprep_utf8_to_ucs4 (p, -1, NULL);
>> -       free (p);
>> -       if (!q)
>> --        error (EXIT_FAILURE, 0,
>> -+        error (EXIT_FAILURE, 0, "%s",
>> -                _("could not convert from UCS-4 to UTF-8"));
>> -
>> -       if (args_info.debug_given)
>> -@@ -438,7 +438,7 @@ main (int argc, char *argv[])
>> -       if (!q)
>> +       if (debug && rc == IDNA_SUCCESS)
>> +     {
>> +@@ -75,9 +75,9 @@ doit (void)
>> +     }
>> +
>> +       if (strcmp (out, idna[i].out) != 0)
>> +-    fail ("IDNA3[%ld] failed\n", i);
>> ++    fail ("IDNA3[%u] failed\n", i);
>> +       else if (debug)
>> +-    printf ("IDNA3[%ld] success\n", i);
>> ++    printf ("IDNA3[%u] success\n", i);
>> +
>> +       if (out)
>> +     idn_free (out);
>> +diff --git a/tests/tst_nfkc.c b/tests/tst_nfkc.c
>> +index d150fec..f5af9c6 100644
>> +--- a/tests/tst_nfkc.c
>> ++++ b/tests/tst_nfkc.c
>> +@@ -68,18 +68,18 @@ void
>> + doit (void)
>> + {
>> +   char *out;
>> +-  size_t i;
>> ++  unsigned i;
>> +
>> +   for (i = 0; i < sizeof (nfkc) / sizeof (nfkc[0]); i++)
>> +     {
>> +       if (debug)
>> +-    printf ("NFKC entry %ld\n", i);
>> ++    printf ("NFKC entry %u\n", i);
>> +
>> +       out = stringprep_utf8_nfkc_normalize (nfkc[i].in,
>> +                                         (ssize_t) strlen
>> (nfkc[i].in));
>> +       if (out == NULL)
>> +     {
>> +-      fail ("NFKC entry %ld failed fatally\n", i);
>> ++      fail ("NFKC entry %u failed fatally\n", i);
>> +       continue;
>> +     }
>> +
>> +@@ -114,7 +114,7 @@ doit (void)
>> +       if (strlen (nfkc[i].out) != strlen (out) ||
>> +       memcmp (nfkc[i].out, out, strlen (out)) != 0)
>> +     {
>> +-      fail ("NFKC entry %ld failed\n", i);
>> ++      fail ("NFKC entry %u failed\n", i);
>> +       if (debug)
>> +         printf ("ERROR\n");
>> +     }
>> +diff --git a/tests/tst_pr29.c b/tests/tst_pr29.c
>> +index 3dc5466..11d0ede 100644
>> +--- a/tests/tst_pr29.c
>> ++++ b/tests/tst_pr29.c
>> +@@ -91,7 +91,7 @@ static const struct tv tv[] = {
>> + void
>> + doit (void)
>> + {
>> +-  size_t i;
>> ++  unsigned i;
>> +   int rc;
>> +
>> +   for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++)
>> +@@ -100,7 +100,7 @@ doit (void)
>> +     {
>> +       uint32_t *p, *q;
>> +
>> +-      printf ("PR29 entry %ld: %s\n", i, tv[i].name);
>> ++      printf ("PR29 entry %u: %s\n", i, tv[i].name);
>> +
>> +       printf ("in:\n");
>> +       ucs4print (tv[i].in, tv[i].inlen);
>> +@@ -120,7 +120,7 @@ doit (void)
>> +       rc = pr29_4 (tv[i].in, tv[i].inlen);
>> +       if (rc != tv[i].rc)
>> +     {
>> +-      fail ("PR29 entry %ld failed (expected %d): %d\n", i,
>> tv[i].rc, rc);
>> ++      fail ("PR29 entry %u failed (expected %d): %d\n", i, tv[i].rc,
>> rc);
>> +       if (debug)
>> +         printf ("FATAL\n");
>> +       continue;
>> +@@ -129,7 +129,7 @@ doit (void)
>> +       rc = pr29_4z (tv[i].in);
>> +       if (rc != tv[i].rc)
>> +     {
>> +-      fail ("PR29 entry %ld failed (expected %d): %d\n", i,
>> tv[i].rc, rc);
>> ++      fail ("PR29 entry %u failed (expected %d): %d\n", i, tv[i].rc,
>> rc);
>> +       if (debug)
>> +         printf ("FATAL\n");
>> +       continue;
>> +@@ -142,7 +142,7 @@ doit (void)
>> +     p = stringprep_ucs4_to_utf8 (tv[i].in, (ssize_t) tv[i].inlen,
>> +                                  &items_read, &items_written);
>> +     if (p == NULL)
>> +-      fail ("FAIL: stringprep_ucs4_to_utf8(tv[%ld]) == NULL\n", i);
>> ++      fail ("FAIL: stringprep_ucs4_to_utf8(tv[%u]) == NULL\n", i);
>> +     if (debug)
>> +       hexprint (p, strlen (p));
>> +
>> +@@ -150,7 +150,7 @@ doit (void)
>> +     free (p);
>> +     if (rc != tv[i].rc)
>> +       {
>> +-        fail ("PR29 entry %ld failed (expected %d): %d\n",
>> ++        fail ("PR29 entry %u failed (expected %d): %d\n",
>> +               i, tv[i].rc, rc);
>> +         if (debug)
>> +           printf ("FATAL\n");
>> +diff --git a/tests/tst_punycode.c b/tests/tst_punycode.c
>> +index 493b8a2..997744a 100644
>> +--- a/tests/tst_punycode.c
>> ++++ b/tests/tst_punycode.c
>> +@@ -173,7 +173,8 @@ doit (void)
>> +   char *p;
>> +   uint32_t *q;
>> +   int rc;
>> +-  size_t i, outlen;
>> ++  size_t outlen;
>> ++  unsigned i;
>> +
>> +   p = malloc (sizeof (*p) * BUFSIZ);
>> +   if (p == NULL)
>> +@@ -186,7 +187,7 @@ doit (void)
>> +   for (i = 0; i < sizeof (punycode) / sizeof (punycode[0]); i++)
>> +     {
>> +       if (debug)
>> +-    printf ("PUNYCODE entry %ld: %s\n", i, punycode[i].name);
>> ++    printf ("PUNYCODE entry %u: %s\n", i, punycode[i].name);
>> +
>> +       if (debug)
>> +     {
>> +@@ -199,7 +200,7 @@ doit (void)
>> +                         NULL, &outlen, p);
>> +       if (rc != punycode[i].rc)
>> +     {
>> +-      fail ("punycode_encode() entry %ld failed: %d\n", i, rc);
>> ++      fail ("punycode_encode() entry %u failed: %d\n", i, rc);
>> +       if (debug)
>> +         printf ("FATAL\n");
>> +       continue;
>> +@@ -221,7 +222,7 @@ doit (void)
>> +       if (strlen (punycode[i].out) != strlen (p) ||
>> +           memcmp (punycode[i].out, p, strlen (p)) != 0)
>> +         {
>> +-          fail ("punycode() entry %ld failed\n", i);
>> ++          fail ("punycode() entry %u failed\n", i);
>> +           if (debug)
>> +             printf ("ERROR\n");
>> +         }
>> +@@ -241,7 +242,7 @@ doit (void)
>> +                         &outlen, q, NULL);
>> +       if (rc != punycode[i].rc)
>> +     {
>> +-      fail ("punycode() entry %ld failed: %d\n", i, rc);
>> ++      fail ("punycode() entry %u failed: %d\n", i, rc);
>> +       if (debug)
>> +         printf ("FATAL\n");
>> +       continue;
>> +@@ -262,7 +263,7 @@ doit (void)
>> +       if (punycode[i].inlen != outlen ||
>> +           memcmp (punycode[i].in, q, outlen) != 0)
>>           {
>> -           free (p);
>> --          error (EXIT_FAILURE, 0,
>> -+          error (EXIT_FAILURE, 0, "%s",
>> -                  _("could not convert from UCS-4 to UTF-8"));
>> +-          fail ("punycode_decode() entry %ld failed\n", i);
>> ++          fail ("punycode_decode() entry %u failed\n", i);
>> +           if (debug)
>> +             printf ("ERROR\n");
>>           }
>> +diff --git a/tests/tst_strerror.c b/tests/tst_strerror.c
>> +index 71fff59..730f5e4 100644
>> +--- a/tests/tst_strerror.c
>> ++++ b/tests/tst_strerror.c
>> +@@ -110,7 +110,7 @@ doit (void)
>> +   /* Iterate through all error codes. */
>> +
>> +   {
>> +-    size_t i;
>> ++    unsigned i;
>> +     const char *last_p = NULL;
>> +
>> +     for (i = 0;; i++)
>> +@@ -126,13 +126,13 @@ doit (void)
>> +         break;
>> +       }
>> +     if (debug)
>> +-      printf ("idna %ld: %s\n", i, p);
>> ++      printf ("idna %u: %s\n", i, p);
>> +     last_p = p;
>> +       }
>> +   }
>> +
>> +   {
>> +-    size_t i;
>> ++    unsigned i;
>> +     const char *last_p = NULL;
>> +
>> +     for (i = 0;; i++)
>> +@@ -141,13 +141,13 @@ doit (void)
>> +     if (p == last_p)
>> +       break;
>> +     if (debug)
>> +-      printf ("pr29 %ld: %s\n", i, p);
>> ++      printf ("pr29 %u: %s\n", i, p);
>> +     last_p = p;
>> +       }
>> +   }
>> +
>> +   {
>> +-    size_t i;
>> ++    unsigned i;
>> +     const char *last_p = NULL;
>> +
>> +     for (i = 0;; i++)
>> +@@ -156,13 +156,13 @@ doit (void)
>> +     if (p == last_p)
>> +       break;
>> +     if (debug)
>> +-      printf ("punycode %ld: %s\n", i, p);
>> ++      printf ("punycode %u: %s\n", i, p);
>> +     last_p = p;
>> +       }
>> +   }
>>
>> -@@ -494,7 +494,7 @@ main (int argc, char *argv[])
>> -       r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
>> -       free (q);
>> -       if (!r)
>> --        error (EXIT_FAILURE, 0,
>> -+        error (EXIT_FAILURE, 0, "%s",
>> -                _("could not convert from UTF-8 to UCS-4"));
>> -
>> -       p = stringprep_utf8_to_locale (r);
>> -@@ -523,7 +523,7 @@ main (int argc, char *argv[])
>> -           if (!q)
>> -             {
>> -               free (p);
>> --              error (EXIT_FAILURE, 0,
>> -+              error (EXIT_FAILURE, 0, "%s",
>> -                      _("could not convert from UTF-8 to UCS-4"));
>> -             }
>> -
>> -@@ -537,7 +537,8 @@ main (int argc, char *argv[])
>> -       r = stringprep_utf8_nfkc_normalize (p, -1);
>> -       free (p);
>> -       if (!r)
>> --        error (EXIT_FAILURE, 0, _("could not do NFKC
>> normalization"));
>> -+        error (EXIT_FAILURE, 0, "%s",
>> -+               _("could not do NFKC normalization"));
>> -
>> -       if (args_info.debug_given)
>> +   {
>> +-    size_t i;
>> ++    unsigned i;
>> +     const char *last_p = NULL;
>> +
>> +     for (i = 0;; i++)
>> +@@ -183,13 +183,13 @@ doit (void)
>> +         break;
>> +       }
>> +     if (debug)
>> +-      printf ("stringprep %ld: %s\n", i, p);
>> ++      printf ("stringprep %u: %s\n", i, p);
>> +     last_p = p;
>> +       }
>> +   }
>> +
>> +   {
>> +-    size_t i;
>> ++    unsigned i;
>> +     const char *last_p = NULL;
>> +
>> +     for (i = 0;; i++)
>> +@@ -198,7 +198,7 @@ doit (void)
>> +     if (p == last_p)
>> +       break;
>> +     if (debug)
>> +-      printf ("tld %ld: %s\n", i, p);
>> ++      printf ("tld %u: %s\n", i, p);
>> +     last_p = p;
>> +       }
>> +   }
>> +diff --git a/tests/tst_stringprep.c b/tests/tst_stringprep.c
>> +index 149ce6f..7c9ab06 100644
>> +--- a/tests/tst_stringprep.c
>> ++++ b/tests/tst_stringprep.c
>> +@@ -205,7 +205,7 @@ doit (void)
>> + {
>> +   char *p;
>> +   int rc;
>> +-  size_t i;
>> ++  unsigned i;
>> +
>> +   if (!stringprep_check_version (STRINGPREP_VERSION))
>> +     fail ("stringprep_check_version failed (header %s runtime %s)\n",
>> +@@ -224,7 +224,7 @@ doit (void)
>> +   for (i = 0; i < sizeof (strprep) / sizeof (strprep[0]); i++)
>> +     {
>> +       if (debug)
>> +-    printf ("STRINGPREP entry %ld\n", i);
>> ++    printf ("STRINGPREP entry %u\n", i);
>> +
>> +       if (debug)
>> +     {
>> +@@ -247,12 +247,12 @@ doit (void)
>> +       continue;
>> +     else if (l == NULL)
>> +       {
>> +-        fail ("bad UTF-8 in entry %ld\n", i);
>> ++        fail ("bad UTF-8 in entry %u\n", i);
>> +         continue;
>> +       }
>> +     else if (strcmp (strprep[i].in, x) != 0)
>> +       {
>> +-        fail ("bad UTF-8 in entry %ld\n", i);
>> ++        fail ("bad UTF-8 in entry %u\n", i);
>> +         if (debug)
>> +           {
>> +             puts ("expected:");
>> +@@ -274,7 +274,7 @@ doit (void)
>> +                            "Nameprep", strprep[i].flags);
>> +       if (rc != strprep[i].rc)
>> +     {
>> +-      fail ("stringprep() entry %ld failed: %d\n", i, rc);
>> ++      fail ("stringprep() entry %u failed: %d\n", i, rc);
>> +       if (debug)
>> +         printf ("FATAL\n");
>> +       if (rc == STRINGPREP_OK)
>> +@@ -302,7 +302,7 @@ doit (void)
>> +       if (strlen (strprep[i].out) != strlen (p) ||
>> +           memcmp (strprep[i].out, p, strlen (p)) != 0)
>>           {
>> -@@ -547,7 +548,7 @@ main (int argc, char *argv[])
>> -           if (!q)
>> -             {
>> -               free (r);
>> --              error (EXIT_FAILURE, 0,
>> -+              error (EXIT_FAILURE, 0, "%s",
>> -                      _("could not convert from UTF-8 to UCS-4"));
>> -             }
>> +-          fail ("stringprep() entry %ld failed\n", i);
>> ++          fail ("stringprep() entry %ld failed\n", (long) i);
>> +           if (debug)
>> +             printf ("ERROR\n");
>> +         }
>> +diff --git a/tests/tst_tld.c b/tests/tst_tld.c
>> +index 2f8e12e..d038c79 100644
>> +--- a/tests/tst_tld.c
>> ++++ b/tests/tst_tld.c
>> +@@ -80,7 +80,7 @@ const Tld_table * my_tld_tables[] =
>> + void
>> + doit (void)
>> + {
>> +-  size_t i;
>> ++  unsigned i;
>> +   const Tld_table *tldtable;
>> +   char *out;
>> +   size_t errpos;
>> +@@ -206,7 +206,7 @@ doit (void)
>> +   for (i = 0; i < sizeof (tld) / sizeof (tld[0]); i++)
>> +     {
>> +       if (debug)
>> +-    printf ("TLD entry %ld: %s\n", i, tld[i].name);
>> ++    printf ("TLD entry %u: %s\n", i, tld[i].name);
>> +
>> +       if (debug)
>> +     {
>> +@@ -217,7 +217,7 @@ doit (void)
>> +       tldtable = tld_default_table (tld[i].tld, NULL);
>> +       if (tldtable == NULL)
>> +     {
>> +-      fail ("TLD entry %ld tld_get_table (%s)\n", i, tld[i].tld);
>> ++      fail ("TLD entry %u tld_get_table (%s)\n", i, tld[i].tld);
>> +       if (debug)
>> +         printf ("FATAL\n");
>> +       continue;
>> +@@ -226,7 +226,7 @@ doit (void)
>> +       rc = tld_check_4t (tld[i].in, tld[i].inlen, &errpos, tldtable);
>> +       if (rc != tld[i].rc)
>> +     {
>> +-      fail ("TLD entry %ld failed: %d\n", i, rc);
>> ++      fail ("TLD entry %u failed: %d\n", i, rc);
>> +       if (debug)
>> +         printf ("FATAL\n");
>> +       continue;
>> +@@ -237,7 +237,7 @@ doit (void)
>>
>> +       if (rc != tld[i].rc)
>> +     {
>> +-      fail ("TLD entry %ld failed\n", i);
>> ++      fail ("TLD entry %u failed\n", i);
>> +       if (debug)
>> +         printf ("ERROR\n");
>> +     }
>> +@@ -245,12 +245,12 @@ doit (void)
>> +     {
>> +       if (debug)
>> +         printf ("returned errpos %ld expected errpos %ld\n",
>> +-                errpos, tld[i].errpos);
>> ++                (long) errpos, (long) tld[i].errpos);
>> +
>> +       if (tld[i].errpos != errpos)
>> +         {
>> +-          fail ("TLD entry %ld failed because errpos %ld != %ld\n",
>> i,
>> +-                tld[i].errpos, errpos);
>> ++          fail ("TLD entry %u failed because errpos %ld != %ld\n",
>> i,
>> ++                (long) tld[i].errpos, (long) errpos);
>> +           if (debug)
>> +             printf ("ERROR\n");
>> +         }
>> +@@ -262,12 +262,12 @@ doit (void)
>> +     rc = tld_check_8z (tld[i].example, &errpos, NULL);
>> +     if (rc != tld[i].rc)
>> +       {
>> +-        fail ("TLD entry %ld failed\n", i);
>> ++        fail ("TLD entry %u failed\n", i);
>> +         if (debug)
>> +           printf ("ERROR\n");
>> +       }
>> +     if (debug)
>> +-      printf ("TLD entry %ld tld_check_8z (%s)\n", i,
>> tld[i].example);
>> ++      printf ("TLD entry %u tld_check_8z (%s)\n", i,
>> tld[i].example);
>> +       }
>> +     }
>> + }
>> +diff --git a/tests/utils.c b/tests/utils.c
>> +index 717ee01..5577dc3 100644
>> +--- a/tests/utils.c
>> ++++ b/tests/utils.c
>> +@@ -49,7 +49,7 @@ escapeprint (const char *str, size_t len)
>> + {
>> +   size_t i;
>> +
>> +-  printf (" (length %ld bytes):\n\t", len);
>> ++  printf (" (length %ld bytes):\n\t", (long) len);
>> +   for (i = 0; i < len; i++)
>> +     {
>> +       if (((str[i] & 0xFF) >= 'A' && (str[i] & 0xFF) <= 'Z') ||
>> +@@ -58,7 +58,7 @@ escapeprint (const char *str, size_t len)
>> +       || (str[i] & 0xFF) == ' ' || (str[i] & 0xFF) == '.')
>> +     printf ("%c", (str[i] & 0xFF));
>> +       else
>> +-    printf ("\\x%02X", (str[i] & 0xFF));
>> ++    printf ("\\x%02X", (unsigned) (str[i] & 0xFF));
>> +       if ((i + 1) % 16 == 0 && (i + 1) < len)
>> +     printf ("'\n\t'");
>> +     }
>> +@@ -73,7 +73,7 @@ hexprint (const char *str, size_t len)
>> +   printf ("\t;; ");
>> +   for (i = 0; i < len; i++)
>> +     {
>> +-      printf ("%02x ", (str[i] & 0xFF));
>> ++      printf ("%02x ", (unsigned) (str[i] & 0xFF));
>> +       if ((i + 1) % 8 == 0)
>> +     printf (" ");
>> +       if ((i + 1) % 16 == 0 && i + 1 < len)
>>  --
>> -2.8.1
>> +1.9.1
>>
>> diff --git a/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch
>> b/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch
>> new file mode 100644
>> index 00000000000..546a6eaafcf
>> --- /dev/null
>> +++ b/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch
>> @@ -0,0 +1,334 @@
>> +From 230930b3bc3e431b819eb45420cb42475d83ca93 Mon Sep 17 00:00:00 2001
>> +From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
>> +Date: Wed, 1 Feb 2017 10:44:36 +0100
>> +Subject: [PATCH] Update intprops.h for gcc-7 compatibility
>> +
>> +---
>> +Upstream-Status: Backport
>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> +
>> + gl/intprops.h          | 65 ++++++++++++++++++++++++++++++------------
>> --------
>> + lib/gltests/intprops.h | 65 ++++++++++++++++++++++++++++++------------
>> --------
>> + 2 files changed, 78 insertions(+), 52 deletions(-)
>> +
>> +diff --git a/gl/intprops.h b/gl/intprops.h
>> +index e1fce5c..eb06b69 100644
>> +--- a/gl/intprops.h
>> ++++ b/gl/intprops.h
>> +@@ -1,18 +1,18 @@
>> + /* intprops.h -- properties of integer types
>> +
>> +-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
>> ++   Copyright (C) 2001-2017 Free Software Foundation, Inc.
>> +
>> +    This program is free software: you can redistribute it and/or modify
>> it
>> +-   under the terms of the GNU General Public License as published
>> +-   by the Free Software Foundation; either version 3 of the License, or
>> ++   under the terms of the GNU Lesser General Public License as published
>> ++   by the Free Software Foundation; either version 2.1 of the License,
>> or
>> +    (at your option) any later version.
>> +
>> +    This program is distributed in the hope that it will be useful,
>> +    but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> +-   GNU General Public License for more details.
>> ++   GNU Lesser General Public License for more details.
>> +
>> +-   You should have received a copy of the GNU General Public License
>> ++   You should have received a copy of the GNU Lesser General Public
>> License
>> +    along with this program.  If not, see <http://www.gnu.org/licenses/>.
>>   */
>> +
>> + /* Written by Paul Eggert.  */
>> +@@ -47,12 +47,16 @@
>> +
>> + /* Minimum and maximum values for integer types and expressions.  */
>> +
>> ++/* The width in bits of the integer type or expression T.
>> ++   Padding bits are not supported; this is checked at compile-time
>> below.  */
>> ++#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
>> ++
>> + /* The maximum and minimum values for the integer type T.  */
>> + #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
>> + #define
>> TYPE_MAXIMUM(t)                                                 \
>> +   ((t) (! TYPE_SIGNED
>> (t)                                               \
>> +         ? (t)
>> -1                                                        \
>> +-        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
>> ++        : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
>> +
>> + /* The maximum and minimum values for the type of the expression E,
>> +    after integer promotion.  E should not have side effects.  */
>> +@@ -65,7 +69,13 @@
>> +    ? _GL_SIGNED_INT_MAXIMUM
>> (e)                                         \
>> +    : _GL_INT_NEGATE_CONVERT (e, 1))
>> + #define
>> _GL_SIGNED_INT_MAXIMUM(e)                                       \
>> +-  (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) *
>> 2 + 1)
>> ++  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
>> ++
>> ++/* Work around OpenVMS incompatibility with C99.  */
>> ++#if !defined LLONG_MAX && defined __INT64_MAX
>> ++# define LLONG_MAX __INT64_MAX
>> ++# define LLONG_MIN __INT64_MIN
>> ++#endif
>> +
>> + /* This include file assumes that signed types are two's complement
>> without
>> +    padding bits; the above macros have undefined behavior otherwise.
>> +@@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX);
>> + verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
>> + verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> + #endif
>> ++/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if
>> defined.  */
>> ++#ifdef UINT_WIDTH
>> ++verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
>> ++#endif
>> +
>> + /* Does the __typeof__ keyword work?  This could be done by
>> +    'configure', but for now it's easier to do it by hand.  */
>> +-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
>> ++#if (2 <= __GNUC__ \
>> ++     || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
>> +      || (0x5110 <= __SUNPRO_C && !__STDC__))
>> + # define _GL_HAVE___TYPEOF__ 1
>> + #else
>> +@@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> +    signed, this macro may overestimate the true bound by one byte when
>> +    applied to unsigned types of size 2, 4, 16, ... bytes.  */
>> + #define INT_STRLEN_BOUND(t)                                     \
>> +-  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT                 \
>> +-                          - _GL_SIGNED_TYPE_OR_EXPR (t))        \
>> ++  (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t))
>> \
>> +    + _GL_SIGNED_TYPE_OR_EXPR (t))
>> +
>> + /* Bound on buffer size needed to represent an integer type or
>> expression T,
>> +@@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> +    ? (a) < (min) >> (b)                                 \
>> +    : (max) >> (b) < (a))
>> +
>> +-/* True if __builtin_add_overflow (A, B, P) works when P is null.  */
>> +-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
>> ++/* True if __builtin_add_overflow (A, B, P) works when P is non-
>> null.  */
>> ++#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__)
>> ++
>> ++/* True if __builtin_add_overflow_p (A, B, C) works.  */
>> ++#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
>> +
>> + /* The _GL*_OVERFLOW macros have the same restrictions as the
>> +    *_RANGE_OVERFLOW macros, except that they do not assume that operands
>> +    (e.g., A and B) have the same type as MIN and MAX.  Instead, they
>> assume
>> +    that the result (e.g., A + B) has that type.  */
>> +-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
>> +-# define _GL_ADD_OVERFLOW(a, b, min, max)
>> +-   __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
>> +-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
>> +-   __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
>> +-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
>> +-   __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
>> ++#if _GL_HAS_BUILTIN_OVERFLOW_P
>> ++# define _GL_ADD_OVERFLOW(a, b, min,
>> max)                               \
>> ++   __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
>> ++# define _GL_SUBTRACT_OVERFLOW(a, b, min,
>> max)                          \
>> ++   __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
>> ++# define _GL_MULTIPLY_OVERFLOW(a, b, min,
>> max)                          \
>> ++   __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
>> + #else
>> + # define _GL_ADD_OVERFLOW(a, b, min,
>> max)                                \
>> +    ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min,
>> max)                  \
>> +@@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> +   _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
>> + #define INT_SUBTRACT_OVERFLOW(a, b) \
>> +   _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
>> +-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
>> ++#if _GL_HAS_BUILTIN_OVERFLOW_P
>> + # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
>> + #else
>> + # define INT_NEGATE_OVERFLOW(a) \
>> +@@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> + #define INT_MULTIPLY_WRAPV(a, b, r) \
>> +   _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow,
>> INT_MULTIPLY_OVERFLOW)
>> +
>> +-#ifndef __has_builtin
>> +-# define __has_builtin(x) 0
>> +-#endif
>> +-
>> + /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390.  See:
>> +    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
>> +    https://llvm.org/bugs/show_bug.cgi?id=25390
>> +@@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> +    the operation.  BUILTIN is the builtin operation, and OVERFLOW the
>> +    overflow predicate.  Return 1 if the result overflows.  See above
>> +    for restrictions.  */
>> +-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
>> ++#if _GL_HAS_BUILTIN_OVERFLOW
>> + # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b,
>> r)
>> + #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
>> + # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
>> +@@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> + # else
>> + #  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
>> +     _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
>> +-                     long int, LONG_MIN, LONG_MAX))
>> ++                     long int, LONG_MIN, LONG_MAX)
>> + # endif
>> + #endif
>> +
>> +diff --git a/lib/gltests/intprops.h b/lib/gltests/intprops.h
>> +index e1fce5c..eb06b69 100644
>> +--- a/lib/gltests/intprops.h
>> ++++ b/lib/gltests/intprops.h
>> +@@ -1,18 +1,18 @@
>> + /* intprops.h -- properties of integer types
>> +
>> +-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
>> ++   Copyright (C) 2001-2017 Free Software Foundation, Inc.
>> +
>> +    This program is free software: you can redistribute it and/or modify
>> it
>> +-   under the terms of the GNU General Public License as published
>> +-   by the Free Software Foundation; either version 3 of the License, or
>> ++   under the terms of the GNU Lesser General Public License as published
>> ++   by the Free Software Foundation; either version 2.1 of the License,
>> or
>> +    (at your option) any later version.
>> +
>> +    This program is distributed in the hope that it will be useful,
>> +    but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> +-   GNU General Public License for more details.
>> ++   GNU Lesser General Public License for more details.
>> +
>> +-   You should have received a copy of the GNU General Public License
>> ++   You should have received a copy of the GNU Lesser General Public
>> License
>> +    along with this program.  If not, see <http://www.gnu.org/licenses/>.
>>   */
>> +
>> + /* Written by Paul Eggert.  */
>> +@@ -47,12 +47,16 @@
>> +
>> + /* Minimum and maximum values for integer types and expressions.  */
>> +
>> ++/* The width in bits of the integer type or expression T.
>> ++   Padding bits are not supported; this is checked at compile-time
>> below.  */
>> ++#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
>> ++
>> + /* The maximum and minimum values for the integer type T.  */
>> + #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
>> + #define
>> TYPE_MAXIMUM(t)                                                 \
>> +   ((t) (! TYPE_SIGNED
>> (t)                                               \
>> +         ? (t)
>> -1                                                        \
>> +-        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
>> ++        : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
>> +
>> + /* The maximum and minimum values for the type of the expression E,
>> +    after integer promotion.  E should not have side effects.  */
>> +@@ -65,7 +69,13 @@
>> +    ? _GL_SIGNED_INT_MAXIMUM
>> (e)                                         \
>> +    : _GL_INT_NEGATE_CONVERT (e, 1))
>> + #define
>> _GL_SIGNED_INT_MAXIMUM(e)                                       \
>> +-  (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) *
>> 2 + 1)
>> ++  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
>> ++
>> ++/* Work around OpenVMS incompatibility with C99.  */
>> ++#if !defined LLONG_MAX && defined __INT64_MAX
>> ++# define LLONG_MAX __INT64_MAX
>> ++# define LLONG_MIN __INT64_MIN
>> ++#endif
>> +
>> + /* This include file assumes that signed types are two's complement
>> without
>> +    padding bits; the above macros have undefined behavior otherwise.
>> +@@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX);
>> + verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
>> + verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> + #endif
>> ++/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if
>> defined.  */
>> ++#ifdef UINT_WIDTH
>> ++verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
>> ++#endif
>> +
>> + /* Does the __typeof__ keyword work?  This could be done by
>> +    'configure', but for now it's easier to do it by hand.  */
>> +-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
>> ++#if (2 <= __GNUC__ \
>> ++     || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
>> +      || (0x5110 <= __SUNPRO_C && !__STDC__))
>> + # define _GL_HAVE___TYPEOF__ 1
>> + #else
>> +@@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> +    signed, this macro may overestimate the true bound by one byte when
>> +    applied to unsigned types of size 2, 4, 16, ... bytes.  */
>> + #define INT_STRLEN_BOUND(t)                                     \
>> +-  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT                 \
>> +-                          - _GL_SIGNED_TYPE_OR_EXPR (t))        \
>> ++  (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t))
>> \
>> +    + _GL_SIGNED_TYPE_OR_EXPR (t))
>> +
>> + /* Bound on buffer size needed to represent an integer type or
>> expression T,
>> +@@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> +    ? (a) < (min) >> (b)                                 \
>> +    : (max) >> (b) < (a))
>> +
>> +-/* True if __builtin_add_overflow (A, B, P) works when P is null.  */
>> +-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
>> ++/* True if __builtin_add_overflow (A, B, P) works when P is non-
>> null.  */
>> ++#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__)
>> ++
>> ++/* True if __builtin_add_overflow_p (A, B, C) works.  */
>> ++#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
>> +
>> + /* The _GL*_OVERFLOW macros have the same restrictions as the
>> +    *_RANGE_OVERFLOW macros, except that they do not assume that operands
>> +    (e.g., A and B) have the same type as MIN and MAX.  Instead, they
>> assume
>> +    that the result (e.g., A + B) has that type.  */
>> +-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
>> +-# define _GL_ADD_OVERFLOW(a, b, min, max)
>> +-   __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
>> +-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
>> +-   __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
>> +-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
>> +-   __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
>> ++#if _GL_HAS_BUILTIN_OVERFLOW_P
>> ++# define _GL_ADD_OVERFLOW(a, b, min,
>> max)                               \
>> ++   __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
>> ++# define _GL_SUBTRACT_OVERFLOW(a, b, min,
>> max)                          \
>> ++   __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
>> ++# define _GL_MULTIPLY_OVERFLOW(a, b, min,
>> max)                          \
>> ++   __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
>> + #else
>> + # define _GL_ADD_OVERFLOW(a, b, min,
>> max)                                \
>> +    ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min,
>> max)                  \
>> +@@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> +   _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
>> + #define INT_SUBTRACT_OVERFLOW(a, b) \
>> +   _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
>> +-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
>> ++#if _GL_HAS_BUILTIN_OVERFLOW_P
>> + # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
>> + #else
>> + # define INT_NEGATE_OVERFLOW(a) \
>> +@@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> + #define INT_MULTIPLY_WRAPV(a, b, r) \
>> +   _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow,
>> INT_MULTIPLY_OVERFLOW)
>> +
>> +-#ifndef __has_builtin
>> +-# define __has_builtin(x) 0
>> +-#endif
>> +-
>> + /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390.  See:
>> +    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
>> +    https://llvm.org/bugs/show_bug.cgi?id=25390
>> +@@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> +    the operation.  BUILTIN is the builtin operation, and OVERFLOW the
>> +    overflow predicate.  Return 1 if the result overflows.  See above
>> +    for restrictions.  */
>> +-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
>> ++#if _GL_HAS_BUILTIN_OVERFLOW
>> + # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b,
>> r)
>> + #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
>> + # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
>> +@@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
>> + # else
>> + #  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
>> +     _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
>> +-                     long int, LONG_MIN, LONG_MAX))
>> ++                     long int, LONG_MIN, LONG_MAX)
>> + # endif
>> + #endif
>> +
>> +--
>> +1.9.1
>> +
>> diff --git a/meta/recipes-extended/libidn/libidn_1.33.bb b/meta/recipes-
>> extended/libidn/libidn_1.33.bb
>> index d3d0f557bba..109cc7f3f55 100644
>> --- a/meta/recipes-extended/libidn/libidn_1.33.bb
>> +++ b/meta/recipes-extended/libidn/libidn_1.33.bb
>> @@ -19,6 +19,7 @@ SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \
>>             file://avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.
>> patch \
>>             file://dont-depend-on-help2man.patch \
>>             file://0001-idn-fix-printf-format-security-warnings.patch \
>> +           file://gcc7-compatibility.patch \
>>  "
>>
>>  SRC_URI[md5sum] = "a9aa7e003665de9c82bd3f9fc6ccf308"
>> --
>> 2.12.2
>>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH 2/5] libtirpc: Expose key_secretkey_is_set API
  2017-04-19 16:36       ` Burton, Ross
@ 2017-04-19 16:37         ` Khem Raj
  0 siblings, 0 replies; 15+ messages in thread
From: Khem Raj @ 2017-04-19 16:37 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Wed, Apr 19, 2017 at 9:36 AM, Burton, Ross <ross.burton@intel.com> wrote:
>
> On 19 April 2017 at 17:25, Khem Raj <raj.khem@gmail.com> wrote:
>>
>> key_secret_is_set is a typo in libtirpc map file which is fixed here.
>
>
> Can you resubmit with that in the commit log.  Are you pushing these
> upstream?

Upstream already has a report and a patch for this
https://sourceforge.net/p/libtirpc/discussion/637321/thread/fd73d431/

>
> Ross


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

end of thread, other threads:[~2017-04-19 16:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-19  1:58 [PATCH 1/5] libtirpc: Backport fixes from 1.0.2rc3 Khem Raj
2017-04-19  1:58 ` [PATCH 2/5] libtirpc: Expose key_secretkey_is_set API Khem Raj
2017-04-19  8:52   ` Burton, Ross
2017-04-19 16:25     ` Khem Raj
2017-04-19 16:36       ` Burton, Ross
2017-04-19 16:37         ` Khem Raj
2017-04-19  1:58 ` [PATCH 3/5] libtirpc: Enable des APIs for musl Khem Raj
2017-04-19  8:57   ` André Draszik
2017-04-19 12:53     ` Burton, Ross
2017-04-19 16:34     ` Khem Raj
2017-04-19  1:58 ` [PATCH 4/5] rpcbind: Remove uneeded patches Khem Raj
2017-04-19  1:58 ` [PATCH 5/5] libidn: Fix build with gcc7 Khem Raj
2017-04-19 15:06   ` André Draszik
2017-04-19 16:36     ` Khem Raj
2017-04-19  2:01 ` ✗ patchtest: failure for "libtirpc: Backport fixes from ..." and 4 more Patchwork

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.