[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r6011 - in glibc-package/branches/eglibc-2.19/debian: . patches patches/hurd-i386



Author: sthibault
Date: 2014-04-04 23:00:20 +0000 (Fri, 04 Apr 2014)
New Revision: 6011

Added:
   glibc-package/branches/eglibc-2.19/debian/patches/hurd-i386/cvs-libpthread-pthread_condattr_setclock.diff
Removed:
   glibc-package/branches/eglibc-2.19/debian/patches/hurd-i386/libpthread_nort.diff
Modified:
   glibc-package/branches/eglibc-2.19/debian/changelog
   glibc-package/branches/eglibc-2.19/debian/patches/series
Log:
Fix pthread_condattr_setclock for glib2.0

  * patches/hurd-i386/libpthread_nort.diff: Remove patch, replaced by...
  * patches/hurd-i386/cvs-libpthread-pthread_condattr_setclock.diff: Fix for
    pthread_condattr_setclock, for glib2.0 build.


Modified: glibc-package/branches/eglibc-2.19/debian/changelog
===================================================================
--- glibc-package/branches/eglibc-2.19/debian/changelog	2014-04-04 22:47:58 UTC (rev 6010)
+++ glibc-package/branches/eglibc-2.19/debian/changelog	2014-04-04 23:00:20 UTC (rev 6011)
@@ -78,6 +78,9 @@
   [ Samuel Thibault ]
   * patches/hurd-i386/tg-mmap_file_prot_none_fix.diff: New patch, fixes locale
     generation.
+  * patches/hurd-i386/libpthread_nort.diff: Remove patch, replaced by...
+  * patches/hurd-i386/cvs-libpthread-pthread_condattr_setclock.diff: Fix for
+    pthread_condattr_setclock, for glib2.0 build.
 
  -- Aurelien Jarno <aurel32@debian.org>  Sun, 02 Mar 2014 16:19:49 +0100
 

Copied: glibc-package/branches/eglibc-2.19/debian/patches/hurd-i386/cvs-libpthread-pthread_condattr_setclock.diff (from rev 6010, glibc-package/trunk/debian/patches/hurd-i386/cvs-libpthread-pthread_condattr_setclock.diff)
===================================================================
--- glibc-package/branches/eglibc-2.19/debian/patches/hurd-i386/cvs-libpthread-pthread_condattr_setclock.diff	                        (rev 0)
+++ glibc-package/branches/eglibc-2.19/debian/patches/hurd-i386/cvs-libpthread-pthread_condattr_setclock.diff	2014-04-04 23:00:20 UTC (rev 6011)
@@ -0,0 +1,43 @@
+commit a0e2516e0f10619ef708109ff3bc6b54b44d4193
+Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date:   Fri Apr 4 20:39:08 2014 +0200
+
+    Use only clock_gettime, do not depend on librt
+    
+    clock_gettime is actually provided by libc, not librt, so we don't need
+    the latter, and thus avoid the librt dependency, which would cause
+    initialization issues.
+    
+    * sysdeps/generic/pt-condattr-setclock.c (pthread_condattr_setclock):
+    Use clock_gettime instead of clock_getres to test for clock
+    availability.
+    * Makefile: Do not link against librt.
+
+diff --git a/libpthread/Makefile b/libpthread/Makefile
+index 8ef990e..2f45c1c 100644
+--- a/libpthread/Makefile
++++ b/libpthread/Makefile
+@@ -216,10 +216,8 @@ VPATH += $(SYSDEP_PATH)
+ 
+ ifeq ($(IN_GLIBC),no)
+ HURDLIBS = ihash
+-LDLIBS = -lrt
+ else
+ LDLIBS-pthread.so = -lihash
+-$(objpfx)libpthread.so: $(common-objpfx)rt/librt.so
+ endif
+ 
+ ifeq ($(IN_GLIBC),no)
+diff --git a/libpthread/sysdeps/generic/pt-condattr-setclock.c b/sysdeps/generic/pt-condattr-setclock.c
+index c5a78ef..c8ac4ce 100644
+--- a/libpthread/sysdeps/generic/pt-condattr-setclock.c
++++ b/libpthread/sysdeps/generic/pt-condattr-setclock.c
+@@ -35,7 +35,7 @@ pthread_condattr_setclock (pthread_condattr_t *attr, clockid_t clock)
+ 	  struct timespec ts;
+ 	  int res;
+ 
+-	  res = clock_getres (CLOCK_MONOTONIC, &ts);
++	  res = clock_gettime (CLOCK_MONOTONIC, &ts);
+ 	  avail = res < 0 ? -1 : 1;
+ 	}
+ 

