Subject: Re: Shared library troubles
To: Alex Zepeda <garbanzo@hooked.net>
From: Andy Finnell <andyf@vei.net>
List: port-mac68k
Date: 07/06/1999 18:01:45
Alex Zepeda wrote:
> 
> On Tue, 6 Jul 1999, Andy Finnell wrote:
> 
> > I've solved one of the problems. :-)  It turns out the warning ld.so was
> > giving me and the following seg-fault are unrelated.  After reading the
> > man files (when all else fails...) I discovered that /usr/lib/c++rt0.o
> > should be passed in to ld when the libpthread.so.1.60 is being built.
> > By simply adding c++rt0.o to the arguments, the seg-fault goes away. :-)
> 
> Uhm, how are you creating your shared libraries?  I know with Linux, and
> FreeBSD/elf, you just need to use cc -shared -o libfoo.so foo.o bar.o (or
> c++ if it's a C++ shared library).

ahh... but NetBSD/mac68k uses a.out, not elf.  That's why c++rt0.o has
to passed into ld (according to the man pages anyway).  Here's the
command to create libpthread.so.1.60 correctly:

ld -x -shared -o libpthread.so.1.60 --whole-archive libpthread_pic.a
/usr/lib/c++rt0.o --no-whole-archive

> >  Now if I can figure out how to make the warning go away...
> 
> The warning that you're getting indicates that the library was built with
> structure/class foo with size bar, but the program expects size baz.
> 
> Do you have duplicate sets of headers installed?

So its a class or a structure?  I was think along the lines of a
function...  I didn't think to check the headers, but I don't think so. 
I'll check.

Thanks for the help,

	-andy