Re: [fpc-devel] Memory leak on BeginThread() when RTL compiled with -O2

2021-05-24 Thread Jonas Maebe via fpc-devel
On 24/05/2021 12:18, Yuriy Sydorov via fpc-devel wrote: > You can't first pass the -Mdelphi switch and then override it with > -Mfpc. -Mdelphi implicitly enables lot of other compiler options which > are not reverted by -Mfpc. That feels like a bug. Jonas

[fpc-devel] Memory leak on BeginThread() when RTL compiled with -O2

2021-05-24 Thread NetSpirit via fpc-devel
> Hello, > > You have not read closely what I wrote before: Sorry, earlier I try your hint - and result was bad. Perhaps I did something wrong. But I repeat it now - and it is working. Thank you again. Finally my working build script look like this: set UNITS_PATH=.\packages\* set UNITS_PATH=.\

Re: [fpc-devel] Memory leak on BeginThread() when RTL compiled with -O2

2021-05-24 Thread Yuriy Sydorov via fpc-devel
Hello, You have not read closely what I wrote before: "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 fo

[fpc-devel] Memory leak on BeginThread() when RTL compiled with -O2

2021-05-24 Thread NetSpirit via fpc-devel
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