Deleted: glibc-package/branches/eglibc-2.19/debian/patches/hurd-i386/libpthread_nort.diff
===================================================================
--- glibc-package/branches/eglibc-2.19/debian/patches/hurd-i386/libpthread_nort.diff	2014-04-04 22:47:58 UTC (rev 6010)
+++ glibc-package/branches/eglibc-2.19/debian/patches/hurd-i386/libpthread_nort.diff	2014-04-04 23:00:20 UTC (rev 6011)
@@ -1,109 +0,0 @@
-Revert
-
-commit 69e89a859882e4f675dd5491edc969159d8a4002
-Author: Pino Toscano <toscano.pino@tiscali.it>
-Date:   Sun Apr 22 00:38:26 2012 +0200
-
-    __pthread_timedblock: switch to clock_gettime
-    
-    Use `clock_gettime' with the provided clock instead of `gettimeofday',
-    linking to rt.
-    
-    * sysdeps/mach/pt-timedblock.c (__pthread_timedblock): Switch to
-    `clock_gettime'.
-    * Makefile [!IN_GLIBC] (LDLIBS): Link to rt.
-    [IN_GLIBC] ($(objpfx)libpthread.so): Likewise.
-    * Makefile.am (libpthread_a_LDADD): Likewise.
-
----
- libpthread/Makefile                               |    2 -
- libpthread/sysdeps/generic/pt-condattr-setclock.c |   27 +++-------------------
- libpthread/sysdeps/mach/pt-timedblock.c           |   13 +++++-----
- 4 files changed, 11 insertions(+), 33 deletions(-)
-
---- a/libpthread/Makefile
-+++ b/libpthread/Makefile
-@@ -216,10 +216,8 @@ VPATH += $(SYSDEP_PATH)
- 
- ifeq ($(IN_GLIBC),no)
- HURDLIBS = ihash
--LDLIBS = -lrt
- else
- LDLIBS-pthread.so = -lihash
--$(objpfx)libpthread.so: $(common-objpfx)rt/librt.so
- endif
- 
- ifeq ($(IN_GLIBC),no)
---- a/libpthread/sysdeps/mach/pt-timedblock.c
-+++ b/libpthread/sysdeps/mach/pt-timedblock.c
-@@ -36,26 +36,27 @@ __pthread_timedblock (struct __pthread *
-   error_t err;
-   mach_msg_header_t msg;
-   mach_msg_timeout_t timeout;
--  struct timespec now;
-+  struct timeval now;
- 
-   /* We have an absolute time and now we have to convert it to a
-      relative time.  Arg.  */
- 
--  err = clock_gettime (clock_id, &now);
-+  err = gettimeofday(&now, NULL);
-   assert (! err);
- 
-   if (now.tv_sec > abstime->tv_sec
-       || (now.tv_sec == abstime->tv_sec
--	  && now.tv_nsec > abstime->tv_nsec))
-+	  && now.tv_usec > ((abstime->tv_nsec + 999) / 1000)))
-     return ETIMEDOUT;
- 
-   timeout = (abstime->tv_sec - now.tv_sec) * 1000;
- 
--  if (abstime->tv_nsec >= now.tv_nsec)
--    timeout += (abstime->tv_nsec - now.tv_nsec + 999999) / 1000000;
-+  if (((abstime->tv_nsec + 999) / 1000) >= now.tv_usec)
-+    timeout += (((abstime->tv_nsec + 999) / 1000) - now.tv_usec + 999) / 1000;
-   else
-     /* Need to do a carry.  */
--    timeout -= (now.tv_nsec - abstime->tv_nsec + 999999) / 1000000;
-+    timeout -= (now.tv_usec + 999) / 1000 -
-+      ((abstime->tv_nsec + 999999) / 1000000);
- 
-   err = __mach_msg (&msg, MACH_RCV_MSG | MACH_RCV_TIMEOUT, 0,
- 		    sizeof msg, thread->wakeupmsg.msgh_remote_port,
---- a/libpthread/sysdeps/generic/pt-condattr-setclock.c
-+++ b/libpthread/sysdeps/generic/pt-condattr-setclock.c
-@@ -23,30 +23,11 @@
- int
- pthread_condattr_setclock (pthread_condattr_t *attr, clockid_t clock)
- {
--  /* Only a few clocks are allowed.  CLOCK_REALTIME is always allowed.
--     CLOCK_MONOTONIC only if the kernel has the necessary support.  */
--  if (clock == CLOCK_MONOTONIC)
-+  if (__pthread_default_condattr.clock == clock)
-     {
--      /* Check whether the clock is available.  */
--      static int avail;
--
--      if (avail == 0)
--	{
--	  struct timespec ts;
--	  int res;
--
--	  res = clock_getres (CLOCK_MONOTONIC, &ts);
--	  avail = res < 0 ? -1 : 1;
--	}
--
--      if (avail < 0)
--	/* Not available.  */
--	return EINVAL;
-+      attr->clock = clock;
-+      return 0;
-     }
--  else if (clock != CLOCK_REALTIME)
--    return EINVAL;
--
--  attr->clock = clock;
- 
--  return 0;
-+  return EINVAL;
- }

Modified: glibc-package/branches/eglibc-2.19/debian/patches/series
===================================================================
--- glibc-package/branches/eglibc-2.19/debian/patches/series	2014-04-04 22:47:58 UTC (rev 6010)
+++ glibc-package/branches/eglibc-2.19/debian/patches/series	2014-04-04 23:00:20 UTC (rev 6011)
@@ -95,7 +95,7 @@
 hurd-i386/libpthread_sigmask.diff
 hurd-i386/libpthread_clean.diff
 hurd-i386/tg-libpthread_depends.diff
-hurd-i386/libpthread_nort.diff
+hurd-i386/cvs-libpthread-pthread_condattr_setclock.diff
 hurd-i386/libpthread_version.diff
 hurd-i386/tg-chflags.diff
 hurd-i386/submitted-exec_filename.diff


Reply to: