Hi,

I'm at it again, this time on an aptosid (debian sid) virtual machine using sezero's latest linux build. I'm trying to compile GCC 4.6 (20101218) with optimizations and lto. This last bit is being a b*tch. Please excuse my language, but, well, it is....

Here's the error I'm getting at "make" stage:

libtool: link: x86_64-w64-mingw32-gcc -shared  .libs/lto-plugin.o    -mtune=core2 -momit-leaf-frame-pointer -Wl,--stack -Wl,12582912   -o .libs/liblto_plugin-0.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/liblto_plugin.dll.a
Creating library file: .libs/liblto_plugin.dll.a.libs/lto-plugin.o:lto-plugin.c:(.text+0x1ef): undefined reference to `asprintf'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x270): undefined reference to `simple_object_start_read'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x29b): undefined reference to `simple_object_find_sections'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x302): undefined reference to `simple_object_release_read'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x367): undefined reference to `asprintf'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x391): undefined reference to `xstrerror'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x3c4): undefined reference to `xstrdup'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x404): undefined reference to `htab_create'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x421): undefined reference to `xmalloc'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x436): undefined reference to `xmalloc'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x5d4): undefined reference to `htab_find_slot'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x65a): undefined reference to `htab_delete'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x6aa): undefined reference to `xrealloc'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x994): undefined reference to `xmalloc'
.libs/lto-plugin.o:lto-plugin.c:(.text+0xa84): undefined reference to `xrealloc'
.libs/lto-plugin.o:lto-plugin.c:(.text+0xa9a): undefined reference to `xrealloc'
.libs/lto-plugin.o:lto-plugin.c:(.text+0xb38): undefined reference to `xstrdup'
.libs/lto-plugin.o:lto-plugin.c:(.text+0xb7a): undefined reference to `xstrdup'
.libs/lto-plugin.o:lto-plugin.c:(.text+0xc78): undefined reference to `concat'
.libs/lto-plugin.o:lto-plugin.c:(.text+0xd32): undefined reference to `xcalloc'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x1063): undefined reference to `make_temp_file'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x10b4): undefined reference to `writeargv'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x1100): undefined reference to `concat'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x1212): undefined reference to `pex_init'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x1257): undefined reference to `pex_run'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x128b): undefined reference to `pex_read_output'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x12ac): undefined reference to `xmalloc'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x12e2): undefined reference to `xrealloc'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x1315): undefined reference to `pex_get_status'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x1355): undefined reference to `pex_free'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x1414): undefined reference to `xrealloc'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x1515): undefined reference to `xstrdup'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x1541): undefined reference to `xrealloc'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x185d): undefined reference to `xrealloc'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x187a): undefined reference to `xstrdup'
.libs/lto-plugin.o:lto-plugin.c:(.text+0x10c): undefined reference to `htab_hash_string'
collect2: ld returned 1 exit status

I have everything set up like it's supposed to be (gmp, mpfr, mpc, expat, libiconv). This is the configure line:

../../src/gcc/configure --host=$HOST --build=$BUILD --target=$TARGET \
                        --prefix=$PREFIX  --with-sysroot=$PREFIX \
                        --enable-lto --disable-multilib --enable-shared \
                        --enable-stage1-languages=c,lto --enable-languages=$GCC_LANGUAGES \
                        --with-libiconv-prefix=$GCC_LIBS --with-libexpat-prefix=$GCC_LIBS \
                        --with-gmp=$GCC_LIBS --with-mpfr=$GCC_LIBS --with-mpc=$GCC_LIBS \
                        --disable-win32-registry --enable-fully-dynamic-string \
                        --enable-checking=release --disable-werror \
                        --disable-nls \
                        CFLAGS="$BUILD_CFLAGS" LFLAGS="$BUILD_LFLAGS" &> configure.log || exit 1

with:

PREFIX=/mingw64
HOST=x86_64-w64-mingw32 
BUILD=amd64-linux-gnu 
TARGET=x86_64-w64-mingw32 
CFLAGS and LFLAGS are optimizations only 
GCC_LANGUAGES="c,c++,lto"
GCC_LIBS is the intermediate install location of gmp, expat etc...

I hate GCC's build system, never works like the last time something actually worked ;)

Thanks!

Ruben