This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51832] [4.7 regression] Rev.182970 causes LTO link errors (multiple definitions of allocator_traits)
- From: "markus at trippelsdorf dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Jan 2012 09:06:57 +0000
- Subject: [Bug c++/51832] [4.7 regression] Rev.182970 causes LTO link errors (multiple definitions of allocator_traits)
- Auto-submitted: auto-generated
- References: <bug-51832-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51832
--- Comment #2 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-01-12 09:06:57 UTC ---
(In reply to comment #1)
> Can you attach preprocessed sources to reproduce this?
I've reduced it to this snipped:
% cat foo.cpp
#include <vector>
struct foo
{
void bar ()
{
s.push_back (0);
}
std::vector <int> s;
};
% g++ foo.cpp foo.cpp -flto -std=gnu++0x
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccZEKdVj.o: multiple definition of
'_ZNSt16allocator_traitsISaIiEE18__construct_helperIiJiEE5valueE'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0/../../../../x86_64-pc-linux-gnu/bin/ld:
/tmp/cc1lLTi3.o: previous definition here
../sysdeps/x86_64/elf/start.S:109: error: undefined reference to 'main'
collect2: error: ld returned 1 exit statu