views:

198

answers:

2

I requested a feature on Delphi's UserVoice, but I didn't understand Nick Hodges's answer.

  1. What version of Delphi supports smart linking?
  2. How do I enable this option?
+6  A: 

They all do. This is always enabled.

500 - Internal Server Error
+12  A: 

You seem to be worrying about SysUtils specifically. Here's what's going on:

Smart Linking will "smartlink out" everything that it can prove that the app never uses. Unfortunately, the criteria for proof are very high. If you use a unit and it has anything in the initialization section, any code used there is guaranteed to execute, so it will be dragged into your app, along with any classes used there, plus any classes that those classes use, etc...

In the case of SysUtils, that means the full exception handling package. You can't get rid of it without removing SysUtils from your app completely. Allen Bauer mentioned that they might use a new trick in a future release to reduce this, but for now you're stuck with it.

Mason Wheeler
If interested in this stuff, have a look at FPC 2.5.1's devirtualization/WPO.
Marco van de Voort
@Marco: Interesting stuff! Thanks for pointing it out
Mason Wheeler