views:

674

answers:

2

I am attempting to compile gcc 4.4.0 on opensolaris 2009.6

Currently in the box (which is a AMD 64bit machine), I have the gcc 3.4.6 installed.

I unpacked the gcc 4.4.0 tarball.

I set the following env variables:

export CXX=/usr/local/bin/g++
export CC=/usr/local/bin/gcc

Then I ran "configure && make" and this is the error message that I got:

checking for i386-pc-solaris2.11-gcc... /export/home/me/wd/gcc/gcc-4.4.0/host-i386-pc-solaris2.11/gcc/xgcc -B/export/home/me/wd/gcc/gcc-4.4.0/host-i386-pc-solaris2.11/gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ -isystem /usr/local/i386-pc-solaris2.11/include -isystem /usr/local/i386-pc-solaris2.11/sys-include  -m64
checking for suffix of object files... configure: error: in `/export/home/me/wd/gcc/gcc-4.4.0/i386-pc-solaris2.11/amd64/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

Anyone has any suggestion as to how to work around this error message?

/Edit: Content of the config.log is posted here: link text

+2  A: 

Normally the GCC build is bootstrapped, i.e. first it uses the system compiler to build GCC C compiler, and then it uses the freshly built compiler to recompile GCC once again (and then even once more time again). The configure line shows that it is not the system compiler but the already-built GCC compiler which is used for configure test there.

Since it fails, the problem is that the freshly-built GCC is somehow "stillborn" here. If config.log will not help you, I'd suggest to ask at [email protected].

EDIT: Ah-ha, I think it is the assembler. You are using GNU assembler, but the unsupported options look like they were meant for Sun assembler. This should be solved by adding --with-gnu-as configure option (and then possibly having to specify its path explicitly with --with-as=/usr/gnu/bin/as)

You can also take a look at Solaris-specific GCC build instructions.

Laurynas Biveinis
When i go through the config.log, I pick up this line:/usr/gnu/bin/as: unrecognized option `-xarch=generic64'Don't know if it is related...
Anthony Kong
I think Kastaurya is spot on. Depending on your configuration, you may also want to check the --with-gnu-ld option.
David Cournapeau
+1  A: 

There's a readily available build for gcc4, which you can try updating. Its current version is 4.3.3. To get started, install pkg-get from OpenCSW and check out the build from the subversion repository:

svn co https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/gcc4/trunk/ gcc4
cd gcc4
gmake package
automatthias