[PATCH] newlib: libc: define _ctype for AArch64 Cygwin
Corinna Vinschen
vinschen@redhat.com
Tue Jun 24 08:13:06 GMT 2025
On Jun 23 16:45, Richard Earnshaw (lists) wrote:
> On 17/06/2025 15:59, Corinna Vinschen wrote:
> > Hi Radek,
> >
> > On Jun 12 07:46, Radek Barton wrote:
> >> Hello.
> >>
> >> This change defines `_ctype_` symbol used in Cygwin for AArch64 the same way as for x86_64.
> >
> > Thanks for the patch, looks good, but I'm wondering...
> >
> > The #else branch is for compatibility with 32 bit x86, which we don't
> > support anymore, so it could have long gone. Shouldn't we just drop
> > the condition and the #else branch entirely? It would clean up this
> > code snippet nicely.
> >
>
> Or perhaps there should just be a __CYGWIN32 def that's tested for
> code like this. It certainly feels 'sub-optimal' to be testing
> specific cpu types.
This is cpu-specific, given the leading underscore difference between 32
and 64 bit x86. We don't define __CYGWIN32 anymore for ages. There's
only a __CYGWIN__ and the CPU types to choose from.
This is just moot, because we don't support 32 bit x86 anymore, and the
behaviour for each other CPU is identical.
Corinna
>
> R.
>
> > What do you think? Do you want to provide the change, perhaps?
> >
> >
> > Thanks,
> > Corinna
> >
> >
> >> Radek
> >>
> >> ---
> >> >From 7532c751266a766cb3e289ebd7afb2d2c3d1ff3d Mon Sep 17 00:00:00 2001
> >> From: =?UTF-8?q?Radek=20Barto=C5=88?= <radek.barton@microsoft.com>
> >> Date: Fri, 6 Jun 2025 16:17:27 +0200
> >> Subject: [PATCH] newlib: libc: define _ctype for AArch64 Cygwin
> >>
> >> ---
> >> newlib/libc/ctype/ctype_.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/newlib/libc/ctype/ctype_.c b/newlib/libc/ctype/ctype_.c
> >> index 32ce4f318..bf403d761 100644
> >> --- a/newlib/libc/ctype/ctype_.c
> >> +++ b/newlib/libc/ctype/ctype_.c
> >> @@ -95,7 +95,7 @@ char _ctype_b[128 + 256] = {
> >> /* For backward compatibility */
> >> char __EXPORT *__ctype_ptr__ = DEFAULT_CTYPE_PTR;
> >>
> >> -# ifdef __x86_64__
> >> +# if defined(__x86_64__) || defined(__aarch64__)
> >> __asm__ (" \n\
> >> .data \n\
> >> .globl _ctype_ \n\
> >> --
> >> 2.49.0.vfs.0.3
> >>
> >>
> >>
> >
> >
More information about the Newlib
mailing list