[fpc-pascal] Smart-linking versus Whole Program Optimization
lacak at zoznam.sk
Wed Mar 10 14:33:39 CET 2021
It will be nice have this in documentation. For example in
At least explain:
- relation of -CX and -XX
- what is to be removed: non-referenced non-virtual methods, global
variables, and regular procedures/functions
- (may be some infos about behavior on various targets)
> 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
>> 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.
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal