This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++.so: undefined reference to `pthread_create'


> John David Anglin writes:
>  > The following error occured today with the cvs source for 3.4
>  > building hppa-unknown-linux-gnu:
>  > 
>  > /home/dave/gnu/gcc-3.4/objdir/gcc/g++ -shared-libgcc -B/home/dave/gnu/gcc-3.4/objdir/gcc/ -nostdinc++ -B/home/dave/opt/gnu/hppa-linux/bin/ -B/home/dave/opt/gnu/hppa-linux/lib/ -isystem /home/dave/opt/gnu/hppa-linux/include -isystem /home/dave/opt/gnu/hppa-linux/sys-include -include bits/stdc++.h -g -O2 -D_GNU_SOURCE -o abi_check abi_check.o  -L/home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src -L/home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs -lm
>  > /home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs/libstdc++.so: un defined reference to `pthread_create'
>  > /home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs/libstdc++.so: undefined reference to `pthread_getspecific'
>  > /home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs/libstdc++.so: undefined reference to `pthread_once'
>  > /home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs/libstdc++.so: undefined reference to `pthread_key_create'
>  > /home/dave/gnu/gcc-3.4/objdir/hppa-linux/libstdc++-v3/src/.libs/libstdc++.so: undefined reference to `pthread_setspecific'
>  > collect2: ld returned 1 exit status
>  > 
>  > Any ideas?
> 
> -lpthread?
> 
> Or is that implied on hp linux?

No, it's not implied.  It requires `-pthread' in the link command.  Probably
what has happened is that there has been a changed the the v3 library
which now requires abi_check to be linked against the pthread library.
The testsuite seems to add `-pthread' in the thread tests.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]