Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/uclibc: fix ctype.h is*_l definitions
Date: Fri,  7 Feb 2020 11:51:44 -0800	[thread overview]
Message-ID: <20200207195144.4060-1-jcmvbkbc@gmail.com> (raw)

ctype locale-specific macro definitions are broken because they result
in dereference of pointer to structure of incomplete type.
Drop these macros since they are optional and let applications use
functions with the same names.

Backported from:
  https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=d1a3ca7ca56630fddde7311a0474eed4a21335a7
Fixes:
  http://autobuild.buildroot.net/results/b7ba1210d5aa184b133f0171da621d2b0083ec39

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 ...ctype.h-drop-is-_l-macro-definitions.patch | 72 +++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 package/uclibc/0001-include-ctype.h-drop-is-_l-macro-definitions.patch

diff --git a/package/uclibc/0001-include-ctype.h-drop-is-_l-macro-definitions.patch b/package/uclibc/0001-include-ctype.h-drop-is-_l-macro-definitions.patch
new file mode 100644
index 000000000000..5557a9c1e730
--- /dev/null
+++ b/package/uclibc/0001-include-ctype.h-drop-is-_l-macro-definitions.patch
@@ -0,0 +1,72 @@
+From d1a3ca7ca56630fddde7311a0474eed4a21335a7 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Mon, 3 Feb 2020 13:57:32 -0800
+Subject: [PATCH] include/ctype.h: drop is*_l macro definitions
+
+ctype locale-specific macro definitions are broken because they result
+in dereference of pointer to structure of incomplete type.
+Drop these macros since they are optional and let applications use
+functions with the same names.
+
+This change fixes parted-3.3 build with uClibc-ng:
+  http://autobuild.buildroot.net/results/b7ba1210d5aa184b133f0171da621d2b0083ec39/build-end.log
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ include/ctype.h | 33 ---------------------------------
+ 1 file changed, 33 deletions(-)
+
+diff --git a/include/ctype.h b/include/ctype.h
+index ecd5e730886a..e934cf3321a6 100644
+--- a/include/ctype.h
++++ b/include/ctype.h
+@@ -350,46 +350,13 @@ libc_hidden_proto(tolower_l)
+ /* Return the uppercase version of C.  */
+ extern int toupper_l (int __c, __locale_t __l) __THROW;
+ 
+-# if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus
+-#  define tolower_l(c, locale) __tobody(c, tolower_l, (locale)->__ctype_tolower, (c, locale))
+-#  define toupper_l(c, locale) __tobody(c, toupper_l, (locale)->__ctype_toupper, (c, locale))
+-# endif	/* Optimizing gcc */
+-
+-
+-# define __isctype_l(c, type, locale) ((locale)->__ctype_b[(int) (c)] & (__ctype_mask_t) type)
+ # ifndef __NO_CTYPE
+-#  define __isalnum_l(c,l)	__isctype_l((c), _ISalnum, (l))
+-#  define __isalpha_l(c,l)	__isctype_l((c), _ISalpha, (l))
+-#  define __iscntrl_l(c,l)	__isctype_l((c), _IScntrl, (l))
+-#  define __isdigit_l(c,l)	__isctype_l((c), _ISdigit, (l))
+-#  define __islower_l(c,l)	__isctype_l((c), _ISlower, (l))
+-#  define __isgraph_l(c,l)	__isctype_l((c), _ISgraph, (l))
+-#  define __isprint_l(c,l)	__isctype_l((c), _ISprint, (l))
+-#  define __ispunct_l(c,l)	__isctype_l((c), _ISpunct, (l))
+-#  define __isspace_l(c,l)	__isctype_l((c), _ISspace, (l))
+-#  define __isupper_l(c,l)	__isctype_l((c), _ISupper, (l))
+-#  define __isxdigit_l(c,l)	__isctype_l((c), _ISxdigit, (l))
+-#  define __isblank_l(c,l)	__isctype_l((c), _ISblank, (l))
+-
+ #  if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \
+ 	&& defined __UCLIBC_SUSV4_LEGACY__
+ #   define __isascii_l(c,l)	((l), __isascii (c))
+ #   define __toascii_l(c,l)	((l), __toascii (c))
+ #  endif
+ 
+-#  define isalnum_l(c,l)	__isalnum_l ((c), (l))
+-#  define isalpha_l(c,l)	__isalpha_l ((c), (l))
+-#  define iscntrl_l(c,l)	__iscntrl_l ((c), (l))
+-#  define isdigit_l(c,l)	__isdigit_l ((c), (l))
+-#  define islower_l(c,l)	__islower_l ((c), (l))
+-#  define isgraph_l(c,l)	__isgraph_l ((c), (l))
+-#  define isprint_l(c,l)	__isprint_l ((c), (l))
+-#  define ispunct_l(c,l)	__ispunct_l ((c), (l))
+-#  define isspace_l(c,l)	__isspace_l ((c), (l))
+-#  define isupper_l(c,l)	__isupper_l ((c), (l))
+-#  define isxdigit_l(c,l)	__isxdigit_l ((c), (l))
+-#  define isblank_l(c,l)	__isblank_l ((c), (l))
+-
+ #  if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \
+ 	&& defined __UCLIBC_SUSV4_LEGACY__
+ #   define isascii_l(c,l)	__isascii_l ((c), (l))
+-- 
+2.20.1
+
-- 
2.20.1

             reply	other threads:[~2020-02-07 19:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 19:51 Max Filippov [this message]
2020-02-08  8:32 ` [Buildroot] [PATCH] package/uclibc: fix ctype.h is*_l definitions Peter Korsgaard
2020-02-09 16:38   ` Yann E. MORIN
2020-02-09 19:01     ` Romain Naour
2020-02-09 19:21     ` Max Filippov
2020-03-10 22:19 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200207195144.4060-1-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox