[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: .so and .a libs, tcl, postgres = in over my head



On Wed, Jul 01, 1998 at 11:12:19AM -0700, David Welton wrote:
> Actually, the end result of this is a mod_dtcl (mod_tcl already
> exists, but is weird, has no license, and no official page anymore,
> and an author who seems to have dissappeared).  

Very cool!  Look at the makefile for libapache-mod-perl (or rather, a
log of the build process) for help on picking the right flags.  There's
a lot of them :)

> > The first question is whether the symbol is present.  If it is, it's a
> > scope problem; if it isn't, it's a linker problem.
> 
> I'm not real sure on how to determine that, but.. 
> @heorot [~] $ nm /usr/lib/libtcl8.0.a | grep Tcl_GetChannel
> 000006c0 T Tcl_GetChannel
> 
> The section where it is 'T' is tclIO.o.  So.. it seems like it is
> there..  

That's not the question - try the same thing on ./mytclsh.

> > You probably don't want to do that.  I can see a reason for linking
> > statically, to libtcl, but you shouldn't statically link to libraries
> > you know will be available unless absolutely necessary.
> 
> Someone told me that was the way to do what I wanted:->  I see that
> -static works, and it certainly seems cleaner...

Even so, link explicitly to /usr/lib/libtcl8.0.a and dynamically to
everything else.

> > Errors that early refer to linking problems.  In this case : -shared is
> > meant only for use in actual .so's.  I am guessying that the flag you
> > want is -rdynamic, judging from various makefiles lying around.  Try:
> > 
> > gcc -g -o mytclsh mytclsh.c -rdynamic -ltcl8.0 -lm -ldl
> 
> Well, that works (actually, it doesn't but for more mundane reasons -
> 'er' , the error message thing, is undefined.. :-) Fixing that makes
> it go.
> 
> But.. my intent is to have a mod_dtcl that I can load into apache.
> The current module links like this:
> 
> ld -Bshareable -o mod_dtcl.so mod_dtcl-so.o -static -ltcl8.0
> 
> And dies when you try and load a page with a 'load' command in it,
> presumably for the same reasons mytclsh was dying.  -rdynamic does not
> work with -Bshareable.  

Well, for the module, you need to have -shared.  And you'll be getting
a different problem.  I suspect.....are you using apache 1.3.0-4?  If
not, try it.  There are scope problems netgod and I had to tweak to get
mod_perl to be able to load modules (RTLD_GLOBAL, see the dlopen man
page).

> > It can be done.  libperl.a is statically linked in when perl is built,
> > and contains the dlopen stubs perl uses.
> 
> Hrmph...:->
> 
> So, what does one read to 'get' some of these concepts better..  The
> ideas behind static and shared libs are fairly clear, but.. now I am
> getting more curious about what makes this stuff tick..


No idea.  I asked Culus on IRC one night :)

Dan Jacobowitz


--  
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: