Re: [Mingw-w64-public] Does anyone use Linux cross-build gcc 4.8 compiler to build native compiler success ?

2013-09-03 Thread Christer Solskogen
On 6/19/13 11:37 AM, Dongsheng Song wrote:
 I can build i686-w64-mingw32-gcc and x86_64-w64-mingw32-gcc under
 Linux, but when I use this compiler to compile native Windows
 compiler, gcc 4.7 success, gcc 4.8 failed with same build script like
 this:


I've probably figured it out. You need to specify --target as well. 
Without it, gcc will try to build target libraries with the system compiler.

-- 
chs



--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Does anyone use Linux cross-build gcc 4.8 compiler to build native compiler success ?

2013-07-04 Thread LRN
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 19.06.2013 20:35, Christer Solskogen wrote:
 On 19.06.2013 11:37, Dongsheng Song wrote:
 I can build i686-w64-mingw32-gcc and x86_64-w64-mingw32-gcc under
 Linux, but when I use this compiler to compile native Windows
 compiler, gcc 4.7 success, gcc 4.8 failed with same build script like
 this:

 make[2]: Entering directory `/home/cauchy/obj/native/gcc-4.8-win32/gcc/gcc'
 g++ -c   -g -O2 -DIN_GCC   -fno-exceptions -fno-rtti
 
 ^^
 
 Should not be there. What you should see is x86_64-w64-mingw32-g++. And 
 tells me that you probably have the wrong --host setting for configure.
 Gcc needs something like --target=x86_64-w64-mingw32 
 --host=x86_64-w64-mingw32 --build=x86_64-unknown-linux-gnu
 
Not really. GCC does build some things with the CXX_FOR_BUILD (which is
simply g++).

- -- 
O ascii ribbon - stop html email! - www.asciiribbon.org
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (MingW32)

iQEcBAEBAgAGBQJR1TfIAAoJEOs4Jb6SI2CwrMMH/A36DYMURml/FQXjc+iFpEG9
EJsNyDkt/6kdUIDWXRThfFwdZqmJTRQ3ujtc4/4W3svFBhdyz/xLsq++YinPUKty
L23lUWyEG5lxzh8iB03Rw7qksWuQtGl7fP9NlYkjsEoDYJD4+cnbyFdndrcKmqFp
ziInnyut3xpTAGD0Kg/5Sp76Ksx62ntLyT41wwxbPD5H5HZNm41bPtIIaCWxfbII
p78nTP7bzXVwCwLkj1asF5p/Lp03Uy5q6PSii8nN7L/z1bPPdwD5VSWJBbDlB3r/
pB9MEpYdoADOyRSmxeZrtimZWTU79T8NgpcpDizW2pCF5I0/FgQ9y+h28mNdGa0=
=+9V8
-END PGP SIGNATURE-

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Does anyone use Linux cross-build gcc 4.8 compiler to build native compiler success ?

2013-06-20 Thread Christer Solskogen
Dongsheng Song dongsheng.song@... writes:

Looks fine to me. But I wonder why you build gmp, mpc and mpfr seperatly. You 
can just run the gcc/contrib/download_prerequisites script. 
Can you post config.log for the native compiler? I have my own set of scripts 
which does almost the same as you and I have no problem building 4.8.




--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Does anyone use Linux cross-build gcc 4.8 compiler to build native compiler success ?

2013-06-20 Thread Earnie Boyd
On Thu, Jun 20, 2013 at 9:06 AM, Dongsheng Song wrote:

 I want to build gcc 4.8 with isl and cloog, can I put  isl and cloog
 to gcc/branches/gcc-4_8-branch/ like gmp/mpfr/mpc ?


You should be able to determine that by looking at the top level
configure script.  IIRC, it will look for other configure scripts in
the sub-directories.  The issue will be prerequisite ordering.

-- 
Earnie
-- https://sites.google.com/site/earnieboyd

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Does anyone use Linux cross-build gcc 4.8 compiler to build native compiler success ?

2013-06-20 Thread Ruben Van Boxem
2013/6/20 Earnie Boyd ear...@users.sourceforge.net

 On Thu, Jun 20, 2013 at 9:06 AM, Dongsheng Song wrote:
 
  I want to build gcc 4.8 with isl and cloog, can I put  isl and cloog
  to gcc/branches/gcc-4_8-branch/ like gmp/mpfr/mpc ?
 

 You should be able to determine that by looking at the top level
 configure script.  IIRC, it will look for other configure scripts in
 the sub-directories.  The issue will be prerequisite ordering.


GCC's build is capable of ordering them just fine. If it wouldn't order
them correctly, what would be the point.

All the subdirectories that in theory can be built in-tree are listed here:
https://github.com/mirrors/gcc/blob/master/configure#L2749

I tried to get this setup working for


 --
 Earnie
 -- https://sites.google.com/site/earnieboyd


 --
 This SF.net email is sponsored by Windows:

 Build for Windows Store.

 http://p.sf.net/sfu/windows-dev2dev
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Does anyone use Linux cross-build gcc 4.8 compiler to build native compiler success ?

2013-06-20 Thread Dongsheng Song
On Thu, Jun 20, 2013 at 9:11 PM, Earnie Boyd
ear...@users.sourceforge.net wrote:
 On Thu, Jun 20, 2013 at 9:06 AM, Dongsheng Song wrote:

 I want to build gcc 4.8 with isl and cloog, can I put  isl and cloog
 to gcc/branches/gcc-4_8-branch/ like gmp/mpfr/mpc ?


 You should be able to determine that by looking at the top level
 configure script.  IIRC, it will look for other configure scripts in
 the sub-directories.  The issue will be prerequisite ordering.


Thanks, I see:

$ grep ^host_libs gcc-4_7-branch/configure gcc-4_8-branch/configure
gcc-4_7-branch/configure:host_libs=intl libiberty opcodes bfd
readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr mpc ppl
cloog libelf libiconv
gcc-4_8-branch/configure:host_libs=intl libiberty opcodes bfd
readline tcl tk itcl libgui zlib libbacktrace libcpp libdecnumber gmp
mpfr mpc isl cloog libelf libiconv

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] Does anyone use Linux cross-build gcc 4.8 compiler to build native compiler success ?

2013-06-19 Thread Dongsheng Song
I can build i686-w64-mingw32-gcc and x86_64-w64-mingw32-gcc under
Linux, but when I use this compiler to compile native Windows
compiler, gcc 4.7 success, gcc 4.8 failed with same build script like
this:

make[2]: Entering directory `/home/cauchy/obj/native/gcc-4.8-win32/gcc/gcc'
g++ -c   -g -O2 -DIN_GCC   -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H
-DGENERATOR_FILE -I. -Ibuild
-I/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc
-I/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/build
-I/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/../include
-I/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/../libcpp/include
-I/home/cauchy/native/gcc-4.8-win32-3rd/include
-I/home/cauchy/native/gcc-4.8-win32-3rd/include
-I/home/cauchy/native/gcc-4.8-win32-3rd/include
-I/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/../libdecnumber
-I/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/../libdecnumber/bid
-I../libdecnumber
-I/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/../libbacktrace
   \
