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@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to