[LLVMdev] Lightweight code loader

Reid Spencer reid at x10sys.com
Fri May 27 16:26:49 PDT 2005


Whoops, I screwed up on my advice there. The keyword to build a an
arvhive library is actually BUILD_ARCHIVE, strangely enough. PLease use 

BUILD_ARCHIVE := 1

Thanks,

Reid.

On Fri, 2005-05-27 at 16:23 -0700, Reid Spencer wrote:
> > 
> > First, I want the loader to be as tiny as possible. So, I don't want
> > to link in VMcore and friends.  Is it possible to just link in
> > selected object files instead of entire libraries?
> 
> Yes, but it will require a makefile change. Right now VMCore only builds
> a re-linked object (all object files coalesced into one bigger one).
> THat's not what you want. You want to build an archive so that the
> individual object files are linked in, and only what you need. However,
> I'm pretty certain that because of inter-dependencies you'll probably
> end up with all or most of VMCore anyways unless you're using only a few
> very specific items. To build an archive library, just add:
> 
> ARCHIVE_LIBRARY := 1
> 
> to the makefile at the top and then link with "LLVMCore.a" instead of
> just "LLVMCore".
> 
> > 
> > Second, there is functionality that the loader needs to have that
> > depends on VMCore, but doesn't actually need it for my purposes. The
> > main thing is the 'relocate' function in each (System)JITInfo.cpp
> > file. I would like to be able to get the correct JITInfo object
> > (really just the function) without having to link in extra stuff,
> > instantiate modules,targets, etc. Ideally this would not require
> > duplicating any code :) How does one go about doing this?
> 
> You'd have to break the pieces out that you need into separate
> compilation units (.cpp files), ensure there are no dependencies on the
> rest of the definitions, and then use the ARCHIVE_LIBRARY trick above to
> ensure you only load what's necessary to resolve symbols.
> 
> FYI, you might want to try out our IRC channel where people hang out
> most of the time .. might get you some answers faster and allow us to
> discuss this more effectively than by email.
> 
> Just put irc://irc.oftc.net/llvm into Mozilla if you have it.
> 
> Reid
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050527/bf24ad66/attachment.sig>


More information about the llvm-dev mailing list