[fpc-pascal] Minimal size of compiled library (DLL under Windows)

Sven Barth pascaldragon at googlemail.com
Sat Apr 3 18:23:37 CEST 2021


LacaK via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am Sa., 3.
Apr. 2021, 13:22:

> Hi,
> I did small test project for library:
> (with -CX -WR -O3 -Xs -XX options set)
>
> library library1;
> {$mode objfpc}{$H+}
> uses
>   SysUtils, Classes;
> begin
> end.
>
> Compilation produces DLL with size 200+ KB.
>
> When in uses is only SysUtils then size is under 100 KB.
> Whene there are not units in uses clause then size is under 40 K B.
>
> I am guessing, that there must be something in initialization sections of
> units (SysUtils and Classes), which cause that some code is included, right?
> Can I somehow to avoid this grow of size (for example I need from Classes
> only TFPList)?
>

Everything that is touched by initialization or finalization sections, even
if nothing else is used, will be included.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210403/f248e058/attachment.htm>


More information about the fpc-pascal mailing list