If you go to www.sunfreeware.org you can grab the GCC suite prebuilt for Solaris. I don't know about Sun's CC, though.
I use their GNU make / GCC / etc packages on Solaris 9 with no problems (most of the packages are for Solaris 8 but
will work on both versions). One thing you definitely should grab from their site while you're there is the GNU version
of tar. Sun's tar has some problems with long filenames. Same goes for GNU make.