Hello all
I'm trying to build a 4.3 (rev 120828) host=minGW target=minGW
build=Linux gcc. I already successfully built a host=Linux target=Linux
and host=Linux target=minGW gcc with the mentioned source version. I use
these two to compile the minGW-minGW one. I used to do that with the gcc
4.2, but the new required mpfr library makes me some trouble with gcc 4.3.
I configure gcc with:
/usr/local/src/gcc/configure
--prefix=/home/Marco/Desktop/compile-win-win/gcc-XYZXYZ-win
--with-sysroot=/home/Marco/Desktop/compile-win-win/gcc-XYZXYZ-win/sys-root
--build=i686-pc-linux-gnu --host=i686-pc-mingw32
--target=i686-pc-mingw32 --enable-languages=c,c++,java --enable-libgcj
--with-gnu-as --with-gnu-ld --disable-nls --disable-debug
--disable-shared --disable-checking --enable-threads=win32
--disable-win32-registry
--with-gmp=/home/Marco/Desktop/compile-win-win/gmp-out
--with-mpfr=/home/Marco/Desktop/compile-win-win/mpfr-out
--with-gcj=i686-pc-mingw32-gcj --enable-sjlj-exceptions
--with-build-sysroot=/home/Marco/Desktop/compile-win-win/gcc-XYZXYZ-win/sys-root
But it failes with:
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.2.1+.
Config.log says:
configure:2401: checking for correct version of mpfr.h
configure:2421: i686-pc-mingw32-gcc -o conftest -g -O2
-I/home/Marco/Desktop/compile-win-win/gmp-out/include
-I/home/Marco/Desktop/compile-win-win/mpfr-out/include conftest.c
-L/home/Marco/Desktop/compile-win-win/gmp-out/lib
-L/home/Marco/Desktop/compile-win-win/mpfr-out/lib -lmpfr -lgmp 1>&5
/tmp/ccwl5QK3.o: In function
`main':/home/Marco/Desktop/compile-win-win/gcc-build/configure:2411:
undefined reference to `_mpfr_init'
:/home/Marco/Desktop/compile-win-win/gcc-build/configure:2412: undefined
reference to `_mpfr_init'
:/home/Marco/Desktop/compile-win-win/gcc-build/configure:2414: undefined
reference to `_mpfr_atan2'
:/home/Marco/Desktop/compile-win-win/gcc-build/configure:2415: undefined
reference to `_mpfr_erfc'
:/home/Marco/Desktop/compile-win-win/gcc-build/configure:2416: undefined
reference to `_mpfr_subnormalize'
collect2: ld returned 1 exit status
I do not crosscompile gmp and mpfr. Is that necessary? Anyway, the
problem seems to occur before it might be an error if gmp/mpfr isn't
crosscompiled:
It looks to me (note, I'm not an expert) as this is a linker error
because not all needed objects are pulled into the binary. I noticed
this problem already when using a 4.2 gcc on Windows while working with
gmp on a private project.
So because I assume that this is a GCC problem, I wondered how the
Host=Linux target=minGW compiler was able to compile the mpfr test and
checked that config.log. It used the gcc that is installed on my
computer (version 4.02). I tried then to compile that test with the
built gcc from my host=Linux target=Linux compiler and it fails with the
same error as above.
So, can this be a gcc bug? Or is this something the linker is doing
wrong? I'm using binutils v2.16.91. I noticed the same problem with v
2.16.1.
Any Ideas?
Marco