Bug 448390 - g++ link error with -frepo
g++ link error with -frepo
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
9
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-26 08:40 EDT by Serge Pavlovsky
Modified: 2008-05-29 06:59 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-29 06:59:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 36364 None None None Never

  None (edit)
Description Serge Pavlovsky 2008-05-26 08:40:50 EDT
Description of problem:

[15:29:11 pal@localhost ~/tmp/bug]$ cat a.cpp
#include <string>
#include <ext/mt_allocator.h>

//workaround:
//template class std :: basic_string < char, std :: char_traits < char >,
__gnu_cxx :: __mt_alloc < char > >;

int main ( ) {
	std :: basic_string < char, std :: char_traits < char >, __gnu_cxx ::
__mt_alloc < char > > s;
	s.push_back ( 'a' );
}

[15:34:12 pal@localhost ~/tmp/bug]$ LC_ALL=C g++ -c a.cpp -frepo && LC_ALL=C g++
-o a a.o -frepo
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
a.o: In function `std::basic_string<char, std::char_traits<char>,
__gnu_cxx::__mt_alloc<char, __gnu_cxx::__common_pool_policy<__gnu_cxx::__pool,
true> > >::_Rep::_M_set_length_and_sharable(unsigned long)':
a.cpp:(.text+0x28b): undefined reference to `std::basic_string<char,
std::char_traits<char>, __gnu_cxx::__mt_alloc<char,
__gnu_cxx::__common_pool_policy<__gnu_cxx::__pool, true> > >::_Rep::_S_terminal'
collect2: ld returned 1 exit status

[15:34:15 pal@localhost ~/tmp/bug]$ LC_ALL=C g++ -c a.cpp && LC_ALL=C g++ -o a a.o
[15:35:10 pal@localhost ~/tmp/bug]$ 

Version-Release number of selected component (if applicable):

[15:35:10 pal@localhost ~/tmp/bug]$ LC_ALL=C g++ --version
g++ (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

How reproducible:

compile with -frepo .push_back() on basic_string with different allocator

Actual results:
link error

Expected results:
successful link

Additional info:
uncommenting workaround works but it defeats purpose of -frepo

Note You need to log in before you can comment on or make changes to this bug.