This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/51832] [4.7 regression] Rev.182970 causes LTO link errors (multiple definitions of allocator_traits)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]