Sablevm shared libraries question

Brandon Heller <[email protected]> Thu, 4 Aug 2005 18:14:21 -0500
Newsgroups gmane.comp.java.vm.sablevm.devel
Message-ID <[email protected]>
Hi,
I'm trying to get gprof working properly with SableVM, so that I can
profile the time spent in different VM functions.  SableVM appears to
compile properly with gprof, and in fact I can see the time spent in
all functions except for those in the "libsablevm" directory.  All
calls from sablevm.c to functions in libsablevm are shown as calls to
data_start, for which no extra info is defined.  I have verified in
the makefile that the lines that compile libsablevm have the correct
compiler flags for gprof, -pg and -g.

The problem seems related to sablevm's use of libtool and libltdl to
create shared libraries, which seems to interfere with gprof's ability
to instrument the binary file.  According to the GCC manual, the
compiler option -fPIC "Generates position-independent code (PIC)
suitable for use in a shared library... Such code accesses all
constant addresses through a global offset table (GOT). The dynamic
loader resolves the GOT entries when the program starts (the dynamic
loader is not part of GCC; it is part of the operating system)."  It
seems logical then that I would have this problem.

I found some related information in the August 04 sablevm-dev list on
using "./ configure enable-shared=no --enable-static-yes" but it
wasn't clear that that had worked.

What changes would are necessary to compile SableVM with static libraries?  

Also, I could find no documentation on how shared libraries are used
in SVM.  If someone could reply with a bit of info on that, for the
sake of better docs, I'd really appreciate it.  My next step will be
to try VTune, but I expect the same issue to happen.  What tools do
you guys use to profile/tune SVM?

Thanks!
-Brandon Heller