-o build/genconstants.o
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/genconstants.c
In file included from /usr/include/x86_64-linux-gnu/sys/resource.h:25:0,
 from /usr/include/x86_64-linux-gnu/sys/wait.h:32,
 from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/system.h:352,
 from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/genconstants.c:28:
/usr/include/x86_64-linux-gnu/bits/resource.h:133:18: error:
declaration does not declare anything [-fpermissive]
In file included from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/genconstants.c:28:0:
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/system.h:444:23:
error: declaration of C function ‘void* sbrk(int)’ conflicts with
In file included from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/system.h:254:0,
 from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/genconstants.c:28:
/usr/include/unistd.h:1056:14: error: previous declaration ‘void*
sbrk(intptr_t)’ here
In file included from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/genconstants.c:28:0:
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/system.h:448:48:
error: new declaration ‘char* strstr(const char*, const char*)’
In file included from /usr/include/c++/4.7/cstring:44:0,
 from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/system.h:205,
 from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/genconstants.c:28:
/usr/include/string.h:335:1: error: ambiguates old declaration ‘const
char* strstr(const char*, const char*)’
In file included from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/genconstants.c:28:0:
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/system.h:500:34:
error: declaration of C function ‘const char* strsignal(int)’
conflicts with
In file included from /usr/include/c++/4.7/cstring:44:0,
 from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/system.h:205,
 from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/genconstants.c:28:
