-   Linux - Software (
-   -   GCC 4.6.3+ on RedHat Enterprise 6 fails to build (

sriram87 09-14-2012 03:29 PM

GCC 4.6.3+ on RedHat Enterprise 6 fails to build
1 Attachment(s)
Dear members, I found an issue compiling gcc 4.6.3/ 4.7.1 on RHEL6 distro. The diagnostic message that we usually obtain when there is an error is seen as follows:


checking whether ln -s works... yes
checking for x86_64-unknown-linux-gnu-gcc... /usr/src/gcc-4.7.1/build/./gcc/xgcc -B/usr/src/gcc-4.7.1/build/./gcc/ -B/opt/gcc/gcc-4.7.1/x86_64-unknown-linux-gnu/bin/ -B/opt/gcc/gcc-4.7.1/x86_64-unknown-linux-gnu/lib/ -isystem /opt/gcc/gcc-4.7.1/x86_64-unknown-linux-gnu/include -isystem /opt/gcc/gcc-4.7.1/x86_64-unknown-linux-gnu/sys-include 
checking for suffix of object files... configure: error: in `/usr/src/gcc-4.7.1/build/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/usr/src/gcc-4.7.1/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/usr/src/gcc-4.7.1/build'
make: *** [all] Error 2

But, the config.log does'nt have any error log. I am attaching the config.log file for your reference.

This is the command-line entry I used for configuring the source

(reverse-i-search)`configure': ../configure --prefix=/opt/gcc/gcc-4.7.1/ --enable-cloog-backend=isl
I installed all the relevant add-ons that were required: such as gmp-4.3.2, mpfr-2.4.2, mpc-0.8.1, ppl-0.11, and cloog-0.16.1

My question is, has anybody tested this out before and/ or gcc 4.6.3 or 4.7.1 compile on RHEL?

knudfl 09-17-2012 11:10 AM

Gcc-4.6.3 example, CentOS 6.3 ( = RHEL 6.x ).
GCC requires a build directory outside the source directory gcc-4.6.3/.
I'd suggest : Unpack gmp-* mpfr-* mpc-* into gcc-4.6.3/, and rename to gmp, mpfr, mpc.
Then you will have no conflicts with the system versions, if different.

# yum install gmp-devel mpfr-devel ( Probably sufficient for gcc-4.6.3 ).

Configuring :
$ ../gcc-4.6.3/configure --prefix=/usr/local/gcc463 --program-suffix=46 --enable-languages=c,c++ --enable-threads=posix --enable-shared --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --with-system-zlib --with-mpfr-include=$(pwd)/../gcc-4.6.3/mpfr/src --with-mpfr-lib=$(pwd)/mpfr/src/.libs

$ make : I think the system version mpfr-2.4.1 was picked up as OK.
$ make : No errors. # make install : OK too.


sriram87 10-03-2012 10:17 AM

I followed all the instructions (even though I had a similar environment set up before, in which I had the build directory as a sub-directory to the gcc source -- hence the configure command) .

I am unable to build the source because, i get the following configure error:

configure: error: source directory already configured; run "make distclean" there first

However, if I do a make distclean, the Makefile will be deleted, and I have to start again by running configure. There is no resolution so far :(

knudfl 10-03-2012 10:28 AM

Not much to do but to start from scratch with a new unpacked

Once configured, the source cannot be reused.

Azrael84 12-01-2012 03:42 AM

sorry , please delete my post

All times are GMT -5. The time now is 12:40 PM.