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

Re: Dynamic libraries



On Sep 12, Pawel Wiecek wrote
> I have a slight problem compiling dynamic libraries. The dynamic library
> itself (the .so file) gets statically linked against libc6. This is
> definitely not what I expected (it was linked dynamically when I compiled
> it on an old 1.2.* system).

Are you sure it is really statically linked (nm --undefined-only does not show
up libc symbols), or does "ldd" say it is statically linked?

> Is there any way to force dynamic linking in this situation?

For 2.0, one of the goals is to make sure that "ldd" sees what other
libraries a librarie depends on. The way to do that is to add them to the
link line, a la
	${CC} -shared -Wl,-soname,lib${lib_name}.so.${major_shared} \
              -o ${SHARED_LIB} ${SH_OBJS} ${SHLIBLIBS}
where SHLIBLIBS is something like "-lc -lm".

See ftp://tsx-11.mit.edu/pub/linux/packages/GCC/elf.ps.gz for details.

HTH,
Ray
-- 
POPULATION EXPLOSION  Unique in human experience, an event which happened 
yesterday but which everyone swears won't happen until tomorrow.  
- The Hipcrime Vocab by Chad C. Mulligan 


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . Trouble? 
e-mail to templin@bucknell.edu .


Reply to: