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

[commits] r3831 - in /fsf/trunk/libc: ./ nptl/sysdeps/pthread/ sysdeps/i386/elf/ sysdeps/x86_64/ sysdeps/x86_64/elf/ time/



Author: eglibc
Date: Wed Oct 17 00:04:29 2007
New Revision: 3831

Log:
Import glibc-mainline for 2007-10-17

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/pthread/configure
    fsf/trunk/libc/sysdeps/i386/elf/configure
    fsf/trunk/libc/sysdeps/x86_64/elf/configure
    fsf/trunk/libc/sysdeps/x86_64/memset.S
    fsf/trunk/libc/time/strftime_l.c
    fsf/trunk/libc/time/tzfile.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Oct 17 00:04:29 2007
@@ -1,3 +1,30 @@
+2007-10-16  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* time/tzfile.c (__tzfile_read): Help the compiler recognize
+	unreachable code on 32-bit machines.
+
+2007-10-16  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	[BZ #5184]
+	* time/strftime_l.c: Include stdbool.h.
+	(my_strftime): New wrapper, old function renamed to...
+	(__strftime_internal): ... new function.  Add tzset_called
+	argument, pass it down to recursive calls, don't call tzset ()
+	if already true, set to true after call to tzset ().
+						
+2007-10-16  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* time/tzfile.c (__tzfile_read): Take extra memory requested by caller
+	into account when copying TZ string.
+
+2007-10-16  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/x86_64/memset.S (memset): Fix sse2_nt_move
+	PIC indirect jump.
+
+	* sysdeps/x86_64/memset.S: Jump from bzero to memset using
+	a local label rather than HIDDEN_JUMPTARGET.
+
 2007-10-15  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/x86_64/cacheinfo.c (__x86_64_shared_cache_size): Define.

Modified: fsf/trunk/libc/nptl/sysdeps/pthread/configure
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/pthread/configure (original)
+++ fsf/trunk/libc/nptl/sysdeps/pthread/configure Wed Oct 17 00:04:29 2007
@@ -24,8 +24,8 @@
 fi
 
 
-echo "$as_me:$LINENO: checking for forced unwind support" >&5
-echo $ECHO_N "checking for forced unwind support... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for forced unwind support" >&5
+echo $ECHO_N "checking for forced unwind support... $ECHO_C" >&6; }
 if test "${libc_cv_forced_unwind+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -48,39 +48,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   libc_cv_forced_unwind=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-libc_cv_forced_unwind=no
+	libc_cv_forced_unwind=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $libc_cv_forced_unwind" >&5
-echo "${ECHO_T}$libc_cv_forced_unwind" >&6
+{ echo "$as_me:$LINENO: result: $libc_cv_forced_unwind" >&5
+echo "${ECHO_T}$libc_cv_forced_unwind" >&6; }
 if test $libc_cv_forced_unwind = yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_FORCED_UNWIND 1
@@ -88,8 +85,8 @@
 
   old_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -Werror -fexceptions"
-  echo "$as_me:$LINENO: checking for C cleanup handling" >&5
-echo $ECHO_N "checking for C cleanup handling... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for C cleanup handling" >&5
+echo $ECHO_N "checking for C cleanup handling... $ECHO_C" >&6; }
 if test "${libc_cv_c_cleanup+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -113,39 +110,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   libc_cv_c_cleanup=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-libc_cv_c_cleanup=no
