[fpc-pascal] Crash on Windows for Aarch64 target

Sven Barth pascaldragon at googlemail.com
Fri Jan 14 07:38:14 CET 2022


Am 12.01.2022 um 14:37 schrieb Volo Zyko via fpc-pascal:
> Hello,
>
> Some time ago it was announced an experimental support for Windows on Aarch64 (namely in this post https://lists.freepascal.org/pipermail/fpc-pascal/2020-April/057762.html). I tried to build a dll with a proprietary code for that target. Building succeeded but it crashes on loading. At the moment I don't understand how to investigate the issue to provide more information about it.
>
> Here is my setup (in case there are any obvious mistakes). I built FPC from source (using commit e091d263c84890f64ca8353fa837c4fd7eb94c37). Building on Windows was quite straightforward - make OS_TARGET=win64 CPU_TARGET=aarch64 BINUTILSPREFIX= OPT=-O- all (as it was described in the post above). There was one catch though. Since I used MSys I had to make sure that the path to existing FPC was earlier than MSys's paths, i.e. I did export PATH=/c/tools/FPC/3.2.2/bin/i386-Win32/fpc:$PATH. FPC build system doesn't understand MSys file paths which are produced by MSys make, one must use make from FPC distribution. After building I got ppcrossa64.exe which is PE32+ executable for x86-64 itself. After this I built my dll. The command line was roughly like this: /c/tools/FPC/3.3.1/bin/x86_64-win64/ppcrossa64 -O- -Twin64 -Paarch64 -Sd -CF64 -fPIC -XPaarch64-win64 -olib.dll lib.dpr.
>
> Any help in investigating the crash would be appreciated. Obviously I cannot share the proprietary code (it's not mine). However, in case there are any tests from the FPC source code that I can build and run on ARM64 I would eagerly do it.

The aarch64-win64 target isn't yet fully useable, cause it even fails to 
correctly cycle the compiler itself (and if that fails I'm not really 
confident with real world applications either). The cause wasn't yet 
directly investigated however (mainly due to time constraints).

By the way: is there a reason why you use MSys? FPC doesn't need it (nor 
expect it as you noticed with the paths).

Regards,
Sven


More information about the fpc-pascal mailing list