Hi,
I'm attempting to build gcc 4.0.0 on Solaris. I have been unable to build gcc or at least some of its components since the release of gcc 3.4.
Here are a few details on my system: - Solaris 8 7/01 - Sun's as/ld as: Sun WorkShop 6 99/08/18 ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.286 - GNU binutils 2.15
I've tried two approaches.
1) Using Sun's as/ld. I build gcc this way: cd /tmp gtar xjf ~/gcc-4.0.0.tar.bz2 mkdir gcc cd gcc setenv CONFIG_SHELL /bin/ksh /tmp/gcc-4.0.0/configure \ --prefix=/usr/local/gcc-4.0.0 gmake bootstrap
The build fails with the following message: ld: fatal: relocation error: R_SPARC_DISP32: file .libs/libstdc++.lax/libsupc++convenience.a/vterminate.o: symbol <unknown>: offset 0xfccd33ad is non-aligned
I've searched Google for this error and came across similar error messages without finding a solution:
http://gcc.gnu.org/ml/gcc-prs/2003-03/msg00497.html
Any clues?
2) Using GNU binutils. I build gcc this way: cd /tmp gtar xjf ~/gcc-4.0.0.tar.bz2 mkdir gcc cd gcc setenv CONFIG_SHELL /bin/ksh /tmp/gcc-4.0.0/configure \ --prefix=/usr/local/gcc-4.0.0 \ --with-as=/usr/local/binutils/bin/as \ --with-ld=/usr/local/binutils/bin/ld gmake bootstrap
The build fails while compiling the Java libraries with gcj. No error message appears because the oputput of gcj is discarded by the build system. Running the last command line manually, I get the following error message:
/tmp/GCC/gcc/gcj [...] -o java/lang/StrictMath.o
/tmp/ccMGENqa.s: Assembler messages:
/tmp/ccMGENqa.s:10374: Error: Illegal operands:
There are only 32 single precision f registers; [0-31]
I've found out this is a known issue with the current GNU binutils package. See for example:
http://lists.freebsd.org/pipermail/freebsd-sparc64/2005-March/002879.html
As far as I can understand, it's not possible to build gcc 4.0.0 and gcc 3.4.* using GNU binutils with current release 2.15 of GNU binutils. One has to use the CVS sources or at least one file.
Would it be possible to document this requirement in the platform pages? http://gcc.gnu.org/install/specific.html#sparc-sun-solaris2
Speaking of the sparc-sun-solaris2* platform, I read: GCC 3.4 changed the default debugging format from STABS to DWARF-2 for 32-bit code on Solaris 7 and later. If you are using the Sun assembler, this change apparently runs afoul of Sun bug 4910101, for which (as of 2004-05-23) there is no fix. A symptom of the problem is that you cannot compile C++ programs like groff 1.19.1 without getting messages similar to the following: ld: warning: relocation error: R_SPARC_UA32: ... external symbolic relocation against non-allocatable section .debug_info cannot be processed at runtime: relocation ignored. To work around this problem, compile with -gstabs+ instead of plain -g
I had a look at Sun Online Support and found: Bug ID: 4910101 Synopsis: fbe needs a way to reference section labels Category: compiler Subcategory: assembler-x86 Description: The bug was first found with the -misalign flag, but the real bug is because the code is being passed through the assembler. Integrated in releases: k2_dev Summary: fbe needs a way to reference section labels
Therefore :
1) This seems to be x86-specific, so I would suggest moving this paragraph from sparc-sun-solaris2* to i?86-*-solaris2*
2) It looks like there is a fix, however I don't know what k2_dev is, maybe this is an internal development version and the fix has not been relesed yet.
-- Dimitri Papadopoulos