[fpc-pascal] Smart-linking versus Whole Program Optimization

Jonas Maebe jonas at freepascal.org
Wed Mar 10 13:29:12 CET 2021

On 10/03/2021 13:17, Yuriy Sydorov via fpc-pascal wrote:
> On 10.03.2021 11:34, LacaK via fpc-pascal wrote:
>> A.) I compile my (units) program/library with -CX -XX (set in Project
>> Options)
> Just a small note:
> -CX -XX are not needed for the top-tier targets nowadays. The section
> based smart linking is a default option in recent FPC versions.

At least -XX is still necessary, otherwise we don't enable dead
code/data stripping in the linker (at least not on Linux). And on macOS,
-CX is also needed, otherwise the compiler does not emit a directive in
the object files that dead code/data stripping should be enabled based
on whether or not there are references to the global symbols preceding them.

Neither parameter may be necessary on Windows, but that's probably the
only one.


More information about the fpc-pascal mailing list