[Lazarus] FPC on Rpi3 executable module sizes

Florian Klämpfl florian at freepascal.org
Tue Nov 1 10:40:17 CET 2016


Am 30.10.2016 um 18:32 schrieb Ken Kashmarek via Lazarus:
> 
> This is clearly an error where each addition adds 200k (or more) the the
> executable file.  

Those units contain initialization sections which drag in a lot of code. You might want to try to
strip explicitly unused symbols by compiling with -Xs.

> I do note however, that all 3 uses entries on Windows 7,
> brings the executable up to more than 240K (significantly smaller than the
> RPi3 install of FCP produces).  
> 

I guess the reason is that you are using the variants unit. On windows, most of the variants stuff
can be handled by the OS. On unix style systems, everything is handled by FPC libraries which
emulate how windows handles variants.

> uses	sysutils; // , variants, classes;
> type	ptr2Byte = ^Byte;
> 	comp     = int64;
> var	i,j:	integer;
> 
> begin
>   writeln;
>   i := 4096;
>   writeln('Value of i = ',i:8);
>   writeln('--> Execution of (nearly) null program ended.');
>   writeln;
> end.



More information about the Lazarus mailing list