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

--- Comment #5 from Dongsheng Song <dongsheng.song at gmail dot com> 2011-02-08 
06:41:50 UTC ---
(In reply to comment #4)
> Does it help on cross-compile to do after 'make all-gcc && make install-gcc' 
> to
> do additionally 'make install-lto-plugin'?
> 
> The fatal error in gcc.c is correct, but indeed it seems that the plugin
> doesn't get installed by doing 'make install-gcc'.

Today, I can building with LTO enabled like gcc 4.5 now.

For the compiler:
--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=i686-w64-mingw32
--enable-targets=all

I can compile simple C source with LTO, then I use above compiler to generate
native compiler:
--build=i686-pc-linux-gnu --host=i686-w64-mingw32 --target=i686-w64-mingw32
--enable-targets=all

The native compiler can not compile simple C source with LTO:
C:\>g++ -O2 -pipe -m32 -flto Hello.cpp
c:/gcc-4.6-windows/bin/../lib/gcc/i686-w64-mingw32/4.6.0/../../../../i686-w64-mingw32/bin/ld.exe:
unrecognized option '-plugin'
c:/gcc-4.6-windows/bin/../lib/gcc/i686-w64-mingw32/4.6.0/../../../../i686-w64-mingw32/bin/ld.exe:
use the --help optionfor usage information
collect2: ld returned 1 exit status

It seems that the binutils not building correctly, but I building native
binutils with LTO enabled same as GCC:

${BINUTILS_SOURCE_DIR}/configure --prefix=${NATIVE_PREFIX}
--with-sysroot=${CROSS_PREFIX} \
    --build=${BUILD_TRIPLET} --host=${TARGET_TRIPLET}
--target=${TARGET_TRIPLET} \
    --enable-targets=x86_64-w64-mingw32,i686-w64-mingw32 --disable-nls \
    --enable-lto --enable-cloog-backend=ppl-legacy \
    --disable-ppl-version-check --with-ppl=${NATIVE_OBJ_ROOT}/misc \
    --disable-cloog-version-check --with-cloog=${NATIVE_OBJ_ROOT}/misc

${GCC_SOURCE_DIR}/configure --prefix=${NATIVE_PREFIX}
--with-sysroot=${NATIVE_PREFIX} \
    --build=${BUILD_TRIPLET} --host=${TARGET_TRIPLET}
--target=${TARGET_TRIPLET} --enable-targets=all \
    --with-arch-32=x86-64 --with-tune-32=generic \
    --with-arch-64=x86-64 --with-tune-64=generic --with-fpmath=sse \
    --with-gmp=${NATIVE_OBJ_ROOT}/misc --with-mpfr=${NATIVE_OBJ_ROOT}/misc
--with-mpc=${NATIVE_OBJ_ROOT}/misc \
    --enable-fully-dynamic-string --disable-nls \
    --enable-languages=c,c++,fortran,objc,obj-c++ \
    --enable-libgomp --enable-libssp \
    --enable-lto --enable-cloog-backend=ppl-legacy \
    --disable-ppl-version-check --with-ppl=${NATIVE_OBJ_ROOT}/misc \
    --disable-cloog-version-check --with-cloog=${NATIVE_OBJ_ROOT}/misc

Any suggestions?

Reply via email to