diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index a4abc445a8795464ebcfab192b340ba02fb785c6..6e5b09fb5a0e9fcc60f4531c5b7af4c3e078ddf0 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-02  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	PR libgomp/26308
+	* config/posix/lock.c (_XOPEN_SOURCE): Don't define on Tru64 UNIX.
+
 2007-06-21  Jakub Jelinek  <jakub@redhat.com>
 
 	PR middle-end/32362
diff --git a/libgomp/config/posix/lock.c b/libgomp/config/posix/lock.c
index 062174d32d564d57ecadf67d82b90b04e40a68e7..59459bb86ce6b9cbe9662a029a77ba137f050d61 100644
--- a/libgomp/config/posix/lock.c
+++ b/libgomp/config/posix/lock.c
@@ -33,8 +33,12 @@
    to do better and streamline the locking as well as reduce the size
    of the types exported.  */
 
-/* We need Unix98 extensions to get recursive locks.  */
+/* We need Unix98 extensions to get recursive locks.  On Tru64 UNIX V4.0F,
+   the declarations are available without _XOPEN_SOURCE, which actually
+   breaks compilation.  */
+#ifndef __osf__
 #define _XOPEN_SOURCE 500
+#endif
 
 #include "libgomp.h"