/usr/include/string.h:566:14: error: previous declaration ‘char*
strsignal(int)’ here
In file included from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/system.h:645:0,
 from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/genconstants.c:28:
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/../include/libiberty.h:110:36:
error: new declaration ‘char* basename(const char*)’
In file included from /usr/include/c++/4.7/cstring:44:0,
 from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/system.h:205,
 from
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/gcc/genconstants.c:28:
/usr/include/string.h:603:28: error: ambiguates old declaration ‘const
char* basename(const char*)’
make[2]: *** [build/genconstants.o] Error 1
make[2]: Leaving directory `/home/cauchy/obj/native/gcc-4.8-win32/gcc/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/cauchy/obj/native/gcc-4.8-win32/gcc'
make: *** [all] Error 2

Regards,
Dongsheng

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Does anyone use Linux cross-build gcc 4.8 compiler to build native compiler success ?

2013-06-19 Thread Christer Solskogen
On 19.06.2013 11:37, Dongsheng Song wrote:
 I can build i686-w64-mingw32-gcc and x86_64-w64-mingw32-gcc under
 Linux, but when I use this compiler to compile native Windows
 compiler, gcc 4.7 success, gcc 4.8 failed with same build script like
 this:

 make[2]: Entering directory `/home/cauchy/obj/native/gcc-4.8-win32/gcc/gcc'
 g++ -c   -g -O2 -DIN_GCC   -fno-exceptions -fno-rtti

^^

Should not be there. What you should see is x86_64-w64-mingw32-g++. And 
tells me that you probably have the wrong --host setting for configure.
Gcc needs something like --target=x86_64-w64-mingw32 
--host=x86_64-w64-mingw32 --build=x86_64-unknown-linux-gnu

-- 
chs



--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Does anyone use Linux cross-build gcc 4.8 compiler to build native compiler success ?

2013-06-19 Thread Dongsheng Song
On Thu, Jun 20, 2013 at 12:35 AM, Christer Solskogen
christer.solsko...@gmail.com wrote:
 On 19.06.2013 11:37, Dongsheng Song wrote:
 I can build i686-w64-mingw32-gcc and x86_64-w64-mingw32-gcc under
 Linux, but when I use this compiler to compile native Windows
 compiler, gcc 4.7 success, gcc 4.8 failed with same build script like
 this:

 make[2]: Entering directory `/home/cauchy/obj/native/gcc-4.8-win32/gcc/gcc'
 g++ -c   -g -O2 -DIN_GCC   -fno-exceptions -fno-rtti

 ^^

 Should not be there. What you should see is x86_64-w64-mingw32-g++. And
 tells me that you probably have the wrong --host setting for configure.
 Gcc needs something like --target=x86_64-w64-mingw32
 --host=x86_64-w64-mingw32 --build=x86_64-unknown-linux-gnu

 --
 chs


This is gcc 4.8 wrong, since I have passed the correct settings:

$ echo ${GCC_SRC_ROOT}/configure \
 --prefix=${SYS_ROOT} \
 --with-sysroot=${SYS_ROOT} \
 --build=${BUILD_TRIPLET} --host=${TARGET_TRIPLET} 
 --target=${TARGET_TRIPLET} \
 --disable-multilib --disable-nls --disable-win32-registry \
 --enable-checking=release --enable-languages=c,c++,fortran \
 --with-fpmath=sse \
 --with-gmp=${SYS_3RD_ROOT} --with-mpfr=${SYS_3RD_ROOT} 
 --with-mpc=${SYS_3RD_ROOT}
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/configure
--prefix=/home/cauchy/native/gcc-4.8-win32
--with-sysroot=/home/cauchy/native/gcc-4.8-win32
--build=x86_64-unknown-linux-gnu --host=i686-w64-mingw32
--target=i686-w64-mingw32 --disable-multilib --disable-nls
--disable-win32-registry --enable-checking=release
--enable-languages=c,c++,fortran --with-fpmath=sse
--with-gmp=/home/cauchy/native/gcc-4.8-win32-3rd
--with-mpfr=/home/cauchy/native/gcc-4.8-win32-3rd
--with-mpc=/home/cauchy/native/gcc-4.8-win32-3rd

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Does anyone use Linux cross-build gcc 4.8 compiler to build native compiler success ?

2013-06-19 Thread Christer Solskogen
On 20.06.2013 05:20, Dongsheng Song wrote:
 On Thu, Jun 20, 2013 at 12:35 AM, Christer Solskogen
 christer.solsko...@gmail.com wrote:
 On 19.06.2013 11:37, Dongsheng Song wrote:
 I can build i686-w64-mingw32-gcc and x86_64-w64-mingw32-gcc under
 Linux, but when I use this compiler to compile native Windows
 compiler, gcc 4.7 success, gcc 4.8 failed with same build script like
 this:

 make[2]: Entering directory `/home/cauchy/obj/native/gcc-4.8-win32/gcc/gcc'
 g++ -c   -g -O2 -DIN_GCC   -fno-exceptions -fno-rtti

 ^^

 Should not be there. What you should see is x86_64-w64-mingw32-g++. And
 tells me that you probably have the wrong --host setting for configure.
 Gcc needs something like --target=x86_64-w64-mingw32
 --host=x86_64-w64-mingw32 --build=x86_64-unknown-linux-gnu

 --
 chs


 This is gcc 4.8 wrong, since I have passed the correct settings:

 $ echo ${GCC_SRC_ROOT}/configure \
  --prefix=${SYS_ROOT} \
  --with-sysroot=${SYS_ROOT} \
  --build=${BUILD_TRIPLET} --host=${TARGET_TRIPLET} 
 --target=${TARGET_TRIPLET} \
  --disable-multilib --disable-nls --disable-win32-registry \
  --enable-checking=release --enable-languages=c,c++,fortran \
  --with-fpmath=sse \
  --with-gmp=${SYS_3RD_ROOT} --with-mpfr=${SYS_3RD_ROOT} 
 --with-mpc=${SYS_3RD_ROOT}
 /home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/configure
 --prefix=/home/cauchy/native/gcc-4.8-win32
 --with-sysroot=/home/cauchy/native/gcc-4.8-win32
 --build=x86_64-unknown-linux-gnu --host=i686-w64-mingw32
 --target=i686-w64-mingw32 --disable-multilib --disable-nls
 --disable-win32-registry --enable-checking=release
 --enable-languages=c,c++,fortran --with-fpmath=sse
 --with-gmp=/home/cauchy/native/gcc-4.8-win32-3rd
 --with-mpfr=/home/cauchy/native/gcc-4.8-win32-3rd
 --with-mpc=/home/cauchy/native/gcc-4.8-win32-3rd


