Unfortunately I tried it and this doesn't work. Problem only with 'sysinitpas.pp' unit. He is not depends on other RTL units, but linked into final executable by compiler. I suppose, compiler itself depends on internal layout of this unit. And a solution is to compile 'sysinitpas.pp' with the same options as 'ppc386.exe' was compiled, not RTL.
See my previuos demo: http://dl.free.fr/ePtkQwgJJ > When compiling RTL you should disable reading of options from fpc.cfg using the -n switch. > When compiling the system unit use the -Us switch. > Additionally specify only CPU/Target and optimization options -O. > No other options are required for Windows RTL. > > When RTL is properly compiled, even with -O2, your test program works without memory leaks. > > Yuriy Sydorov, > j...@cp-lab.com > _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel