[Lazarus] UTF8LengthFast returning incorrect results on AARCH64 (MacOS)
Marc Weustink
marc at dommelstein.nl
Tue Dec 28 18:11:41 CET 2021
On 27-12-2021 22:10, Noel Duffy via lazarus wrote:
> On 28/12/21 01:47, Juha Manninen via lazarus wrote:
>> On Mon, Dec 27, 2021 at 1:44 AM Noel Duffy via lazarus <
>> lazarus at lists.lazarus-ide.org> wrote:
>>
>>> I need some help getting to the root of a problem with incorrect results
>>> on Apple hardware (M1, aarch64) for the function UTF8LengthFast in
>>> lazutf8.
>>>
>>> On MacOS, when given a string containing one or more UTF8 characters,
>>> UTF8LengthFast returns wildly incorrect results. On Fedora, the function
>>> returns the correct answer.
>>>
>>
>> You mean both MacOS and Fedora run on the same aarch64 CPU?
>
> Oh no, Fedora runs on an Intel x86_64. I don't think there's a Fedora
> that runs on aarch64. I included the results from Fedora just to show
> that the code does work in some places.
I've tried on pine64 aarch64 linux little-endian fpc 3.2.0 and it showed
the correct results using your example code in another mail
Marc
>
>> It must be a Big endian / Little endian issue. IIRC it can be adjusted in
>> ARM CPUs.
>> Why do MacOS and Linux use a different setting there? I have no idea.
>
> Well, as Florian said above, the M1 is little-endian. So it doesn't
> appear to be an endian issue.
>
> https://developer.apple.com/documentation/apple-silicon/porting-your-macos-apps-to-apple-silicon
>
>
>
More information about the lazarus
mailing list