Could you post $CC, $CFLAGS and/or $CXXFLAGS? Also the output of gcc -v 
and i686-w64-mingw32-gcc -v?

-- 
chs



--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Does anyone use Linux cross-build gcc 4.8 compiler to build native compiler success ?

2013-06-19 Thread Dongsheng Song
On Thu, Jun 20, 2013 at 12:25 PM, Christer Solskogen
christer.solsko...@gmail.com wrote:

 On 20.06.2013 05:20, Dongsheng Song wrote:
  On Thu, Jun 20, 2013 at 12:35 AM, Christer Solskogen
  christer.solsko...@gmail.com wrote:
  On 19.06.2013 11:37, Dongsheng Song wrote:
  I can build i686-w64-mingw32-gcc and x86_64-w64-mingw32-gcc under
  Linux, but when I use this compiler to compile native Windows
  compiler, gcc 4.7 success, gcc 4.8 failed with same build script like
  this:
 
  make[2]: Entering directory 
  `/home/cauchy/obj/native/gcc-4.8-win32/gcc/gcc'
  g++ -c   -g -O2 -DIN_GCC   -fno-exceptions -fno-rtti
 
  ^^
 
  Should not be there. What you should see is x86_64-w64-mingw32-g++. And
  tells me that you probably have the wrong --host setting for configure.
  Gcc needs something like --target=x86_64-w64-mingw32
  --host=x86_64-w64-mingw32 --build=x86_64-unknown-linux-gnu
 
  --
  chs
 
 
  This is gcc 4.8 wrong, since I have passed the correct settings:
 
  $ echo ${GCC_SRC_ROOT}/configure \
   --prefix=${SYS_ROOT} \
   --with-sysroot=${SYS_ROOT} \
   --build=${BUILD_TRIPLET} --host=${TARGET_TRIPLET} 
  --target=${TARGET_TRIPLET} \
   --disable-multilib --disable-nls --disable-win32-registry \
   --enable-checking=release --enable-languages=c,c++,fortran \
   --with-fpmath=sse \
   --with-gmp=${SYS_3RD_ROOT} --with-mpfr=${SYS_3RD_ROOT} 
  --with-mpc=${SYS_3RD_ROOT}
  /home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/configure
  --prefix=/home/cauchy/native/gcc-4.8-win32
  --with-sysroot=/home/cauchy/native/gcc-4.8-win32
  --build=x86_64-unknown-linux-gnu --host=i686-w64-mingw32
  --target=i686-w64-mingw32 --disable-multilib --disable-nls
  --disable-win32-registry --enable-checking=release
  --enable-languages=c,c++,fortran --with-fpmath=sse
  --with-gmp=/home/cauchy/native/gcc-4.8-win32-3rd
  --with-mpfr=/home/cauchy/native/gcc-4.8-win32-3rd
  --with-mpc=/home/cauchy/native/gcc-4.8-win32-3rd
 

 Could you post $CC, $CFLAGS and/or $CXXFLAGS? Also the output of gcc -v
 and i686-w64-mingw32-gcc -v?


Not set any $CC, $CFLAGS and/or $CXXFLAGS.

cauchy@dre-syslog:~/src$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian
4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-gnu-unique-object --enable-plugin --enable-objc-gc
--with-arch-32=i586 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5)

cauchy@dre-syslog:~/src$ i686-w64-mingw32-gcc -v
Using built-in specs.
COLLECT_GCC=i686-w64-mingw32-gcc
COLLECT_LTO_WRAPPER=/home/cauchy/cross/i686-windows-gcc48/libexec/gcc/i686-w64-mingw32/4.8.2/lto-wrapper
Target: i686-w64-mingw32
Configured with:
/home/cauchy/vcs/svn/gcc/branches/gcc-4_8-branch/configure
--prefix=/home/cauchy/cross/i686-windows-gcc48
--with-sysroot=/home/cauchy/cross/i686-windows-gcc48
--build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu
--target=i686-w64-mingw32 --disable-multilib --disable-nls
--enable-checking=release --enable-languages=c,c++,fortran
--with-arch=x86-64 --with-tune=generic --with-fpmath=sse
Thread model: win32
gcc version 4.8.2 20130617 (prerelease) (GCC)


Here is my building script, just change $PATH, $GCC_SRC_ROOT and
$MINGW_W64_SRC_ROOT, gcc 4.7 is fine.

cauchy@dre-syslog:~/src$ cat cross-native-win32-thin.sh

export GCC_SRC_ROOT=${HOME}/vcs/svn/gcc/branches/gcc-4_8-branch
export MINGW_W64_SRC_ROOT=${HOME}/vcs/svn/mingw-w64/trunk

export GCC_DATE_STR=`cat ${GCC_SRC_ROOT}/gcc/DATESTAMP`
export GCC_BASE_VER=`cat ${GCC_SRC_ROOT}/gcc/BASE-VER`

export ZLIB_SRC_ROOT=${HOME}/src/zlib-1.2.8
export EXPAT_SRC_ROOT=${HOME}/src/expat-2.1.0
export GMP_SRC_ROOT=${HOME}/src/gmp-5.1.2
export MPFR_SRC_ROOT=${HOME}/src/mpfr-3.1.2
export MPC_SRC_ROOT=${HOME}/src/mpc-1.0.1
export BINUTILS_SRC_ROOT=${HOME}/src/binutils-2.23.2
export GDB_SRC_ROOT=${HOME}/src/gdb-7.6
export MAKE_SRC_ROOT=${HOME}/src/make-3.82

export NR_JOBS=`cat /proc/cpuinfo | grep '^processor\s*:' | wc -l`
export BUILD_TRIPLET=`/usr/share/misc/config.guess`
export TARGET_TRIPLET=i686-w64-mingw32
export LOGGER_TAG=native-win32-gcc48
export SYS_ROOT=${HOME}/native/gcc-4.8-win32
export SYS_3RD_ROOT=${HOME}/native/gcc-4.8-win32-3rd
export OBJ_ROOT=${HOME}/obj/native/gcc-4.8-win32
export PATH=${HOME}/cross/i686-windows-gcc48/bin:/usr/sbin:/usr/bin:/sbin:/bin

logger -t ${LOGGER_TAG} -s Build started