Skip to contentSkip to conversation

package/uclibc: fix ctype.h is*_l definitions

PATCH New Max Filippov 4 participants 6 messages Feb 7, 2020 – Mar 10, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/uclibc: fix ctype.h is*_l 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.

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

---
 ...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
package/uclibc/0001-include-ctype.h-drop-is-_l-macro-definitions.patch new file +72 -0
new file mode 100644
index 000000000000..5557a9c1e730
@@ -0,0 +1,72 @@
+From d1a3ca7ca56630fddde7311a0474eed4a21335a7 Mon Sep 17 00:00:00 2001
+From: Max Filippov <[email protected]>
+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 <[email protected]>
+---
+ 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
+
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/uclibc: fix ctype.h is*_l definitions

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Max" == Max Filippov <[email protected]> writes:

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.

Quoted 6 lines

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

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 package/uclibc: fix ctype.h is*_l definitions

Max, All,

On 2020-02-08 09:32 +0100, Peter Korsgaard spake thusly:

Quoted 7 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Max" == Max Filippov <[email protected]> writes:

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.

Quoted 8 lines
Quoted 6 lines

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

Committed, thanks.

uClibc now fails to build:

    http://autobuild.buildroot.org/results/124/124e8ad32e1dbaf131749456f4b59333623cd91f/build-end.log

    home/test/autobuild/run/instance-3/output-1/host/lib/gcc/xtensa-build
    root-linux-uclibc/8.3.0/../../../../xtensa-buildroot-linux-uclibc/bin
    /ld: libc/libc_so.a(isalnum_l.os):(.text+0x0): undefined reference to
    `__isctype_l'

Care to have a look, please?

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 package/uclibc: fix ctype.h is*_l definitions

Hi Yann, Max, All,

Le 09/02/2020 ? 17:38, Yann E. MORIN a ?crit?:

Quoted 20 lines

Max, All,

On 2020-02-08 09:32 +0100, Peter Korsgaard spake thusly:

Quoted 7 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Max" == Max Filippov <[email protected]> writes:

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.

Quoted 8 lines
Quoted 6 lines

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

Committed, thanks.

uClibc now fails to build:

Quoted 8 lines
    http://autobuild.buildroot.org/results/124/124e8ad32e1dbaf131749456f4b59333623cd91f/build-end.log

    home/test/autobuild/run/instance-3/output-1/host/lib/gcc/xtensa-build
    root-linux-uclibc/8.3.0/../../../../xtensa-buildroot-linux-uclibc/bin
    /ld: libc/libc_so.a(isalnum_l.os):(.text+0x0): undefined reference to
    `__isctype_l'

Care to have a look, please?

There are new issues on other target related to this change:

(host-gcc-final for arm)

http://autobuild.buildroot.net/results/36f/36ff953212b49875ef47f17f8e2fa817199391b0//host-gcc-final-8.3.0/build/arm-buildroot-linux-uclibcgnueabi/libatomic/config.log

host-gcc-final for arc)

http://autobuild.buildroot.net/results/8ce/8ce70ba8a7a7c767ad51becccfb4ab15f35d1c31//host-gcc-final-arc-2019.09-release/build/arc-buildroot-linux-uclibc/libatomic/config.log

arc-buildroot-linux-uclibc/bin/ld: sysroot/usr/lib/libc.a(isspace_l.os): in function `__isspace_l':
isspace_l.c:(.text+0xc): undefined reference to __isctype_l' arc-buildroot-linux-uclibc/bin/ld: isspace_l.c:(.text+0xc): undefined reference to __isctype_l'
arc-buildroot-linux-uclibc/bin/ld: GOT and PLT relocations cannot be fixed with a non dynamic linker
arc-buildroot-linux-uclibc/bin/ld: final link failed: bad value

Best regards,
Romain

Quoted 4 lines

Regards,
Yann E. MORIN.

#4 lore raw

PATCH 1/1 package/uclibc: fix ctype.h is*_l definitions

In reply to Yann E. MORIN
Quoted 18 lines · Yann E. MORIN

On 2020-02-08 09:32 +0100, Peter Korsgaard spake thusly:

Quoted 7 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Max" == Max Filippov <[email protected]> writes:

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.

Quoted 8 lines
Quoted 6 lines

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

Committed, thanks.

uClibc now fails to build:

Quoted 8 lines
    http://autobuild.buildroot.org/results/124/124e8ad32e1dbaf131749456f4b59333623cd91f/build-end.log

    home/test/autobuild/run/instance-3/output-1/host/lib/gcc/xtensa-build
    root-linux-uclibc/8.3.0/../../../../xtensa-buildroot-linux-uclibc/bin
    /ld: libc/libc_so.a(isalnum_l.os):(.text+0x0): undefined reference to
    `__isctype_l'

Care to have a look, please?

Looking at it, sorry.

Signature · 2 lines
Thanks.
-- Max
#5 lore raw

PATCH 1/1 package/uclibc: fix ctype.h is*_l definitions

In reply to Max Filippov
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Max" == Max Filippov <[email protected]> writes:

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.

Quoted 6 lines

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

Committed to 2019.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard