The recommended build environment uses a patched Sun Studio version 12 to compile along side a patched Sun Studio 12.1 to provide the lint. Both compilers are available to download as tarballs from here:
Get GCC 3.4.3:
pkg install developer/gcc-3
Get CDE 1.7.0 from:
Get GNU gettext and other GNU tools from the SFW_147+ builds (or Sunfreeware).