On Thu, March 3, 2016 12:12, Dennis Poon wrote: > Sven Barth wrote: >> Am 03.03.2016 09:26 schrieb "Dennis" <de...@avidsoft.com.hk >> <mailto:de...@avidsoft.com.hk>>: >> > >> > 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 >> >> 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. >> >> > 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?
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 _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal