This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.19-750-g3247f28


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  3247f28556d1de7f9837f6e9ee8c63fa56b93c13 (commit)
       via  d12704c78f04eb6c666143953e81dec89e1cadea (commit)
       via  05fdac772bee5352a52f26682dd351712e92f9b3 (commit)
       via  99f8dc922033821edcc13f9f8360e9fda40dfcff (commit)
      from  bc8ea38590070604006399e42469087e943fc8ec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3247f28556d1de7f9837f6e9ee8c63fa56b93c13

commit 3247f28556d1de7f9837f6e9ee8c63fa56b93c13
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Thu Jul 3 01:36:10 2014 +0530

    Sync up loadmsgcat.c with gettext

diff --git a/ChangeLog b/ChangeLog
index 049de91..9c00f72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2014-07-02  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	Sync up with gettext.
+	* intl/loadmsgcat.c: Define O_BINARY if not defined.
+	[_MSC_VER]: Include malloc.h
+	[_LIBC]: Define PRI_MACROS_BROKEN if it is not defined.
+	(get_sysdep_segment_value) [!__UCLIBC__]: Return "I" flag.
+	(_nl_load_domain): Open DOMAIN_FILE in binary mode.  Don't use
+	TEMP_FAILURE_RETRY.  Cast return of alloca.
+	[!_LIBC] Call gl_rwlock_init.
+	[IN_LIBGLOCALE]: Call _nl_find_msg with one less argument.
+
 2014-07-02  Roland McGrath  <roland@hack.frob.com>
 
 	* misc/sys/cdefs.h: Check if __STDC_VERSION__ is defined
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
index 7497172..2ea0f10 100644
--- a/intl/loadmsgcat.c
+++ b/intl/loadmsgcat.c
@@ -39,14 +39,19 @@
 # define alloca __builtin_alloca
 # define HAVE_ALLOCA 1
 #else
-# if defined HAVE_ALLOCA_H || defined _LIBC
-#  include <alloca.h>
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
 # else
-#  ifdef _AIX
- #pragma alloca
+#  if defined HAVE_ALLOCA_H || defined _LIBC
+#   include <alloca.h>
 #  else
-#   ifndef alloca
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifndef alloca
 char *alloca ();
+#    endif
 #   endif
 #  endif
 # endif
@@ -88,7 +93,17 @@ char *alloca ();
 #ifdef _LIBC
 # include "../locale/localeinfo.h"
 # include <not-cancel.h>
+#endif
+
+/* Handle multi-threaded applications.  */
+#ifdef _LIBC
 # include <bits/libc-lock.h>
+#else
+# include "lock.h"
+#endif
+
+#ifdef _LIBC
+# define PRI_MACROS_BROKEN 0
 #endif
 
 /* Provide fallback values for macros that ought to be defined in <inttypes.h>.
@@ -472,6 +487,24 @@ char *alloca ();
 # define freea(p) free (p)
 #endif
 
+/* For systems that distinguish between text and binary I/O.
+   O_BINARY is usually declared in <fcntl.h>. */
+#if !defined O_BINARY && defined _O_BINARY
+  /* For MSC-compatible compilers.  */
+# define O_BINARY _O_BINARY
+# define O_TEXT _O_TEXT
+#endif
+#ifdef __BEOS__
+  /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect.  */
+# undef O_BINARY
+# undef O_TEXT
+#endif
+/* On reasonable systems, binary I/O is the default.  */
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
+
 /* We need a sign, whether a new catalog was loaded, which can be associated
    with all translations.  This is important if the translations are
    cached by one of GCC's features.  */
@@ -732,10 +765,12 @@ get_sysdep_segment_value (const char *name)
   /* Test for a glibc specific printf() format directive flag.  */
   if (name[0] == 'I' && name[1] == '\0')
     {
-#if defined _LIBC || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
+#if defined _LIBC \
+    || ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) \
+        && !defined __UCLIBC__)
       /* The 'I' flag, in numeric format directives, replaces ASCII digits
 	 with the 'outdigits' defined in the LC_CTYPE locale facet.  This is
-	 used for Farsi (Persian) and maybe Arabic.  */
+	 used for Farsi (Persian), some Indic languages, and maybe Arabic.  */
       return "I";
 #else
       return "";
