http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-04 20:57:34 UTC --- _PTHREADS gets defined immediately above that test: target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'` case $target_thread_file in posix) CXXFLAGS="$CXXFLAGS -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK -D_PTHREADS" esac If you're using --enable-thread=posix then it should be defined. pthread_mutex_timedlock is part of the POSIX Threads and Timeouts options, and if that option is supported then _POSIX_TIMEOUTS must be defined. http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_mutex_timedlock.html