[comp.unix.internals] Debugging library incompatibilty

songer@orchestra.ecn.purdue.edu (Christopher M Songer) (01/10/91)

Hi,
     Here is my problem (one of them anyway :) I have a library required
to interface with a graphics processor. The library is compiled for SUN3 
architecture.  I do not have access to the source. There is no maintanence 
agreement.  All I have is the library binary. It has not been stripped.
     A change was made to libc. (Involving the nameserver -- I did not
make the change.) All other programs have worked fine with the change.
How do I find the problem and (hopefully) fix it. I've used nm and gotten
a list of the system calls the library uses. What should I do now? How hard
is it to make a version of libc (without having root) with the -g option
on? Since libc is HUGE and spread out over so many files, if I have to
get the individual routines and compile them separately, is there an index
to what files are where in the tree? 
     I'm new to this particular sort of problem, so suggestions are more
than welcome. Thanks!

Chris		/* I work for and go to Purdue -- I don't speak for it */

dichter@soleil.sps.mot.com (Carl Dichter) (01/11/91)

Are there only a few library functions you wish to "fix"?

If so, consider making a separate library to replace those functions.

By have the cc command search your replacement library 
you can pick up your version of the functions instead. You shouldn't
need a new header file because you are writing drop-in replacements.

To use your own libraries: 
	Use the "-L(directory)" of "cc" to tell it the directory your 
	library is in

	Use the "-l(suffix)" to tell it the suffix of your library name.

	For example, if you build a library "libc_new.a" in "/usr/local/lib",
	your "cc" might look like this:

		cc myprog.c -o myprog -L/usr/local/lib -lc_new

Have fun.


Carl R. Dichter 
Staff Software Engineer/Scientist
Email: dichter@soleil.sps.mot.com