Jump to content


Monolithic libraries


2 replies to this topic

#1 Stainless

    Member

  • Members
  • PipPipPipPip
  • 582 posts
  • LocationSouthampton

Posted 09 December 2012 - 11:01 AM

I am doing a lot of games porting at the moment,

Every company I am working with has their own core library, usually with a wierd name (SexyAppFramework, GFCone...)

This contains all the base engine code with a platform specific layer at the bottom.

What's concerning me is that this huge block of code has obviously been developed over a period of years and contains stuff that was used in some past game, but isn't used in other games.

This can be huge chunks of code that I end up porting, but is never used.

Things like zlib, tinyzip, tinyxml, etc. are not too bad , but when I hit things like libcurl it becomes a massive issue.

I am worried about the amount of redundant code I am adding to my games.

On some platforms I am hitting memory problems, of course this is more to do with graphics than code, but it's still a worry.

Anybody else coming across this?

Any tricks you have come across?

#2 TheNut

    Senior Member

  • Moderators
  • 1701 posts
  • LocationCyberspace

Posted 09 December 2012 - 01:10 PM

The effort in configuring and building these libraries is one thing and cannot be avoided unless you are given enough information to know that in advance. After the fact however, if you statically build and link against all these libraries, then Visual Studio's remove unused references (linker option enabled by default on release builds) should give you a compact executable with all dead code removed. Enable whole program optimization for additional benefits. GCC can also do this, but it's a bit more involved. Use the compiler flags -ffunction-sections and -fdata-sections with the linker flag -Wl,--gc-sections and that will strip out dead code. If however you're dynamically linking all this stuff, then I don't know. I'm not sure you have much choice.
http://www.nutty.ca - Being a nut has its advantages.

#3 Stainless

    Member

  • Members
  • PipPipPipPip
  • 582 posts
  • LocationSouthampton

Posted 09 December 2012 - 02:53 PM

Our compiler is a LLVM compiler designed on top of gcc, so maybe the gcc options exist.

Certainly worth looking at.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users