Bug 448390 - g++ link error with -frepo
Summary: g++ link error with -frepo
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 9
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-05-26 12:40 UTC by Serge Pavlovsky
Modified: 2008-05-29 10:59 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-29 10:59:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 36364 0 None None None 2019-01-25 18:45:45 UTC

Description Serge Pavlovsky 2008-05-26 12:40:50 UTC
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.