--- gcc/config/openbsd-libpthread.h.orig Sun Sep 27 09:20:23 2009 +++ gcc/config/openbsd-libpthread.h Sat Aug 25 09:50:23 2012 @@ -18,5 +18,5 @@ along with GCC; see the file COPYING3. If not see . */ -#define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread} -lc}" +#define OBSD_LIB_SPEC "%{pthread:-lpthread%{!shared:%{p|pg:_p}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"