@@ -779,8 +814,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
 	   Not necessary anymore since if the lock is available this
 	   is finished.
       */
-      __libc_lock_unlock_recursive (lock);
-      return;
+      goto done;
     }
 
   domain_file->decided = -1;
@@ -798,7 +832,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
     goto out;
 
   /* Try to open the addressed file.  */
-  fd = open (domain_file->filename, O_RDONLY);
+  fd = open (domain_file->filename, O_RDONLY | O_BINARY);
   if (fd == -1)
     goto out;
 
@@ -846,11 +880,15 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
       read_ptr = (char *) data;
       do
 	{
-	  long int nb = (long int) TEMP_FAILURE_RETRY (read (fd, read_ptr,
-							     to_read));
+	  long int nb = (long int) read (fd, read_ptr, to_read);
 	  if (nb <= 0)
-	    goto out;
-
+	    {
+#ifdef EINTR
+	      if (nb == -1 && errno == EINTR)
+		continue;
+#endif
+	      goto out;
+	    }
 	  read_ptr += nb;
 	  to_read -= nb;
 	}
@@ -947,6 +985,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
 		  ((char *) data
 		   + W (domain->must_swap, data->sysdep_segments_offset));
 		sysdep_segment_values =
+		  (const char **)
 		  alloca (n_sysdep_segments * sizeof (const char *));
 		for (i = 0; i < n_sysdep_segments; i++)
 		  {
@@ -1244,13 +1283,24 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
   /* No caches of converted translations so far.  */
   domain->conversions = NULL;
   domain->nconversions = 0;
+#ifdef _LIBC
   __libc_rwlock_init (domain->conversions_lock);
+#else
+  gl_rwlock_init (domain->conversions_lock);
+#endif
 
   /* Get the header entry and look for a plural specification.  */
+#ifdef IN_LIBGLOCALE
+  nullentry =
+    _nl_find_msg (domain_file, domainbinding, NULL, "", &nullentrylen);
+#else
   nullentry = _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen);
+#endif
   if (__builtin_expect (nullentry == (char *) -1, 0))
     {
+#ifdef _LIBC
       __libc_rwlock_fini (domain->conversions_lock);
+#endif
       goto invalid;
     }
   EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals);
@@ -1261,6 +1311,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
 
   domain_file->decided = 1;
 
+ done:
   __libc_lock_unlock_recursive (lock);
 }
 

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d12704c78f04eb6c666143953e81dec89e1cadea

commit d12704c78f04eb6c666143953e81dec89e1cadea
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Thu Jul 3 01:32:17 2014 +0530

    Fix Wundef warning for __STDC_VERSION__
    
    c4c4124473c187b5c4642611390897666c3d3970 added the _Noreturn macro for
    pre-C11 compilers, but it now throws a new Wundef warning during `make
    check` for __STDC_VERSION__ which gcc does not define by default.  The
    following patch fixes this in line with other uses of __STDC_VERSION__
    in the file.

diff --git a/ChangeLog b/ChangeLog
index 7b33604..049de91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-07-02  Roland McGrath  <roland@hack.frob.com>
+
+	* misc/sys/cdefs.h: Check if __STDC_VERSION__ is defined
+	before checking its value.
+
 2014-07-02  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	* intl/loadmsgcat.c (_nl_load_domain): Use __builtin_expect.
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index a5c3224..04db956 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -382,7 +382,9 @@
 # define __glibc_likely(cond)	(cond)
 #endif
 
-#if !defined _Noreturn && __STDC_VERSION__ < 201112 && !__GNUC_PREREQ (4,7)
+#if (!defined _Noreturn \
+     && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
+     &&  !__GNUC_PREREQ (4,7))
 # if __GNUC_PREREQ (2,8)
 #  define _Noreturn __attribute__ ((__noreturn__))
 # else

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=05fdac772bee5352a52f26682dd351712e92f9b3

