Login | Register
Login | Register

My pages Projects SunSource.net openCollabNet
OpenSPARC.net >  Cool Tools >  GCC for SPARC® Systems >  FAQ

Cool Tools - GCC for SPARC® Systems - FAQ

Questions

  1. Where do I get support?
  2. What is the -xbinopt=prepare option?
  3. What GCC optimization levels are equivalent to the SunStudio optimization levels?
  4. What is the path to add to the environment variable PATH for the compilers?
  5. How to build GCCfss from sources ?
  6. ld: fatal: invalid relocation type: 0x52 ?
  7. Is GCC For SPARC Systems suitable for use in a production environment?

Answers

1.Q: Where do I get support?
A:  Reporting Bugs
Use the GCCFSS Forum to report problems and suggestions for improvements.

Use the Forum
The GCCFSS Forum. will be used to announce new releases of GCC for SPARC Systems. The Forum will also be used for a dialog on all aspects of the use of GCC for SPARC Systems and its results.

2.Q: What is the -xbinopt=prepare option?
A:  Please see this page

3.Q: What GCC optimization levels are equivalent to the SunStudio optimization levels?
A:  The SunStudio optimization levels are specified by the -xO command line option. These options are not accepted by GCC for SPARC Systems. Instead GCC for SPARC Systems uses -O options. The rough equivalence between them is specified in the following table.

SunStudio 11 and 12 optimization levels
Equivalent GCC for SPARC Systems 4.0.4 optimization level
-xO0
-O0
-xO1
-O0
-xO2
-O0
-xO3 and -O
-O, -O1 and -O2
-xO4
-O3
-xO5
-O3
-fast
-fast

4.Q: What is the path to add to the environment variable PATH for the compilers?
A:  GCCfss 4.0.4 can be installed in any location. GCCfss 4.0.3 packages are installed in /opt/gcc/bin

5.Q: How to build GCCfss 4.0.3 from sources ?
A:

Follow the following steps:

  1. Make sure that SUNW0scgfss 4.0.3 package is already installed in /opt/SUNW0scgfss/
    This location is forcing GCCfss 4.0.3 to be in /opt/gcc/
    (GCCfss 4.0.4 is relocatable and can be installed in any location)
    If you want an alternative location for your newly built GCCfss replace 'opt' in all the pathes to your own directory and move SUNW0scgfss directory there
  2. create a build directory
  3. run 'configure' script from GCCfss sources in your build directory:
    /gccfss_source_dir/configure --prefix=/opt/gcc/ --enable-shared --with-system-zlib --enable-checking=release --disable-libmudflap --enable-version-specific-runtime-libs --with-gxx-include-dir=/opt/gcc/include/c++/4.0.3 --with-cpu=v9 --enable-languages=c,c++
  4. gmake or gmake bootstrap
  5. gmake install-gcc install-target-libstdc++-v3
  6. Have fun!

NOTES:

  • All these steps assume that the person trying to build GCCfss is familiar with plain gcc build process
  • The GCCfss build process is setup to find some components from $prefix_dir/../SUNW0scgfss/... directory, so step #1 is important
  • Missing libsunir.so and lib_I_dbg_gen.so libraries during the linking phase of cc1/cc1plus indicate incorrectness in step #1
  • GCCfss can be built with already installed GCCfss or with plain GCC 4.0.x
  • GCCfss configured and build on Solaris 10 will only work properly on Solaris 10 (just like plain GCC compiler), but you can install Solaris 9 and Solaris 10 versions of GCCfss into the same install directory and GCCfss driver will pick up the corrent version in the run-time

6.Q: ld: fatal: invalid relocation type: 0x52 ?
A:

If you're seeing the following error message trying to compile any program with GCCfss:
ld: fatal: relocation error: file /opt/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.3/crtbegin.o: section .rela.text: invalid relocation type: 0x52
That most probably means that you don't have required linker patches installed.

The required patches are: http://cooltools.sunsource.net/gcc/4.0.3/ReleaseNotes.html#patches
It's best to use the latest linker patch which is 112963-29: http://sunsolve.central.sun.com/cgi/pdownload.pl?target=112963-29&method=h

7.Q: Is GCC For SPARC Systems suitable for use in a production environment?
A:Yes, GCC For SPARC Systems is suitable for use in a production environment.

  • We support GCCFSS through the GCCFSS Forum. We respond promptly to bug reports and questions on the GCCFSS Forum.
  • Minor bug fixes will typically be fixed in the next update of the product.
  • Patches will occasionally be announded for high priority problems when the problem is considered of general interest. Patch announements will be made on the GCCFSS Forum and have the word "patch" in the subject line.