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] New: [4.7 regression] Rev.182970 causes LTO link errors (multiple definitions of allocator_traits)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51832

             Bug #: 51832
           Summary: [4.7 regression] Rev.182970 causes LTO link errors
                    (multiple definitions of allocator_traits)
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: markus@trippelsdorf.de


Rev.182970 causes LTO link errors because of multiple definitions that all
start with '_ZNSt16allocator_traits', e.g.:

c++ -o elfhack -fno-rtti -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth
-Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof
-Wno-variadic-macros -Werror=return-type -Wno-long-long -march=native -flto=4
-fno-fat-lto-objects -Wno-delete-non-virtual-dtor -fno-strict-aliasing
-std=gnu++0x -pthread -ffunction-sections -pipe -fexceptions  -DNDEBUG
-DTRIMMED -Os -freorder-blocks  -fomit-frame-pointer -lpthread
-fuse-linker-plugin
-Wl,-O1,--hash-style=gnu,--as-needed,--no-keep-memory,--gc-sections
-Wl,--icf=safe  -Wl,-rpath-link,/var/tmp/mozilla-central/moz-build-dir/dist/bin
-Wl,-rpath-link,/usr/lib  host_elf.o host_elfhack.o  
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: host_elfhack.o: multiple definition of
'_ZNSt16allocator_traitsISaIP10ElfSegmentEE18__construct_helperIS1_JRKS1_EE5valueE'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0/../../../../x86_64-pc-linux-gnu/bin/ld:
host_elf.o: previous definition here
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: host_elfhack.o: multiple definition of
'_ZNSt16allocator_traitsISaIN17ElfStrtab_Section13table_storageEEE18__construct_helperIS1_JS1_EE5valueE'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0/../../../../x86_64-pc-linux-gnu/bin/ld:
host_elf.o: previous definition here
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: host_elfhack.o: multiple definition of
'_ZNSt16allocator_traitsISaI7Elf_RelEE18__construct_helperIS0_JRKS0_EE5valueE'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0/../../../../x86_64-pc-linux-gnu/bin/ld:
host_elf.o: previous definition here
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: host_elfhack.o: multiple definition of
'_ZNSt16allocator_traitsISaI8Elf_RelaEE18__construct_helperIS0_JRKS0_EE5valueE'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0/../../../../x86_64-pc-linux-gnu/bin/ld:
host_elf.o: previous definition here
collect2: error: ld returned 1 exit status
make[1]: *** [elfhack] Error 1

2d847c181ef6fc581d0c915678dedd66e3fdaa15 is the first bad commit
commit 2d847c181ef6fc581d0c915678dedd66e3fdaa15
Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Fri Jan 6 21:39:43 2012 +0000

        PR c++/6057
        PR c++/48051
        PR c++/50855
        PR c++/51322
    gcc/cp/
        * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
        THROW_EXPR, CONSTRUCTOR, OVERLOAD.  Fix PREINCREMENT_EXPR and
        PREDECREMENT_EXPR.
        (write_template_arg): Fix mangling of class-scope functions and
        argument packs.
        (mangle_decl): Update suggested -fabi-version argument.
        * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
        DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
        * tree.c (dependent_name): No longer static.
        * cp-tree.h: Declare it.
        * pt.c (unify): Defer handling of unconverted functions.
    include/
        * demangle.h (enum demangle_component_type): Add
        DEMANGLE_COMPONENT_INITIALIZER_LIST, DEMANGLE_COMPONENT_NULLARY.
    libiberty/
        * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_NULLARY and
        DEMANGLE_COMPONENT_INITIALIZER_LIST.
        (d_make_comp): Likewise.  Allow null right arg for
        DEMANGLE_COMPONENT_TRINARY_ARG2.
        (cplus_demangle_operators): Adjust new/delete; add .*, :: and throw.
        (d_template_args, d_template_arg): Handle 'J' for argument packs.
        (d_exprlist): Add terminator parm.
        (d_expression, d_print_comp): Handle initializer lists, nullary
        expressions, prefix/suffix operators, and new.
        (d_print_subexpr): Avoid parens around DEMANGLE_COMPONENT_QUAL_NAME
        and DEMANGLE_COMPONENT_INITIALIZER_LIST.
        * testsuite/demangle-expected: Add tests.

    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182970
138bc75d-0d04-0410-961f-82ee72b054a4


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