[fpc-pascal] Smart Link definition ?

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Oct 11 08:53:05 CEST 2016


LacaK wrote:

> What is difference between "Link smart (-XX)" and "Smart linkable (-XC)" ?
> -XC is by default off and corresponds to per unit {$SMARTLINK OFF/ON} ?

-CX (not -XC) means "generate code that can be smart linked by the
linker if you specify -XX while compiling a program that uses this unit".

> Does it means, that compiler/linker is trying "Link smart", but only
> units marked "Smart linkable" ?

Yes.

> Which means, that when I use in my program StrUtils or SysUtils and I
> use only one function from these unit, in my program executable will be
> all function presented in these units ?

The top-level FPC makefile builds all units smart-linkable if the target
OS is one of "win32 go32v2 linux freebsd netbsd openbsd netware netwlibc
darwin". I guess win64 should be added to that list (once someone
verifies this doesn't cause test suite regressions).


Jonas



More information about the fpc-pascal mailing list