2

Because default GCC in Cygwin is 4.5.3, I tried to install GCC 4.7.2. I have dowloaded tar.bz archive from here, put it to cygwin\usr\gcc-4.7.2 and proceed the following sequence:

tar xvf gcc-4.7.2.tar.bz2
cd gcc-4.7.2
./contrib/download_prerequisites
mkdir build
cd build
../configure --build=x86_64-linux-gnu --prefix=/usr/gcc-4.7.2 --enable-checking=release --enable-languages=c,c++ --disable-multilib --program-suffix=-4.7
make
sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64
sudo make install

I stucked at make with the following error: (after more than one hour)

make[3]: Leaving directory `/usr/gcc-4.7.2/build/gcc'
mkdir -p -- x86_64-linux-gnu/libgcc
Checking multilib configuration for libgcc...
Configuring stage 1 in x86_64-linux-gnu/libgcc
configure: creating cache ./config.cache
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking for x86_64-linux-gnu-ar... ar
checking for x86_64-linux-gnu-lipo... lipo
checking for x86_64-linux-gnu-nm... /usr/gcc-4.7.2/build/./gcc/nm
checking for x86_64-linux-gnu-ranlib... ranlib
checking for x86_64-linux-gnu-strip... strip
checking whether ln -s works... yes
checking for x86_64-linux-gnu-gcc... /usr/gcc-4.7.2/build/./gcc/xgcc -B/usr/gcc-4.7.2/build/./gcc/ -B/usr/gcc-4.7.2/x86_64-linux-gnu/bin/ -B/usr/gcc-4.7.2/x86_64-linux-gnu/lib/ -isystem /usr/gcc-4.7.2/x86_64-linux-gnu/include -isystem /usr/gcc-4.7.2/x86_64-linux-gnu/sys-include
checking for suffix of object files... configure: error: in `/usr/gcc-4.7.2/build/x86_64-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
Makefile:15654: recipe for target `configure-stage1-target-libgcc' failed
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/usr/gcc-4.7.2/build'
Makefile:19334: recipe for target `stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/usr/gcc-4.7.2/build'
Makefile:903: recipe for target `all' failed
make: *** [all] Error 2

Does this log contain enoung information, to say what went wrong?

The full log is much more bigger so I allowed myself to put only the part of him. The instruction that I used, I found on Pastebin: http://pastebin.com/1MBaAikB

Could anyone give me a tip how could I solve this problem?

EDIT 1: I trieid to achieve it in annother way. I found an installation description on http://matpack.de/cygwin/index.html

tar -xf gcc-4.7.2.tar.bz2
mkdir gcc-build
cd gcc-build
../gcc-4.7.2/configure --enable-languages=c,c++
make -j 4
make install
make clean          (OPTIONAL)
cd ..

The error that I got, is connected now with 'permission denided'. Error log: http://pastebin.com/0stdpFKf

How this is possible?

pidabrow
  • 966
  • 1
  • 21
  • 47
  • 2
    Can you chdir to "x86_64-linux-gnu/libgcc" and see the error message in config.log? – jclin Jan 17 '13 at 09:16
  • 1
    Running `../configure` is not supported. The build dir should be outside the source dir. `--enable-checking=release` is redundant for release sources, that's the default. You only need to add that if building a development snapshot or prerelease version. – Jonathan Wakely Jan 18 '13 at 01:13
  • @jclin I posted my config.log on pastebin: http://pastebin.com/UDqLMbGH – pidabrow Jan 20 '13 at 11:55
  • @Jonathan Wakely thanks, I'll try again with your tips – pidabrow Jan 20 '13 at 11:57
  • 1
    @piotr_dabrowski, I see you enable `--build=x86_64-linux-gnu`, but in the config.log, either `uname -m` or `/bin/arch` shows your machine is `i686`. And in `libgcc`, the error message is `Assembler messages: Fatal error: no compiled in support for x86_64`. So you should only enable for i686 build. – jclin Jan 20 '13 at 12:27
  • @JonathanWakely, if running ../configure is not supported, how could I generate Makefile in another way? – pidabrow Jan 21 '13 at 16:45
  • @jclin, I tried with i686 but I still get an error. I pasted config.log once again: http://pastebin.com/UKPtVqak – pidabrow Jan 21 '13 at 16:46
  • 1
    Obviously running `configure` is the way to generate a makefile, but _not_ in (a sub-directory of) the source tree. Create a separate directory and run `../gcc-4.7.2/configure` from that new directory instead. You should RTFM: http://gcc.gnu.org/install/configure.html and http://gcc.gnu.org/wiki/InstallingGCC – Jonathan Wakely Jan 21 '13 at 22:12
  • @JonathanWakely thanks, I'll check it out and try once again to install. – pidabrow Jan 21 '13 at 22:14
  • @piotr_dabrowski, the last config.log you posted is assembler error. Looks like your `as` in cygwin does not support the format of assembly file generated by GCC 4.7. So it was failed to pass libgcc configure test. So you may try to build your new GNU binutils. And running configure again like `env AS=/path/to/as /configure ...` – jclin Jan 22 '13 at 05:50

2 Answers2

1

I had come across the same problem. Just I have exported the library path of mpc, mpfr and gmp libraries to the LD_LIBRARY_PATH environment variable, then it is working.

Alvin
  • 940
  • 2
  • 13
  • 27
0

GCC 4.7.2 is now available as a test release. In setup.exe, toggle the version numbers for all the gcc4-* packages, as well as libgcc1, libstdc++6, etc., until a 4.7 version is shown. Just keep in mind that you will have to elect to Keep each of these again during subsequent runs of setup.exe, until such time that they are declared stable.

Yaakov
  • 1,705
  • 10
  • 10