On 04/10/2011 05:43 AM, Richard Guenther wrote:
On Sun, Apr 10, 2011 at 1:04 AM, Benjamin Redelings I
<benjamin.redeli...@nescent.org> wrote:
Hi,
I just tried compiling with LTO for the first time. I can't figure out
what to try based on the error message below. Is there a HTML page I should
be looking at?
It seems that this did not work:
g++-4.6 -isystem ../../../master/boost/include -ffast-math -DNDEBUG
-DNDEBUG_DP -funroll-loops -fweb -flto -fuse-linker-plugin -march=native
-pipe -O3 -isystem /usr/lib/openmpi/include -isystem
/usr/lib/openmpi/include/openmpi -pthread -pedantic -pthread
-I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
-Wall -Wextra -Wno-sign-compare -Woverloaded-virtual -Wstrict-aliasing -o
alignment-gild alignment-gild.o alignment.o alphabet.o sequence.o util.o
rng.o tree.o sequencetree.o optimize.o findroot.o setup.o imodel.o
probability.o sequence-format.o model.o distance-methods.o
alignment-random.o alignment-util.o randomtree.o tree-util.o inverse.o io.o
../boost/lib/filesystem/libboost_filesystem.a
../boost/lib/program_options/libboost_program_options.a -lgsl -lgslcblas -lm
/usr/bin/ld.gold: error: /tmp/cc4IJUrh.ltrans12.ltrans.o: multiple
definition of '_ZTV18RootedSequenceTree.local.4048'
/usr/bin/ld.gold: /tmp/cc4IJUrh.ltrans7.ltrans.o: previous definition here
/usr/bin/ld.gold: error: /tmp/cc4IJUrh.ltrans12.ltrans.o: multiple
definition of '_ZTT18RootedSequenceTree.local.4049'
/usr/bin/ld.gold: /tmp/cc4IJUrh.ltrans7.ltrans.o: previous definition here
collect2: ld returned 1 exit status
So, it looks like the virtual table for class RootedSequenceTree is defined
in multiple places. But the file name cc4IJUrh.ltrans12.ltrans.o doesn't
clearly correspond to any input file name. Is there any way for me to find
out which *.o files have definitions for this symbol, and why they are
problematic only with LTO?
It looks like a bug either in GCC or in gold. Can you try updating binutils to
the head of the 2.21 branch (or to mainline)? You can probably mitigate
the problem by using -flto-partition=none (use a single partition for optimizing
at link-time).
The .ltransXX files are the whole program partitioned into smaller chunks,
ordered in a way that maximizes optimization opportunities and allow
parallel optimization at link-time (and also reduce the memory footprint
by reducing the size of the TUs GCC has to deal with).
Richard.
Hi Richard,
For what its worth, I got the same error messages using a 04/09/11
snapshot of binutils/gold version 2.21.51 from Debian. So, if its a bug
its still there. I'll try -flto-partition=none on Monday.
-BenRI