Subject: shared libraries and interlibrary dependencies
To: None <netbsd-help@netbsd.org>
From: Brook Milligan <brook@biology.nmsu.edu>
List: netbsd-help
Date: 11/07/2000 16:58:26
I'm having troubles with several packages or other software that uses
shared libraries and I'm not entirely sure I understand how to
construct them.  The objects are created with cc -fPIC ... .  The
library is created with cc -Bshareable -o xxx.so ... .  The problem I
have is that this results in "undefined symbol" references and the
library creation fails.  This is on an a.out (i386) system.

The questions I have are:

- is this the correct way to construct a shared library?

- how are shared libraries handled on elf versus a.out systems?

- is the fact that I need to resolve all symbols within a single
  library an a.out requirement or is that also true for elf? or is it
  a netbsd-specific requirement?

- do other systems (e.g., linux, freebsd, ...) allow a shared library
  to have unresolved symbols that can be resolved from a different
  library at runtime?

- what is the best way of resolving problems of this sort?  choices
  seem to be at least the following:  upgrade to elf (if this indeed
  will allow interlibrary dependencies), patch pkgsrc in some clever
  way to enable builds on both a.out and elf systems, submit a bug
  report to the original author.

Sorry to be so clueless about the internals of shared libraries, but I
am encountering more and more of these interlibrary dependencies and
I'm not sure if there are a bunch of systems that don't have this
problem or what.

Thanks for your help.

Cheers,
Brook