Comments on the gcc compiler, the libgcc packages, and their use.

Currently, all the packages on this site are built with the GNU gcc C compiler and related software. On this page, we will point to a few important issues users will need to know and show how the compiler package was created. Gcc can be built in many ways, we have chosen a fairly simple and standard way that works for building the large majority of software.

To use the gcc package from our site you MUST install all of the SUNW developer packages that come on Sun's Solaris Installation CDs/DVD.  Typically, if you have done a full install of the operating system, you will have these.

When you compile something with gcc, the executables may end up depending on one or more of the libraries in /usr/local/lib such as libgcc_s.so. An end user may need these libraries, but not want the entire gcc package. We have provided a package called libgcc for each level of Solaris. The libgcc packages contain all the files from /usr/local/lib generated by a gcc package installation. An end user can install this or a subset. You can determine if one of these libraries is needed by running ldd on an executable to see the library dependencies like libgcc,so or libstdc, etc.

The software used to create gcc 3.4.6 (the steps are very similar for earlier versions of gcc) was all taken from packages on UNIX Packages: gcc-3.3.2, bison-2.5, flex-2.5.35, texinfo-4.13a, autoconf-2.68, make-3.82, and automake-1.11.1. It may also be important to install the libiconv-1.14 package as it is a common dependency.

The configure step for building gcc can be found by typing

gcc -v

which gives

../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared

We choose to use the as and ld that come with Solaris and are usually in the /usr/ccs/bin directory. These files are only there if the SUNW developer packages from the Solaris CDs/DVD have been installed.

The package install puts a lot of files in /usr/local subdirectories) and the gcc and other executables in /usr/local/bin. You will need to put /usr/local/bin and /usr/ccs/bin in your PATH environment. /usr/local/lib should also be in your shell's library path.

There are differences between this version of gcc and previous 2.95.x versions on some much older Solaris systems. For details, go to


In particular, gcc-3.4.6 or higher offer support for the creation of 64-bit executables when the source code permits it. Programs like top, lsof, ipfilter, and others support, and may need, such compiles to work properly when running the 64-bit versions of Solaris 7, 8, and 9 on SPARC platforms. In some cases, simply using the -m64 flag for gcc during compiles (which may require either editing the Makefiles to add -m64 to CFLAGS or just doing gcc -m64 on command lines) works.

Detailed problems with gcc can be asked in the gnu.gcc.help newsgroup or related places.