These are the options as reported by Lazarus (excluding some project specific paths):
C:\FreePascal\fpc\bin\x86_64-win64\fpc.exe
-Tlinux
-Parm
-CpARMV7A
-MDelphi
-Scaghi
-CirotR
-Ch33554432
-O1
-gw2
-godwarfsets
-gl
-Xg
-gt
-vewnhibq
-Fi..\..\Binary\Linux32ARM\Debug\Units
-FuC:\FreePascal\lazarus\lcl\units\arm-linux\gtk2
-FuC:\FreePascal\lazarus\lcl\units\arm-linux
-FuC:\FreePascal\lazarus\components\lazutils\lib\arm-linux
-FuC:\FreePascal\lazarus\packager\units\arm-linux
-Fu.
-FU..\..\Binary\Linux32ARM\Debug\Units
-FE..\..\Binary\Linux32ARM\Debug
-o..\..\Binary\Linux32ARM\Debug\Project
-dLCL
-dLCLgtk2
Lazarus manages to find and open the file when I Control+Click on it, so it must be something with the compiler.
I tried to copy heapmgr.pp to my project's directory and add it to the project but when it is compiled it gives an error:
heapmgr.pp(288,38) Fatal: Syntax error, ":" expected but "identifier NAME" found
at this section:
var
initialheap : record end; external name '__fpc_initialheap';
heapsize : PtrInt; external name '__heapsize';