commit 05fdac772bee5352a52f26682dd351712e92f9b3
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Thu Jul 3 01:30:02 2014 +0530

    Don't use __glibc_unlikely in shared code

diff --git a/ChangeLog b/ChangeLog
index b523896..7b33604 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2014-07-02  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
+	* intl/loadmsgcat.c (_nl_load_domain): Use __builtin_expect.
+
 	* debug/memcpy_chk.c: Don't include pagecopy.h.
 	* debug/mempcpy_chk.c: Likewise.
 	* string/memcpy.c: Likewise.
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
index 325d699..7497172 100644
--- a/intl/loadmsgcat.c
+++ b/intl/loadmsgcat.c
@@ -820,7 +820,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
   data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
 					 MAP_PRIVATE, fd, 0);
 
-  if (__glibc_likely (data != MAP_FAILED))
+  if (__builtin_expect (data != MAP_FAILED, 1))
     {
       /* mmap() call was successful.  */
       close (fd);
@@ -1248,7 +1248,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
 
   /* Get the header entry and look for a plural specification.  */
   nullentry = _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen);
-  if (__glibc_unlikely (nullentry == (char *) -1))
+  if (__builtin_expect (nullentry == (char *) -1, 0))
     {
       __libc_rwlock_fini (domain->conversions_lock);
       goto invalid;

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=99f8dc922033821edcc13f9f8360e9fda40dfcff

commit 99f8dc922033821edcc13f9f8360e9fda40dfcff
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Thu Jul 3 01:28:45 2014 +0530

    Fix -Wundef warning on PAGE_COPY_THRESHOLD
    
    The PAGE_COPY_THRESHOLD macro is meant to be overridden by
    architecture-specific pagecopy.h, but it is currently done only by
    mach; all other architectures use the default.  Check to see if the
    macro is defined in addition to whether it is set to a non-zero value.

diff --git a/ChangeLog b/ChangeLog
index 06b31ff..b523896 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2014-07-02  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	* debug/memcpy_chk.c: Don't include pagecopy.h.
+	* debug/mempcpy_chk.c: Likewise.
+	* string/memcpy.c: Likewise.
+	* string/memmove.c: Likewise.
+	* sysdeps/powerpc/memmove.c: Likewise.
+	* sysdeps/generic/memcopy.h: Include pagecopy.h.  Move
+	definition of PAGE_COPY_FWD_MAYBE here...
+	* sysdeps/generic/pagecopy.h: ... from here.
+	* sysdeps/mach/pagecopy.h: Don't include generic pagecopy.h.
+
 2014-07-02  Vidya Ranganathan  <vidya@linux.vnet.ibm.com>
 	    Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
diff --git a/debug/memcpy_chk.c b/debug/memcpy_chk.c
index 9bf5d9f..539b7e2 100644
--- a/debug/memcpy_chk.c
+++ b/debug/memcpy_chk.c
@@ -20,7 +20,6 @@
 
 #include <string.h>
 #include <memcopy.h>
-#include <pagecopy.h>
 
 void *
 __memcpy_chk (dstpp, srcpp, len, dstlen)
diff --git a/debug/mempcpy_chk.c b/debug/mempcpy_chk.c
index 105356f..3ca916b 100644
--- a/debug/mempcpy_chk.c
+++ b/debug/mempcpy_chk.c
@@ -21,7 +21,6 @@
 
 #include <string.h>
 #include <memcopy.h>
-#include <pagecopy.h>
 
 void *
 __mempcpy_chk (dstpp, srcpp, len, dstlen)
diff --git a/string/memcpy.c b/string/memcpy.c
index c19bad3..517f9ee 100644
--- a/string/memcpy.c
+++ b/string/memcpy.c
@@ -20,7 +20,6 @@
 
 #include <string.h>
 #include <memcopy.h>
-#include <pagecopy.h>
 
 #undef memcpy
 
diff --git a/string/memmove.c b/string/memmove.c
index 3373401..22140ef 100644
--- a/string/memmove.c
+++ b/string/memmove.c
@@ -20,7 +20,6 @@
 
 #include <string.h>
 #include <memcopy.h>
-#include <pagecopy.h>
 
 /* All this is so that bcopy.c can #include
    this file after defining some things.  */
diff --git a/sysdeps/generic/memcopy.h b/sysdeps/generic/memcopy.h
index b39a960..45c5fcb 100644
--- a/sysdeps/generic/memcopy.h
+++ b/sysdeps/generic/memcopy.h
@@ -40,6 +40,7 @@
 
 #include <sys/cdefs.h>
 #include <endian.h>
+#include <pagecopy.h>
 
 /* The macros defined in this file are:
 
@@ -144,6 +145,47 @@ extern void _wordcopy_bwd_dest_aligned (long int, long int, size_t) __THROW;
       (nbytes_left) = (nbytes) % OPSIZ;					      \
     } while (0)
 
+/* The macro PAGE_COPY_FWD_MAYBE (dstp, srcp, nbytes_left, nbytes) is invoked
+   like WORD_COPY_FWD et al.  The pointers should be at least word aligned.
+   This will check if virtual copying by pages can and should be done and do it
+   if so.  The pointers will be aligned to PAGE_SIZE bytes.  The macro requires
+   that pagecopy.h defines at least PAGE_COPY_THRESHOLD to 0.  If
+   PAGE_COPY_THRESHOLD is non-zero, the header must also define PAGE_COPY_FWD
+   and PAGE_SIZE.
+*/
+#if PAGE_COPY_THRESHOLD
+
+# include <assert.h>
+
+# define PAGE_COPY_FWD_MAYBE(dstp, srcp, nbytes_left, nbytes)		      \
+  do									      \
+    {									      \
+      if ((nbytes) >= PAGE_COPY_THRESHOLD &&				      \
+	  PAGE_OFFSET ((dstp) - (srcp)) == 0) 				      \
+	{								      \
+	  /* The amount to copy is past the threshold for copying	      \
+	     pages virtually with kernel VM operations, and the		      \
+	     source and destination addresses have the same alignment.  */    \
+	  size_t nbytes_before = PAGE_OFFSET (-(dstp));			      \
+	  if (nbytes_before != 0)					      \
+	    {								      \
+	      /* First copy the words before the first page boundary.  */     \
+	      WORD_COPY_FWD (dstp, srcp, nbytes_left, nbytes_before);	      \
+	      assert (nbytes_left == 0);				      \
+	      nbytes -= nbytes_before;					      \
+	    }								      \
+	  PAGE_COPY_FWD (dstp, srcp, nbytes_left, nbytes);		      \
+	}								      \
+    } while (0)
+
+/* The page size is always a power of two, so we can avoid modulo division.  */
+# define PAGE_OFFSET(n)	((n) & (PAGE_SIZE - 1))
+
+#else
+
+# define PAGE_COPY_FWD_MAYBE(dstp, srcp, nbytes_left, nbytes) /* nada */
+
+#endif
 
 /* Threshold value for when to enter the unrolled loops.  */
 #define	OP_T_THRES	16
diff --git a/sysdeps/generic/pagecopy.h b/sysdeps/generic/pagecopy.h
index 2c35b71..3c81de1 100644
--- a/sysdeps/generic/pagecopy.h
+++ b/sysdeps/generic/pagecopy.h
@@ -1,4 +1,4 @@
-/* Macros for copying by pages; used in memcpy, memmove.  Generic macros.
+/* Macros for copying by pages; used in memcpy, memmove.
    Copyright (C) 1995-2014 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -16,19 +16,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-/* This file defines the macro:
+/* The macro PAGE_COPY_FWD_MAYBE defined in memcopy.h is used in memmove if the
+   PAGE_COPY_THRESHOLD macro is set to a non-zero value.  The default is 0,
+   that is copying by pages is not implemented.
 
-   PAGE_COPY_FWD_MAYBE (dstp, srcp, nbytes_left, nbytes)
-
-   which is invoked like WORD_COPY_FWD et al.  The pointers should be at
-   least word aligned.  This will check if virtual copying by pages can and
-   should be done and do it if so.
-
-   System-specific pagecopy.h files should define these macros and then
-   #include this file:
+   System-specific pagecopy.h files that want to support page copying should
+   define these macros:
 
    PAGE_COPY_THRESHOLD
-   -- Minimum size for which virtual copying by pages is worthwhile.
+   -- A non-zero minimum size for which virtual copying by pages is worthwhile.
 
    PAGE_SIZE
    -- Size of a page.
@@ -38,37 +34,4 @@
    The pointers will be aligned to PAGE_SIZE bytes.
 */
 
-
-#if PAGE_COPY_THRESHOLD
-
-#include <assert.h>
-
-#define PAGE_COPY_FWD_MAYBE(dstp, srcp, nbytes_left, nbytes)		      \
-  do									      \
-    {									      \
-      if ((nbytes) >= PAGE_COPY_THRESHOLD &&				      \
-	  PAGE_OFFSET ((dstp) - (srcp)) == 0) 				      \
-	{								      \
-	  /* The amount to copy is past the threshold for copying	      \
-	     pages virtually with kernel VM operations, and the		      \
-	     source and destination addresses have the same alignment.  */    \
-	  size_t nbytes_before = PAGE_OFFSET (-(dstp));			      \
-	  if (nbytes_before != 0)					      \
-	    {								      \
-	      /* First copy the words before the first page boundary.  */     \
-	      WORD_COPY_FWD (dstp, srcp, nbytes_left, nbytes_before);	      \
-	      assert (nbytes_left == 0);				      \
-	      nbytes -= nbytes_before;					      \
-	    }								      \
-	  PAGE_COPY_FWD (dstp, srcp, nbytes_left, nbytes);		      \
-	}								      \
-    } while (0)
-
-/* The page size is always a power of two, so we can avoid modulo division.  */
-#define PAGE_OFFSET(n)	((n) & (PAGE_SIZE - 1))
-
-#else
-
-#define PAGE_COPY_FWD_MAYBE(dstp, srcp, nbytes_left, nbytes) /* nada */
-
-#endif
+#define PAGE_COPY_THRESHOLD 0
diff --git a/sysdeps/mach/pagecopy.h b/sysdeps/mach/pagecopy.h
index 36c3697..8db2147 100644
--- a/sysdeps/mach/pagecopy.h
+++ b/sysdeps/mach/pagecopy.h
@@ -30,6 +30,3 @@
 				(vm_address_t) dstp) == KERN_SUCCESS	      \
 		     ? trunc_page (nbytes)				      \
 		     : 0)))
-
-/* Get the generic macro.  */
-#include <sysdeps/generic/pagecopy.h>
diff --git a/sysdeps/powerpc/memmove.c b/sysdeps/powerpc/memmove.c
index 3859da8..98ffb14 100644
--- a/sysdeps/powerpc/memmove.c
+++ b/sysdeps/powerpc/memmove.c
@@ -20,7 +20,6 @@
 
 #include <string.h>
 #include <memcopy.h>
-#include <pagecopy.h>
 
 /* All this is so that bcopy.c can #include
    this file after defining some things.  */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                  |   31 ++++++++++++++++
 debug/memcpy_chk.c         |    1 -
 debug/mempcpy_chk.c        |    1 -
 intl/loadmsgcat.c          |   83 +++++++++++++++++++++++++++++++++++--------
 misc/sys/cdefs.h           |    4 ++-
 string/memcpy.c            |    1 -
 string/memmove.c           |    1 -
 sysdeps/generic/memcopy.h  |   42 ++++++++++++++++++++++
 sysdeps/generic/pagecopy.h |   53 ++++------------------------
 sysdeps/mach/pagecopy.h    |    3 --
 sysdeps/powerpc/memmove.c  |    1 -
 11 files changed, 151 insertions(+), 70 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]