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

LacaK lacak at zoznam.sk
Wed Mar 10 10:34:50 CET 2021


my goal is DO NOT include unused procedures, methods in final 
program/library on Win32 target exe/dll.

A.) I compile my (units) program/library with -CX -XX (set in Project 

B.) I did also experiments with WPO: -OWall -FWprogram.wpo -Xs- (plus 
-Owall -Fwprogram.wpo)


1. I did not notice difference between A and B (it seems like WPO did 
not reduce size of EXE (may be that I do something wrong))
1.1 is there way how I can check which procedures were striped out or 
vice-versa included?

2. Is smart-linking/WPO capable to remove unused:
2.1  regular procedures/functions ?
2.2  methods of classes (non virtual, virtual) ?
2.3  class methods of classes ?

Thank you


More information about the fpc-pascal mailing list