According to http://www.freepascal.org/docs-html/prog/progse30.html
the smartlink option on the command line is -CX
but in Lazarus ver 1.42,
Compilation and Linking
Linking
Link Smart is -XX
Dennis

Mailing lists / fpc-pascal / 2016-03
4 messages · 4 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
According to http://www.freepascal.org/docs-html/prog/progse30.html
the smartlink option on the command line is -CX
but in Lazarus ver 1.42,
Compilation and Linking
Linking
Link Smart is -XX
Dennis
They are different. -CX tells the compiler to compile units with smart linking capability (though I'd need to check what exactly that entails), while -XX enables smart linking.
Regards,
Sven
Would you kindly elaborate?
If -XX is not set, does that mean Smart Link is disabled and even if -CX is set, it is ignored?
Dennis
Let's imagine a program consisting of unit Unit1 and the main program ProgX. You need to add -CX when compiling Unit1 (either standalone or implicitly together with ProgX) if you want to make sure that the compiled binary representation of Unit1 allows smartlinking its code and data (i.e. only including the needed parts of its code and data in the final program using this unit). When compiling a program, -XX asks the linker to perform smartlinking for all units (including e.g. RTL units, etc.) which are compiled in a way allowing this. -XX has no effect if the units are not prepared in a way allowing smartlinking (i.e. not compiled with -CX). At the same time, -CX has no effect on the final program by itself.
Hope this helps
Tomas