Java 2 SDK for Solaris Developer's Guide

Linking Native Solaris Applications

You should link native Solaris applications with -lthread. Not doing so can cause incorrect behavior.

You must specify the libthread.so library (-lthread option) before the libc.so library (-lc option) when linking up native applications that use JNI. The Sun C compiler option -mt automatically adds the -lthread option, and the -lc option is typically not specified (it defaults to the end of the list). So when using Sun compilers or the Sun linker, you must supply either the -mt or the -lthread options.