[Scummvm-devel] Release plans, once again
Kevin Harris
gopickyournose at hotmail.com
Mon Aug 23 09:41:47 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)...
There are two relatively easy approaches to fixing this, neither of which
require export lists.
(1) Make libcommon a shared library (.dylib or .so or whatever). The main
executable and all libraries can be linked against this. Unreferenced
object removal will never be done on shared libraries.
(2) Make sure NONE of the shared libraries is linked against the common
library (IIRC there may be issues to resolve on OSX, since the linker uses
strong references instead of the usual weak-linking), and modify the way the
executable is created. You can extract all of the objects into a temporary
directory, and link them all explicitly. The linker won't perform any
unused code removal if they are all specified on the link line. Here's an
example:
# Extract all of the objects from libcommon.a into a temporary directory and
explictly link them into the executable.
mkdir .temp_common_a
cd .temp_common_a
ar x ../libcommon.a
cd ..
$(LINK) $(NORMAL_OBJECTS) .temp_common_a/*.o -o $(EXECUTABLE_NAME)
rm -rf .temp_common_a
I apologize for not having looked at the scummvm build system in over a
year, but I believe my example will show how it can be done.
Good luck.
-Kevin-
_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
More information about the Scummvm-devel
mailing list