[Scummvm-devel] Release plans, once again

Max Horn max at quendi.de
Sun Aug 22 15:51:09 CEST 2004


Am 22.08.2004 um 21:49 schrieb Marcus Comstedt:

>
> Ok Max, here's a tricky dynamic plugin question for you:
>
> The "scumm" plugin depends on "Common::ReadStream::readUint32LE()".
> This function is defined in libcommon.a.  But the scumm plugin is not
> linked against libcommon.a?!  The main scummvm binary is linked
> against libcommon.a, but since it doesn't use any ReadStream functions
> itself, the relevant object file doesn't get included.

You mean it gets stripped out of the binary? Well, at least OSX 
normally doesn't do dead code removal (they only added that recently, I 
believe, and you have to do some special things to get it)...

One way would be to add a list of symbols which should explicitly be 
exported. Most linkers support such a thing, I think; I only didn't do 
it so far because on the current supported systems (Linux, OSX) it 
wasn't necessary, and obviously it's quite tricky to keep such a list 
up-to-date, given how fast ScummVM tends to change. Though such an 
explicit export list also would have clear merits, as it would make it 
clear which symbols are exported and which not.

If this was pure C, I'd say try adding an "extern" keyword... but I am 
not sure how that will do in C++ code and with loadable modules 
<shrug>. Oh and on windows, they have this __declspec(dllexport) 
thingy...

Finally, if none of the above works, you could of course create "fake" 
references to that class/method; i.e. add an extern function which 
creates a ReadStream and calls readUint32LE on it... ugly but should 
work.


> How do you solve this on Unix (should be same problem there)?
>
Actually, it links just fine, at least on OSX (anybody tried on Linux 
recently) ? However, the plugin version doesn't work for me right now 
anyway -- the launcher works, but running a game fails. I haven't yet 
investigated this, though -- last time it occured for me it was due to 
a compiler bug <sigh>. Might be that there are problems with global 
objects (and singletons) might cause me problems.


Bye,

Max





More information about the Scummvm-devel mailing list