Hi,

On Sun, 7 Jan 2024, Michael Van Canneyt via fpc-pascal wrote:

> > To underline this with some numbers (I assume you mean the
> > demo/text/hello.pp which only contains a mere "Writeln('Hello World')"
> > and no additional units; all tests on x86_64-linux with 3.3.1):
> >
> > - 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.
>
> I think we should also explain why linking to C has almost no effect on
> actual binary size.

Note that the numbers above don't include stripping, so it's full with
symbols. I get the same numbers with unstriped binares. If I add striping
(-Xs), the Hello, World! FPC with smartlinking binary is 35056 bytes.
(Current FPC Git main, on Debian 12, x86_64) Other binary sizes change by
roughly the same percentage.

Also note that on most platforms, smartlinking is a lot faster and less
invasive than it used to be, and it doesn't need additional .a files,
thanks to section smartlinking and the section garbage collection feature
of modern linkers. Not sure if some documentation needs to be updated for
that, but while we're at it... :)

Charlie
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to