+	libc_cv_c_cleanup=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $libc_cv_c_cleanup" >&5
-echo "${ECHO_T}$libc_cv_c_cleanup" >&6
+{ echo "$as_me:$LINENO: result: $libc_cv_c_cleanup" >&5
+echo "${ECHO_T}$libc_cv_c_cleanup" >&6; }
   CFLAGS="$old_CFLAGS"
   if test $libc_cv_c_cleanup = no; then
     { { echo "$as_me:$LINENO: error: the compiler must support C cleanup handling" >&5

Modified: fsf/trunk/libc/sysdeps/i386/elf/configure
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/elf/configure (original)
+++ fsf/trunk/libc/sysdeps/i386/elf/configure Wed Oct 17 00:04:29 2007
@@ -4,8 +4,8 @@
 if test "$usetls" != no; then
 # Check for support of thread-local storage handling in assembler and
 # linker.
-echo "$as_me:$LINENO: checking for i386 TLS support" >&5
-echo $ECHO_N "checking for i386 TLS support... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for i386 TLS support" >&5
+echo $ECHO_N "checking for i386 TLS support... $ECHO_C" >&6; }
 if test "${libc_cv_386_tls+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -37,8 +37,8 @@
 fi
 rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $libc_cv_386_tls" >&5
-echo "${ECHO_T}$libc_cv_386_tls" >&6
+{ echo "$as_me:$LINENO: result: $libc_cv_386_tls" >&5
+echo "${ECHO_T}$libc_cv_386_tls" >&6; }
 if test $libc_cv_386_tls = yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_TLS_SUPPORT 1

Modified: fsf/trunk/libc/sysdeps/x86_64/elf/configure
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/elf/configure (original)
+++ fsf/trunk/libc/sysdeps/x86_64/elf/configure Wed Oct 17 00:04:29 2007
@@ -3,8 +3,8 @@
 
 if test "$usetls" != no; then
 # Check for support of thread-local storage handling in assembler and linker.
-echo "$as_me:$LINENO: checking for x86-64 TLS support" >&5
-echo $ECHO_N "checking for x86-64 TLS support... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for x86-64 TLS support" >&5
+echo $ECHO_N "checking for x86-64 TLS support... $ECHO_C" >&6; }
 if test "${libc_cv_x86_64_tls+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -33,8 +33,8 @@
 fi
 rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $libc_cv_x86_64_tls" >&5
-echo "${ECHO_T}$libc_cv_x86_64_tls" >&6
+{ echo "$as_me:$LINENO: result: $libc_cv_x86_64_tls" >&5
+echo "${ECHO_T}$libc_cv_x86_64_tls" >&6; }
 if test $libc_cv_x86_64_tls = yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_TLS_SUPPORT 1

Modified: fsf/trunk/libc/sysdeps/x86_64/memset.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/memset.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/memset.S Wed Oct 17 00:04:29 2007
@@ -24,7 +24,7 @@
 ENTRY (bzero)
 	mov	%rsi,%rdx	/* Adjust parameter.  */
 	xorl	%esi,%esi	/* Fill with 0s.  */
-	jmp	HIDDEN_JUMPTARGET (memset)
+	jmp	L(memset_entry)
 END (bzero)
 
 #if defined PIC && !defined NOT_IN_libc
@@ -35,6 +35,7 @@
 #endif
 
 ENTRY (memset)
+L(memset_entry):
 	cmp    $0x1,%rdx
 	mov    %rdi,%rax	/* memset returns the dest address.  */
 	jne    L(ck2)
@@ -914,7 +915,7 @@
 #else
 	movslq (%r11,%r8,4),%rcx
 	lea   (%rcx,%r11,1),%r11
-	jmpq   *(%r11)
+	jmpq   *%r11
 #endif
 
 	.balign     16

Modified: fsf/trunk/libc/time/strftime_l.c
==============================================================================
--- fsf/trunk/libc/time/strftime_l.c (original)
+++ fsf/trunk/libc/time/strftime_l.c Wed Oct 17 00:04:29 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2004, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -84,6 +84,7 @@
 # include <stddef.h>
 # include <stdlib.h>
 # include <string.h>
+# include <stdbool.h>
 #else
 # ifndef HAVE_MEMCPY
 #  define memcpy(d, s, n) bcopy ((s), (d), (n))
@@ -453,27 +454,9 @@
 # define ut 0
 #endif
 
-#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
-  /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
-     Work around this bug by copying *tp before it might be munged.  */
-  size_t _strftime_copytm (char *, size_t, const char *,
-			   const struct tm * ut_argument_spec_iso) __THROW;
-  size_t
-  my_strftime (s, maxsize, format, tp ut_argument)
-      CHAR_T *s;
-      size_t maxsize;
-      const CHAR_T *format;
-      const struct tm *tp;
-      ut_argument_spec
-  {
-    struct tm tmcopy;
-    tmcopy = *tp;
-    return _strftime_copytm (s, maxsize, format, &tmcopy ut_argument);
-  }
-# undef my_strftime
-# define my_strftime _strftime_copytm
-#endif
-
+static size_t __strftime_internal (CHAR_T *, size_t, const CHAR_T *,
+				   const struct tm *, bool ut_argument_spec_iso
+				   LOCALE_PARAM_PROTO) __THROW;
 
 /* Write information from TP into S according to the format
    string FORMAT, writing no more that MAXSIZE characters
@@ -481,12 +464,38 @@
    characters written.  If S is NULL, nothing will be written
    anywhere, so to determine how many characters would be
    written, use NULL for S and (size_t) UINT_MAX for MAXSIZE.  */
+
 size_t
 my_strftime (s, maxsize, format, tp ut_argument LOCALE_PARAM)
+     CHAR_T *s;
+     size_t maxsize;
+     const CHAR_T *format;
+     const struct tm *tp;
+     ut_argument_spec
+     LOCALE_PARAM_DECL
+{
+#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
+  /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
+     Work around this bug by copying *tp before it might be munged.  */
+  struct tm tmcopy;
+  tmcopy = *tp;
+  tp = &tmcopy;
+#endif
+  return __strftime_internal (s, maxsize, format, tp, false
+			      ut_argument LOCALE_ARG);
+}
+#ifdef _LIBC
+libc_hidden_def (my_strftime)
+#endif
+
+static size_t
+__strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
+		     LOCALE_PARAM)
       CHAR_T *s;
       size_t maxsize;
       const CHAR_T *format;
       const struct tm *tp;
+      bool tzset_called;
       ut_argument_spec
       LOCALE_PARAM_DECL
 {
@@ -559,7 +568,9 @@
       /* POSIX.1 requires that local time zone information is used as
 	 though strftime called tzset.  */
 # if HAVE_TZSET
-      tzset ();
+      if (!tzset_called)
+	tzset ();
+      tzset_called = true;
 # endif
     }
 #endif
@@ -834,10 +845,12 @@
 	subformat:
 	  {
 	    CHAR_T *old_start = p;
-	    size_t len = my_strftime (NULL, (size_t) -1, subfmt,
-				      tp ut_argument LOCALE_ARG);
-	    add (len, my_strftime (p, maxsize - i, subfmt,
-				   tp ut_argument LOCALE_ARG));
+	    size_t len = __strftime_internal (NULL, (size_t) -1, subfmt,
+					      tp, tzset_called ut_argument
+					      LOCALE_ARG);
+	    add (len, __strftime_internal (p, maxsize - i, subfmt,
+					   tp, tzset_called ut_argument
+					   LOCALE_ARG));
 
 	    if (to_uppcase)
 	      while (old_start < p)
@@ -1409,9 +1422,6 @@
     *p = L_('\0');
   return i;
 }
-#ifdef _LIBC
-libc_hidden_def (my_strftime)
-#endif
 
 
 #ifdef emacs

Modified: fsf/trunk/libc/time/tzfile.c
==============================================================================
--- fsf/trunk/libc/time/tzfile.c (original)
+++ fsf/trunk/libc/time/tzfile.c Wed Oct 17 00:04:29 2007
@@ -243,7 +243,7 @@
 		& ~(__alignof__ (struct leap) - 1));
   leaps_idx = total_size;
   total_size += num_leaps * sizeof (struct leap);
-  tzspec_len = (trans_width == 8
+  tzspec_len = (sizeof (time_t) == 8 && trans_width == 8
 		? st.st_size - (ftello (f)
 				+ num_transitions * (8 + 1)
 				+ num_types * 6
@@ -263,14 +263,14 @@
   types = (struct ttinfo *) ((char *) transitions + types_idx);
   zone_names = (char *) types + num_types * sizeof (struct ttinfo);
   leaps = (struct leap *) ((char *) transitions + leaps_idx);
-  if (trans_width == 8)
-    tzspec = (char *) leaps + num_leaps * sizeof (struct leap);
+  if (sizeof (time_t) == 8 && trans_width == 8)
+    tzspec = (char *) leaps + num_leaps * sizeof (struct leap) + extra;
   else
     tzspec = NULL;
   if (extra > 0)
     *extrap = (char *) &leaps[num_leaps];
 
-  if (sizeof (time_t) == 4 || trans_width == 8)
+  if (sizeof (time_t) == 4 || __builtin_expect (trans_width == 8, 1))
     {
       if (__builtin_expect (fread_unlocked (transitions, trans_width + 1,
 					    num_transitions, f)
@@ -596,7 +596,7 @@
 	  if (tzspec == NULL)
 	    {
 	    use_last:
-	      i = num_transitions - 1;
+	      i = num_transitions;
 	      goto found;
 	    }
 
@@ -666,7 +666,8 @@
 	  i = hi;
 
 	found:
-	  /* assert (timer >= transitions[i - 1] && timer < transitions[i]); */
+	  /* assert (timer >= transitions[i - 1]
+	     && (i == num_transitions || timer < transitions[i])); */
 	  __tzname[types[type_idxs[i - 1]].isdst]
 	    = __tzstring (&zone_names[types[type_idxs[i - 1]].idx]);
 	  size_t j = i;