gcc (linker) 2.95.4 / pthreads / samba-3.5.21 / i386-unknown-freebsd4.11
Ian Lance Taylor
iant@google.com
Sat Mar 23 00:47:00 GMT 2013
On Fri, Mar 22, 2013 at 5:25 PM, C.J. Adams-Collier KF7BMP
<cjac@colliertech.org> 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
More information about the Gcc-help
mailing list