Bug 84615

Summary: compat-libstdc++ has undefined references to pthread functions
Product: [Retired] Red Hat Linux Reporter: Need Real Name <hamilton>
Component: compat-gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-03 19:52:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2003-02-19 17:32:41 UTC
Description of problem: 
Trying to compile a c++ program with g++296 fail with undefined reference to pthread 
functions. 
 
Version-Release number of selected component (if applicable): 
compat-gcc-7.3-2.96.110 
compat-gcc-c++-7.3-2.96.110 
compat-libstdc++-7.3-2.96.110 
compat-libstdc++-devel-7.3-2.96.110 
 
How reproducible: 
Always. 
 
Steps to Reproduce: 
1. Create test.cpp which contains: 
#include <string> 
int main() 
{ 
    std::string s; 
    return 0; 
} 
2. Run: 
$ g++296 test.cpp 
     
Actual results: 
/tmp/ccdissG2.o(.__default_alloc_template<true, 
0>::_Lock::gnu.linkonce.t.(void)+0x12): In function `__default_alloc_template<true, 
0>::_Lock::_Lock(void)': 
: undefined reference to `pthread_mutex_lock' 
/tmp/ccdissG2.o(.gnu.linkonce.t._._Q2t24__default_alloc_template2b1i05_Lock+0x13): 
In function `__default_alloc_template<true, 0>::_Lock::~_Lock(void)': 
: undefined reference to `pthread_mutex_unlock' 
collect2: ld returned 1 exit status 
 
Expected results: 
Compiled file in a.out. 
 
Additional info: 
None.

Comment 1 Need Real Name 2003-02-19 17:37:06 UTC
I forgot to say that you can compile successifully with: 
$ g++296 test.cpp -lpthread 
But I have doubts if this is the right thing to do. 
 

Comment 2 Jakub Jelinek 2003-02-19 17:40:54 UTC
What glibc do you use? I believe it is fixed in phoebe3/rawhide.

Comment 3 Need Real Name 2003-02-19 18:04:32 UTC
glibc-2.3.1-21. I'll try the rawhide then. Thanks. 

Comment 4 Jakub Jelinek 2004-10-03 19:52:58 UTC
No results from retry, assuming it is fixed.