Thank you, Ian. I figured that it was built in to libgcc, and it looks like my figuring was right: # strings /usr/lib/libgcc.a | grep pthread pthread_create pthread_getspecific pthread_once pthread_key_create pthread_setspecific pthread_create pthread_mutex_unlock pthread_mutex_lock but I couldn't get these symbols with -lgcc So I'm trying configure with the --disable-shared argument. I don't really need to link against dynamic libsmb libraries. I'm just looking for the net and smbd bins. and look: it worked: root@bsd0:/usr/src/samba3/samba-3.5.21/source3# du -hs /usr/local/samba3/ 242M /usr/local/samba3/ root@bsd0:/usr/src/samba3/samba-3.5.21/source3# smbd -V Version 3.5.21 root@bsd0:/usr/src/samba3/samba-3.5.21/source3# which net /usr/local/samba3/bin/net root@bsd0:/usr/src/samba3/samba-3.5.21/source3# uname -a FreeBSD bsd0.colliertech.org 4.11-RELEASE FreeBSD 4.11-RELEASE #0: Fri Jan 21 17:21:22 GMT 2005 root@xxxxxxxxxxxxxxxxxxxxxxx:/usr/obj/usr/src/sys/GENERIC i386 On Fri, 2013-03-22 at 17:46 -0700, Ian Lance Taylor wrote: > On Fri, Mar 22, 2013 at 5:25 PM, C.J. Adams-Collier KF7BMP > <cjac@xxxxxxxxxxxxxxx> wrote: > > > > -L/usr/local/samba3/lib -L/usr/local/samba3/BerkeleyDB.4.4/lib -L/usr/local/samba3/lib -L/usr/local/samba3/lib -L/usr/local/samba3/BerkeleyDB.4.4/lib -L/usr/local/samba3/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lldap -llber -pthread \ > > -Wl,-soname,`basename bin/libsmbclient.so.0` > > libsmb/libsmb_thread_posix.o: In function `smb_create_mutex_pthread': > > libsmb/libsmb_thread_posix.o(.text+0x2e): undefined reference to `pthread_mutex_init' > > It appears that the thread library is not being linked in. I note > that the command line says -pthread but does not list any libraries. > In current GCC using -pthread in the link command does some slightly > complex library choosing on FreeBSD. So, hypothesis: -pthread does > not work correctly in the extremely ancient GCC 2.95.3 you are using. > > Unfortunately by my reading of the current GCC code I don't understand > how -pthread is supposed to work when using FreeBSD before version 5. > Normally using -pthread adds a thread library, but on FreeBSD before > version 5 this only happens when not using -shared. I'm not sure what > is supposed to happen with -shared, as in your case. > > I suggest figuring out how to write a shared library that uses thread > on your ancient platform, and then do that rather than assuming that > -pthread does the right thing. > > Ian
Attachment:
signature.asc
Description: This is a digitally signed message part