Subject: libpthread.so.1.60 on NetBSD 1.3.3
To: None <port-mac68k@netbsd.org>
From: Roger Brown <rogerhb@xtra.co.nz>
List: port-mac68k
Date: 09/04/1999 16:34:36
With various help, thanks Andy and Michael, I have got the pthreads library
working on mac68k NetBSD 1.3.3
(Mac IIcx, 8meg ram, 540 HD, Sonic ethernet)

The main problems I encountered were...

syssuspend() and sigprocmask() were duplicated, so I removed the definitions
from 'syscall.S'.

I could not get machdep.c to compile due to a problem with
'machdep_sys_lseek', basically the
redefining of the off_t __syscall(), so I split this into two files, putting
machdep_sys_lseek()
in it's own source file and compiled it separately. 

As commented earlier, the building of the shared library requires, in my
case, now...

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

So far, standard C applications and shared libraries work well, but some C++
applications bomb or hang on exit. 
I'm sure a C++ compiler adds alot of code for constructing and destructing
static objects, and also I don't know
how they deal with unwinding exceptions, they can't really use static
setjmp/longjmp style variables, would the C++ compiler have to know about
pthread_setspecific? Or are C++ exceptions and pthreads a big no-no?

However, these same C++ applications work on i386 linux 2.0.30 with the same
pthreads library. This may be down to the version of the GNU C++ compiler or
the operating system loader.

What exactly is the role of '/usr/lib/c++rt0.o' does this handle the process
prolog *and* epilog?

NetBSD 1.3.3, g++ -v --> 'gcc version 2.7.2.2+myc2'
Linux 2.0.30, g++ -v --> 'gcc version 2.7.2.3'

So not all that much difference there....?
 
Regards

Roger