Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-03

compile Link Smart option, is it -XX or -CX?

4 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dennis Poon
to Sven Barth
Sven Barth wrote 20 lines
Am 03.03.2016 09:26 schrieb "Dennis" < >: > > 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. 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

Show quoted text 5 lines
_______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Tomas Hajny
to Dennis Poon
Dennis Poon wrote 20 lines
Sven Barth wrote: > Am 03.03.2016 09:26 schrieb "Dennis" < > >: > > > > 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

Reply by email