This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC-3.0.4 (pre) on AIX requires pthreads
- From: "Michael Veksler" <VEKSLER at il dot ibm dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 20 Feb 2002 10:51:53 +0200
- Subject: GCC-3.0.4 (pre) on AIX requires pthreads
For some reason, on AIX 4.3.3, g++ requires -lpthreads while linking
executables. Is there a way to fix g++ installation/compilation procedures
to eliminate the need for -lpthreads?
I did not try ../gcc/configure --without-multilib (it will probably "fix"
it).
$ g++ -v
Reading specs from
/afs/haifa/proj7/gec/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0.4/specs
Configured with: ../gcc/configure --enable-languages=c++
--prefix=/afs/haifa/proj7/gec/gnu
Thread model: single
gcc version 3.0.4 20020215 (prerelease)
$ g++ t.cc # adding "-lpthreads", or even "-pthreads" removes this
error:
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
collect2: ld returned 8 exit status
$ cat t.cc
#include <iostream>
int main()
{
std::cout << "hello\n";
return 0;
}
-----------------
Running "g++ -Wl,-bnoquiet t.cc" shows (among other things):
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
.pthread_mutex_lock [94] ER PR t.cc(/tmp/ccqyGeya.o)
000047fc .text R_RBR [296] <.
__gthread_mutex_lock(pthread_mutex_t*) >
This suggests that these symbols are required by the generated object file.
Something is wrong with the cc1plus executable.