How to static compile program?

I have written a simply code,but I can't compile it staticly.

My development tools is sun studio 11.

cc -g -xCC -c-o Sun-x86-Solaris/shellcode.o shellcode.c

cc -g -xCC-o Sun-x86-Solaris/a.out Sun-x86-Solaris/shellcode.o -Bstatic

ld: fatal: library -lc: not found

ld: fatal: File processing errors. No output written to Sun-x86-Solaris/a.out

*** Error code 1

Perhaps solaris 10 can't compile staticly.

[451 byte] By [teawater@vip.sina.coma] at [2007-11-27 9:59:21]
# 1

Static system libraries are no longer provided, starting with Solaris 10.

The reason is that programs linking a static system library from one release or patch level of Solaris cannot be guaranteed to work on a different release or patch level -- they may depend on system internals that are different.

Since every Solaris system has libraries that work correctly, there is never any need to link the libraries statically.

clamage45a at 2007-7-13 0:30:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
Sometimes I want to write secure code which need compile static,but how to ?
teawater@vip.sina.coma at 2007-7-13 0:30:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
Its not only impossible, it is also dangerous (that is, strictly speaking, if you plan to run your code on any other machine _or_ install patches on your machine).There's a good article about that: see http://blogs.sun.com/rie/date/20041206
MaximKartasheva at 2007-7-13 0:30:25 > top of Java-index,Development Tools,Solaris and Linux Development Tools...