diff --git a/gcc/config.gcc b/gcc/config.gcc
index ef37e61..6e03865 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -763,7 +763,7 @@ case ${target} in
   ;;
 *-*-rtems*)
   case ${enable_threads} in
-    yes) thread_file='rtems' ;;
+    yes) thread_file='posix' ;;
   esac
   extra_options="${extra_options} rtems.opt"
   default_use_cxa_atexit=yes
diff --git a/libgcc/config/t-rtems b/libgcc/config/t-rtems
index 85f1da9..11e0c64 100644
--- a/libgcc/config/t-rtems
+++ b/libgcc/config/t-rtems
@@ -1,4 +1,4 @@
 # If we are building next to newlib, this will let us find the RTEMS
 # limits.h when building libgcc2.  Otherwise, newlib must be installed
 # first.
-LIBGCC2_INCLUDES = -I$(srcdir)/../newlib/libc/sys/rtems/include
+LIBGCC2_INCLUDES = -I$(srcdir)/../newlib/libc/sys/rtems/include -I$(srcdir)/../newlib/libc/sys/rtems
diff --git a/libgcc/gthr-posix.h b/libgcc/gthr-posix.h
index f0d8cd7..6c2e544 100644
--- a/libgcc/gthr-posix.h
+++ b/libgcc/gthr-posix.h
@@ -110,7 +110,9 @@ __gthrw(pthread_detach)
 #ifndef __BIONIC__
 __gthrw(pthread_cancel)
 #endif
+#ifndef __rtems__
 __gthrw(sched_yield)
+#endif
 
 __gthrw(pthread_mutex_lock)
 __gthrw(pthread_mutex_trylock)
@@ -447,8 +449,10 @@ __gthread_objc_thread_get_priority (void)
 static inline void
 __gthread_objc_thread_yield (void)
 {
+#ifndef __rtems__
   if (__gthread_active_p ())
     __gthrw_(sched_yield) ();
+#endif
 }
 
 /* Terminate the current thread.  */
@@ -689,7 +693,9 @@ __gthread_self (void)
 static inline int
 __gthread_yield (void)
 {
+#ifndef __rtems__
   return __gthrw_(sched_yield) ();
+#endif
 }
 
 static inline int
