[PATCH] newlib: libc: define _ctype for AArch64 Cygwin
Richard Earnshaw (lists)
Richard.Earnshaw@arm.com
Mon Jun 23 15:45:19 GMT 2025
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.
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