did you start the build.bat ch file under dosbox or dosemu or Windows console ?
I use cmd.exe (I open this manually).
When you use exit in a batch file, the complete cmd.exe will be closed.
This is unwanted behavior.
Or use exit /b (which will only close the batch file) or use goto :eof.
NEVER use exit without parameter in a batch file. NEVER EVER !!!
For me, this automated script does all the steps that are need to create in one step
the DLL (first), and in an other step the EXE (second).
[..]
each build stage's run without fatal error's.
Yep.
This works correctly.
Maybe the %A is because of the echo to console (you don't have an echo off).
I let FPC produce assembly files, so I could better inspect the code, what
FPC created, and what my application is doing (with included debugger).
You also let fpc create the dll and exe. They work ok.
The second stage to assemble the .o files with gcc fail for me.
Probably due to my installation of msys64/gcc.
My second goal is it, to minimize the produced data, which results into a
smaller binary image.
Doesn't FPC with your custom RTL do that already?
Like I said, programmers are lazy, and as such, they programming helper tools
like the build.bat ch, and build.ps1 - a graphical script that I use/created with
Windows PowerShell - no needs to install other programmer tools (exception like
the FPC, and MSYS tools.
No, they are not. But your build.bat was a mess with hard coded paths etc.
And still now... you have fpc64.exe, fpc32.exe and all tools with xx32.exe/xx64.exe.
They are not part of a standard FPC installation.
Also... fpc64.exe isn't normally in a i386-win32 directory (unless you use the cross-compile).
So... it's not a standard installation and you need to copy lots of utililies over to the correct directory.
Even after doing so... my msys64/gcc complained about libxxx.dll files not being found.
But maybe that's a path problem too.
Anyway... the files (.exe and .dll) created by your build by FPC work correctly.
The automatic loading of dll fails with the known 0xc0005 AV
and the loadlibrary version of the same dll work correctly.
I can't test your gcc/assembler version (but if automatic loading of dll fail in the fpc version it's only logical it will also fail with the gcc version).
Edit: O, and if you look at the exact output of your build batch you should also have seen a line like this fail: ( note the , instead of . )
del %prjdir%\tests\test1,exe /F /S /Q
with
Could Not Find xxxxx\Qt_FPC\src\tests\test1
Could Not Find xxxxx\Qt_FPC\src\exe
And normally I check if a directly exists before trying to delete or create it.
if not exist extras\ md extras
if exist units\ rmdir units /S/Q
In that case you can do an echo off and only report errors when they occur (not clutter the entire cmd console so you can't see the errors occur like now).