When linking against libraries using the -l option (say -lfoo), gcc will prefer a shared object to a static library if both are found (will prefer
-l
-lfoo
It's dated, but may work: http://www.network-theory.co.uk/docs/gccintro/gccintro_25.html
(almost end of the page)
"As noted earlier, it is also possible to link directly with individual library files by specifying the full path to the library on the command line."