This is the mail archive of the gcc-help@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]

Weird LTO internal cross compiler error (gcc 4.7.3 and 4.8.2)


I built a "i686-w64-mingw32" cross-compiler (gcc 4.7.3, binutils 2.23.2) on
Ubuntu 13.04 (64bit) for target-host Windows (32bit) and compiled a bunch of
static libraries with it (cairo, pango, pixbuf etc.). For every static
library I used "-O2 -flto" as CFLAGS and LDFLAGS. I put all the objects
files of these static libraries into one big static library and compiled a
little program with it in CodeBlocks 12.11 using the same cross compiler. 
It compiled fine without errors.

If I apply the "-flto" flag in CodeBlocks, the first 5 weird errors showed
up, like:
cairo-surface.o (symbol from plugin):(.text+0x0): multiple definition of
`cairo_surface_flush'
cairo-surface.o (symbol from plugin):(.text+0x0): first defined here

It's saying "cairo_surface_flush" is redefined within the same object file,
does this make any sense?
Anyways, I used the work-around-option "-Wl,-allow-multiple-definition" and
the errors went away.

But one error is still left:
"lto1: internal compiler error: resolution sub id 0 not in object file"

I have no clue what's wrong here, but I guess it got something to do with
the compiler.

I also tried the same with a gcc cross compiler version 4.8.2 (build all
libraries again) but I'm still getting the same error, just a bit more
output:
lto1: internal compiler error: resolution sub id 0 not in object file
0x4e91f3 lto_resolution_read
	../../../src/gcc/gcc/lto/lto.c:2228
0x4e91f3 lto_file_read
	../../../src/gcc/gcc/lto/lto.c:2385
0x4e91f3 read_cgraph_and_symbols
	../../../src/gcc/gcc/lto/lto.c:2964
0x4e91f3 lto_main()
	../../../src/gcc/gcc/lto/lto.c:3375

You can see the function which is throwing the error in this file (line
1069):
https://chromium.googlesource.com/chromiumos/third_party/gcc/+/5cfcf8452e8f755d2b2899d96f93afdb4672de16/gcc/gcc-4.6.0/gcc/lto/lto.c


What can I do to solve this? Maybe some flag?
Or should I file a bug report?



--
View this message in context: http://gcc.1065356.n5.nabble.com/Weird-LTO-internal-cross-compiler-error-gcc-4-7-3-and-4-8-2-tp977677.html
Sent from the gcc - Help mailing list archive at Nabble.com.


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