Bug 13330 - [3.4 Regression] Bootstrap failure while linking libstdc++.so: undefined reference to phtread symbols
Summary: [3.4 Regression] Bootstrap failure while linking libstdc++.so: undefined refe...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 critical
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build, wrong-code
: 13331 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-12-06 05:37 UTC by Giovanni Bajo
Modified: 2004-01-17 04:22 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2003-12-06 19:25:12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Giovanni Bajo 2003-12-06 05:38:00 UTC
I'm seeing this very failure:
http://gcc.gnu.org/ml/libstdc++/2003-11/msg00172.html
on i686-pc-linux-gnu as well.

Basically bootstrap fails like this:

/home/rasky/gcc/mainline/out/gcc/g++ -shared-libgcc -
B/home/rasky/gcc/mainline/out/gcc/ -nostdinc++ -
B/home/rasky/gcc/mainline/install//i686-pc-linux-gnu/bin/ -
B/home/rasky/gcc/mainline/install//i686-pc-linux-gnu/lib/ -
isystem /home/rasky/gcc/mainline/install//i686-pc-linux-gnu/include -
isystem /home/rasky/gcc/mainline/install//i686-pc-linux-gnu/sys-include -
include bits/stdc++.h -O3 -fomit-frame-pointer -march=athlon-tbird -DNDEBUG -
DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -pipe -fno-enforce-eh-specs -D_GNU_SOURCE -
o abi_check abi_check.o  -L/home/rasky/gcc/mainline/out/i686-pc-linux-
gnu/libstdc++-v3/src -L/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-
v3/src/.libs -lm
/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-
v3/src/.libs/libstdc++.so: undefined reference to `pthread_create'
/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-
v3/src/.libs/libstdc++.so: undefined reference to `pthread_getspecific'
/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-
v3/src/.libs/libstdc++.so: undefined reference to `pthread_once'
/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-
v3/src/.libs/libstdc++.so: undefined reference to `pthread_key_create'
/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-
v3/src/.libs/libstdc++.so: undefined reference to `pthread_setspecific'

Adding "-lpthread" manually to the command line makes the compilation succeed 
(but then, the whole testsuite is broken). I wonder if the configuration is 
losing a -lpthread on the way.

rasky@trinity:~/gcc/mainline/out$ gcc/g++ -v
Reading specs from /home/rasky/gcc/mainline/install//lib/gcc/i686-pc-linux-
gnu/3.4/specs
Configured with: ../gcc/configure --prefix=/home/rasky/gcc/mainline/install/ --
enable-languages=c,c++,java --enable-shared --enable-threads=posix --with-
system-zlib --enable-__cxa_atexit --disable-multilib --with-gcc-version-
trigger=/home/rasky/gcc/mainline/gcc/gcc/version.c --no-create --no-recursion
Thread model: posix
gcc version 3.4 20031206 (experimental)

rasky@trinity:~/gcc/mainline/out$ ld -v
GNU ld version 2.14.90.0.6 20030820
Comment 1 Andrew Pinski 2003-12-06 05:46:39 UTC
*** Bug 13331 has been marked as a duplicate of this bug. ***
Comment 2 Andrew Pinski 2003-12-06 06:00:27 UTC
Tomorrow can you try without setting CXXFLAGS?
The CXXFLAGS (-O3 -fomit-frame-pointer -march=athlon-tbird -DNDEBUG -DG_DISABLE_ASSERT 
-DG_DISABLE_CHECKS -pipe -fno-enforce-eh-specs -D_GNU_SOURCE), you use might be causing 
this (I think it is either -fno-enforce-eh-specs, -O3 (if it is -O3 then that is a bug), or 
-D_GNU_SOURCE.
Minor as you are using non-standard CXXFLAGS while bootstrapping.
Comment 3 Giovanni Bajo 2003-12-06 19:25:11 UTC
It's the same:

/home/rasky/gcc/mainline/out/gcc/g++ -shared-libgcc -
B/home/rasky/gcc/mainline/out/gcc/ -nostdinc++ -
B/home/rasky/gcc/mainline/install//i686-pc-linux-gnu/bin/ -
B/home/rasky/gcc/mainline/install//i686-pc-linux-gnu/lib/ -
isystem /home/rasky/gcc/mainline/install//i686-pc-linux-gnu/include -
isystem /home/rasky/gcc/mainline/install//i686-pc-linux-gnu/sys-include -
include bits/stdc++.h -D_GNU_SOURCE -o abi_check abi_check.o  -
L/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-v3/src -
L/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-v3/src/.libs -lm
/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-
v3/src/.libs/libstdc++.so: undefined reference to `pthread_create'
/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-
v3/src/.libs/libstdc++.so: undefined reference to `pthread_getspecific'
/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-
v3/src/.libs/libstdc++.so: undefined reference to `pthread_once'
/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-
v3/src/.libs/libstdc++.so: undefined reference to `pthread_key_create'
/home/rasky/gcc/mainline/out/i686-pc-linux-gnu/libstdc++-
v3/src/.libs/libstdc++.so: undefined reference to `pthread_setspecific'
collect2: ld returned 1 exit status


_GNU_SOURCE was not in my CXXFLAGS anyway. Anyway, this bootstrap was done with 
no CFLAGS nor CXXFLAGS.
Comment 4 Andrew Pinski 2003-12-07 01:55:37 UTC
This is a dup of bug 13334 (the problem is that the CXXFLAGS and CFLAGS were set as 
environment variable).

*** This bug has been marked as a duplicate of 13334 ***
Comment 5 Andrew Pinski 2003-12-07 01:58:32 UTC
Maybe not :(.
Comment 6 Andrew Pinski 2003-12-08 02:22:50 UTC
Another report of this: <http://gcc.gnu.org/ml/gcc-testresults/2003-12/msg00294.html>.
Comment 7 Giovanni Bajo 2003-12-08 11:34:05 UTC
Again another report:
http://gcc.gnu.org/ml/gcc/2003-12/msg00500.html
Comment 8 Andrew Pinski 2003-12-08 23:19:57 UTC
Patch which caused this was reverted, Giovanni  becareful next time.