[fpc-pascal] What's in Hello World

code dz mr.cefou at gmail.com
Mon Jan 8 14:13:56 CET 2024


I remember i made a simple  win32 window app with custom tiny RTL , and
final exe size was 4.5kb  .

On Sun, Jan 7, 2024, 20:33 Michael Van Canneyt via fpc-pascal <
fpc-pascal at lists.freepascal.org> wrote:

>
>
> On Sun, 7 Jan 2024, Sven Barth via fpc-pascal wrote:
>
> >>>
> >>> - FPC compiled as is: 388976 B
> >>> - FPC compiled with full smartlinking: 55920 B
> >>> - FPC compiled with C linkage: 388760 B
> >>> - FPC compiled with full smartlinking and C linkage: 56792 B
> >>
> >> Maybe it is a good idea to add these numbers to the above WIKI page,
> >> to quantify
> >> the discussion and to illustrate what the effect is of various options.
> >
> > Probably... 🤷‍♀️
> >
> > And just for the fun of it, the size if the RTL is compiled into a
> > dynamic package and that is used:
> >
> > - no smartlinking: 15784 B
> > - with smartlinking: 15608 B
> >
> > With the librtl.so having a size of 649912 B which will ammortize itself
> > if multiple applications use dynamic packages.
>
> Nice result. Smaller than a C program :-)
>
> >
> >> I think we should also explain why linking to C has almost no effect
> >> on actual binary size.
> >
> > That's mainly because the functions that differ between FPC_USE_LIBC and
> > not are rather slim syscalls anyway, so the main bunch of Pascal code is
> > still the same in both cases.
>
> I know this, but most likely users will not realize this... :-)
>
> Michael._______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20240108/1d62ad8c/attachment.htm>


More information about the fpc-pascal mailing list