Sun WorkShop Compiler C 5.0 User's Guide

-G

Passes the option to the link editor to produce a shared object rather than a dynamically linked executable. This option is passed to ld(1), and cannot be used with the -dn option.