Sign in Join

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

Mailing lists / fpc-devel / 2008-01

Interfaces vs. smartlink issue

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Sergei Gorelkin

Hello,

I noticed that, within a unit, all interface wrappers (groups of 'WRPR_*' symbols) are placed into one "assembler unit" together with unit initialization/finalization code (sorry, do not know the exact term for "assember unit").
As a consequence, init/final code pulls in *all* interface wrappers, which in turn pull in every class that implement an interface. That effectively disrupts smartlinking of the unit.
Does this happen on purpose? Perhaps each interface wrapper should be placed into its own "assembler unit"?

Sergei

Reply by email

Peter Vreman
Show quoted text 11 lines
Hello, I noticed that, within a unit, all interface wrappers (groups of 'WRPR_*' symbols) are placed into one "assembler unit" together with unit initialization/finalization code (sorry, do not know the exact term for "assember unit"). As a consequence, init/final code pulls in *all* interface wrappers, which in turn pull in every class that implement an interface. That effectively disrupts smartlinking of the unit. Does this happen on purpose? Perhaps each interface wrapper should be placed into its own "assembler unit"?

It is legacy.

You can improve it to put the wrappers for one interface definition in its own section.

Peter

Reply by email

Sergei Gorelkin
to Peter Vreman
Peter Vreman wrote
It is legacy. You can improve it to put the wrappers for one interface definition in its own section.

Looks like a one-line fix (see the attached patch).

By the way, while testing it in Windows, I could not make the compiler do the smartlink with external linker. I compiled with -CX -XX -Xe switches, but compiler did not generate libp*.a files, so ld linked everything non-smart. Something got lost along the way?

Internal Windows linker works as desired even without the patch, although.

Sergei

Reply by email