The use of static executables is limited. See Static Executables. Static executables usually contain platform-specific implementation details that restricts the ability of the executable to be run on an alternative platform. Many implementations of Solaris OS libraries depend on dynamic linking capabilities, such as dlopen(3C) and dlsym(3C). See Loading Additional Objects. These capabilities are not available to static executables.
To create a static executable use the -d n option without the -r option:
$ cc -dn -o prog file1.o file2.o file3.o .....