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 hjl/pr21120/2.24 created. glibc-2.24-72-g7cfdcd5


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, hjl/pr21120/2.24 has been created
        at  7cfdcd57fb1ab3396b1e871b54f46b13acdf4b9e (commit)

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

commit 7cfdcd57fb1ab3396b1e871b54f46b13acdf4b9e
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
Date:   Fri Feb 24 13:30:13 2017 +0100

    Get rid of duplicate const declaration specifier warning in tst-resolv-qtypes.c.
    
    Compiling resolv/tst-resolv-qtypes.c with GCC 7 results in:
    tst-resolv-qtypes.c:53:14: error: duplicate â??constâ?? declaration specifier [-Werror=duplicate-decl-specifier]
     static const const char *domain = "www.example.com";
    
    This patch removes the duplicate const and makes domain a const pointer
    to const char literal.
    
    ChangeLog:
    
    	* resolv/tst-resolv-qtypes.c (domain):
    	Change type to const pointer to const char.
    
    (cherry picked from commit d4f94368a96541db2b38b6535402a941f5aff975)

diff --git a/resolv/tst-resolv-qtypes.c b/resolv/tst-resolv-qtypes.c
index b3e60c6..0f381d0 100644
--- a/resolv/tst-resolv-qtypes.c
+++ b/resolv/tst-resolv-qtypes.c
@@ -50,7 +50,7 @@ response (const struct resolv_response_context *ctx,
   resolv_response_close_record (b);
 }
 
-static const const char *domain = "www.example.com";
+static const char * const domain = "www.example.com";
 
 static int
 wrap_res_query (int type, unsigned char *answer, int answer_length)

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

commit 4308d3fc8fab5b05707b7cc2f11cdb03cd89a16a
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Jan 4 23:33:31 2017 +0000

    Fix string/tester.c for GCC 7 -Wstringop-overflow=.
    
    GCC 7 has a -Wstringop-overflow= warning that includes warning for
    strncat with a size specified that is larger than the size of the
    buffer (which is dubious usage, but valid at runtime if in fact there
    isn't an overflow with the particular buffer contents present).
    string/tester.c tests such cases; this patch arranges for this warning
    to be ignored around relevant strncat calls.
    
    Tested compilation for aarch64 (GCC mainline) with
    build-many-glibcs.py; did execution testing for x86_64 (GCC 5).
    
    	* string/tester.c (test_strncat): Disable -Wstringop-overflow=
    	around tests of strncat with large sizes.
    
    (cherry picked from commit 3ecd616cc1782210d09c9678ec1a48899f19145b)

diff --git a/string/tester.c b/string/tester.c
index 7c36591..25ffec9 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -353,28 +353,70 @@ test_strncat (void)
      mechanism.  */
   it = "strncat";
   (void) strcpy (one, "ijk");
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about the size passed to strncat being larger than
+     the size of the buffer; this is deliberately tested here..  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
+#endif
   check (strncat (one, "lmn", 99) == one, 1);	/* Returned value. */
+  DIAG_POP_NEEDS_COMMENT;
   equal (one, "ijklmn", 2);		/* Basic test. */
 
   (void) strcpy (one, "x");
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about the size passed to strncat being larger than
+     the size of the buffer; this is deliberately tested here..  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
+#endif
   (void) strncat (one, "yz", 99);
+  DIAG_POP_NEEDS_COMMENT;
   equal (one, "xyz", 3);		/* Writeover. */
   equal (one+4, "mn", 4);		/* Wrote too much? */
 
   (void) strcpy (one, "gh");
   (void) strcpy (two, "ef");
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about the size passed to strncat being larger than
+     the size of the buffer; this is deliberately tested here..  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
+#endif
   (void) strncat (one, two, 99);
+  DIAG_POP_NEEDS_COMMENT;
   equal (one, "ghef", 5);			/* Basic test encore. */
   equal (two, "ef", 6);			/* Stomped on source? */
 
   (void) strcpy (one, "");
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about the size passed to strncat being larger than
+     the size of the buffer; this is deliberately tested here..  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
+#endif
   (void) strncat (one, "", 99);
+  DIAG_POP_NEEDS_COMMENT;
   equal (one, "", 7);			/* Boundary conditions. */
   (void) strcpy (one, "ab");
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about the size passed to strncat being larger than
+     the size of the buffer; this is deliberately tested here..  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
+#endif
   (void) strncat (one, "", 99);
+  DIAG_POP_NEEDS_COMMENT;
   equal (one, "ab", 8);
   (void) strcpy (one, "");
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about the size passed to strncat being larger than
+     the size of the buffer; this is deliberately tested here..  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
+#endif
   (void) strncat (one, "cd", 99);
+  DIAG_POP_NEEDS_COMMENT;
   equal (one, "cd", 9);
 
   (void) strcpy (one, "ab");
@@ -387,7 +429,14 @@ test_strncat (void)
   (void) strncat (one, "gh", 2);
   equal (one, "abcdgh", 12);		/* Count and length equal. */
 
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about the size passed to strncat being larger than
+     the size of the buffer; this is deliberately tested here..  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
+#endif
   (void) strncat (one, "ij", (size_t)-1);	/* set sign bit in count */
+  DIAG_POP_NEEDS_COMMENT;
   equal (one, "abcdghij", 13);
 
   int ntest = 14;
@@ -406,8 +455,16 @@ test_strncat (void)
 	    buf1[n2 + n3] = '\0';
 	    strcpy (buf2 + n1, "123");
 
+	    DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+	    /* GCC 7 warns about the size passed to strncat being
+	       larger than the size of the buffer; this is
+	       deliberately tested here..  */
+	    DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
+#endif
 	    check (strncat (buf1 + n2, buf2 + n1, ~((size_t) 0) - n4)
 		   == buf1 + n2, ntest);
+	    DIAG_POP_NEEDS_COMMENT;
 	    if (errors == olderrors)
 	      for (size_t i = 0; i < sizeof (buf1); ++i)
 		{

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

commit 76d8cfc034101aeda25ec3c2b1d3b58be99a10b6
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Jan 4 23:32:14 2017 +0000

    Fix malloc/ tests for GCC 7 -Walloc-size-larger-than=.
    
    GCC 7 has a -Walloc-size-larger-than= warning for allocations of half
    the address space or more.  This causes errors building glibc tests
    that deliberately test failure of very large allocations.  This patch
    arranges for this warning to be ignored around the problematic
    function calls.
    
    Tested compilation for aarch64 (GCC mainline) with
    build-many-glibcs.py; did execution testing for x86_64 (GCC 5).
    
    	* malloc/tst-malloc.c: Include <libc-internal.h>.
    	(do_test): Disable -Walloc-size-larger-than= around tests of
    	malloc with negative sizes.
    	* malloc/tst-mcheck.c: Include <libc-internal.h>.
    	(do_test): Disable -Walloc-size-larger-than= around tests of
    	malloc and realloc with negative sizes.
    	* malloc/tst-realloc.c: Include <libc-internal.h>.
    	(do_test): Disable -Walloc-size-larger-than= around tests of
    	realloc with negative sizes.
    
    (cherry picked from commit 3d7229c2507be1daf0c3e15e1f134076fa8b9025)

diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index c1292a2..25daded 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -19,6 +19,7 @@
 #include <errno.h>
 #include <malloc.h>
 #include <stdio.h>
+#include <libc-internal.h>
 
 static int errors = 0;
 
@@ -37,7 +38,14 @@ do_test (void)
 
   errno = 0;
 
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about too-large allocations; here we want to test
+     that they fail.  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than=");
+#endif
   p = malloc (-1);
+  DIAG_POP_NEEDS_COMMENT;
   save = errno;
 
   if (p != NULL)
@@ -67,7 +75,14 @@ do_test (void)
   if (p == NULL)
     merror ("malloc (513K) failed.");
 
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about too-large allocations; here we want to test
+     that they fail.  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than=");
+#endif
   q = malloc (-512 * 1024);
+  DIAG_POP_NEEDS_COMMENT;
   if (q != NULL)
     merror ("malloc (-512K) succeeded.");
 
diff --git a/malloc/tst-mcheck.c b/malloc/tst-mcheck.c
index 296cc47..c95db4d 100644
--- a/malloc/tst-mcheck.c
+++ b/malloc/tst-mcheck.c
@@ -19,6 +19,7 @@
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <libc-internal.h>
 
 static int errors = 0;
 
@@ -36,7 +37,14 @@ do_test (void)
 
   errno = 0;
 
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about too-large allocations; here we want to test
+     that they fail.  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than=");
+#endif
   p = malloc (-1);
+  DIAG_POP_NEEDS_COMMENT;
 
   if (p != NULL)
     merror ("malloc (-1) succeeded.");
@@ -67,10 +75,17 @@ do_test (void)
   if (p == NULL)
     merror ("malloc (512) failed.");
 
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about too-large allocations; here we want to test
+     that they fail.  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than=");
+#endif
   if (realloc (p, -256) != NULL)
     merror ("realloc (p, -256) succeeded.");
   else if (errno != ENOMEM)
     merror ("errno is not set correctly.");
+  DIAG_POP_NEEDS_COMMENT;
 
   free (p);
 
@@ -78,10 +93,17 @@ do_test (void)
   if (p == NULL)
     merror ("malloc (512) failed.");
 
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about too-large allocations; here we want to test
+     that they fail.  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than=");
+#endif
   if (realloc (p, -1) != NULL)
     merror ("realloc (p, -1) succeeded.");
   else if (errno != ENOMEM)
     merror ("errno is not set correctly.");
+  DIAG_POP_NEEDS_COMMENT;
 
   free (p);
   free (q);
diff --git a/malloc/tst-realloc.c b/malloc/tst-realloc.c
index 16e840f..7d83104 100644
--- a/malloc/tst-realloc.c
+++ b/malloc/tst-realloc.c
@@ -19,6 +19,7 @@
 #include <malloc.h>
 #include <stdio.h>
 #include <string.h>
+#include <libc-internal.h>
 
 static int errors = 0;
 
@@ -39,7 +40,14 @@ do_test (void)
   errno = 0;
 
   /* realloc (NULL, ...) behaves similarly to malloc (C89).  */
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about too-large allocations; here we want to test
+     that they fail.  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than=");
+#endif
   p = realloc (NULL, -1);
+  DIAG_POP_NEEDS_COMMENT;
   save = errno;
 
   if (p != NULL)
@@ -111,7 +119,14 @@ do_test (void)
     merror ("first 16 bytes were not correct");
 
   /* Check failed realloc leaves original untouched (C89).  */
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  /* GCC 7 warns about too-large allocations; here we want to test
+     that they fail.  */
+  DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than=");
+#endif
   c = realloc (p, -1);
+  DIAG_POP_NEEDS_COMMENT;
   if (c != NULL)
     merror ("realloc (p, -1) succeeded.");
 

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

commit 45240ef5f46c231ef21216d2b681e4393c9658a9
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Jan 11 14:02:23 2017 +0000

    Fix testsuite build for GCC 7 -Wformat-truncation.
    
    This patch fixes the glibc testsuite build for GCC 7
    -Wformat-truncation, newly moved out of -Wformat-length and with some
    further warnings that didn't previously appear.  Two tests that
    previously disabled -Wformat-length are changed to disable
    -Wformat-truncation instead; two others are made to disable that
    option as well.
    
    Tested (compilation only) with build-many-glibcs.py for aarch64 with
    GCC mainline.
    
    	* stdio-common/tst-printf.c [__GNUC_PREREQ (7, 0)]: Ignore
    	-Wformat-truncation instead of -Wformat-length.
    	* time/tst-strptime2.c (mkbuf) [__GNUC_PREREQ (7, 0)]: Likewise.
    	* stdio-common/tstdiomisc.c (F): Ignore -Wformat-truncation for
    	GCC 7.
    	* wcsmbs/tst-wcstof.c: Include <libc-internal.h>.
    	(do_test): Ignore -Wformat-truncation for GCC 7.
    
    (cherry picked from commit 3c9378265a8633e2c85a393b54a16abcf64fe616)

diff --git a/stdio-common/tst-printf.c b/stdio-common/tst-printf.c
index ffe7ac7..8870d4a 100644
--- a/stdio-common/tst-printf.c
+++ b/stdio-common/tst-printf.c
@@ -33,8 +33,9 @@
 DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat");
 
 #if __GNUC_PREREQ (7, 0)
-/* Compiler warnings about format lengths should also be ignored.  */
-DIAG_IGNORE_NEEDS_COMMENT (7.0, "-Wformat-length");
+/* Compiler warnings about snprintf output truncation should also be
+   ignored.  */
+DIAG_IGNORE_NEEDS_COMMENT (7.0, "-Wformat-truncation");
 #endif
 
 static void rfg1 (void);
diff --git a/stdio-common/tstdiomisc.c b/stdio-common/tstdiomisc.c
index 5548a71..9c7342d 100644
--- a/stdio-common/tstdiomisc.c
+++ b/stdio-common/tstdiomisc.c
@@ -94,6 +94,14 @@ F (void)
 
   qnanval = NAN;
 
+  /* The %f and %F arguments are in fact constants, but GCC is
+     prevented from seeing this (volatile is used) so it cannot tell
+     that the output is not truncated.  */
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  DIAG_IGNORE_NEEDS_COMMENT (7.0, "-Wformat-truncation");
+#endif
+
   snprintf (buf, sizeof buf, "%a %A %e %E %f %F %g %G",
 	    qnanval, qnanval, qnanval, qnanval,
 	    qnanval, qnanval, qnanval, qnanval);
@@ -260,6 +268,8 @@ F (void)
   printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n",
 	  wbuf);
 
+  DIAG_POP_NEEDS_COMMENT;
+
   return result;
 }
 
diff --git a/time/tst-strptime2.c b/time/tst-strptime2.c
index 04f7cff..9273568 100644
--- a/time/tst-strptime2.c
+++ b/time/tst-strptime2.c
@@ -73,7 +73,7 @@ mkbuf (char *buf, bool neg, bool colon, unsigned int hhmm, size_t ndigits)
      This test is explicitly using short buffers to force snprintf to truncate
      the output so we ignore the warnings.  */
   DIAG_PUSH_NEEDS_COMMENT;
-  DIAG_IGNORE_NEEDS_COMMENT (7.0, "-Wformat-length");
+  DIAG_IGNORE_NEEDS_COMMENT (7.0, "-Wformat-truncation");
 #endif
   if (colon)
     snprintf (buf + i, ndigits + 2, "%02u:%02u", hh, mm);
diff --git a/wcsmbs/tst-wcstof.c b/wcsmbs/tst-wcstof.c
index 576a58c..861f659 100644
--- a/wcsmbs/tst-wcstof.c
+++ b/wcsmbs/tst-wcstof.c
@@ -3,6 +3,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <wctype.h>
+#include <libc-internal.h>
 
 static int
 do_test (void)
@@ -14,7 +15,14 @@ do_test (void)
   tmp[1] = '1';
   tmp[2] = 0;
 
+  /* GCC does not know the result of wcstof so cannot see that the
+     snprintf output is not truncated.  */
+  DIAG_PUSH_NEEDS_COMMENT;
+#if __GNUC_PREREQ (7, 0)
+  DIAG_IGNORE_NEEDS_COMMENT (7.0, "-Wformat-truncation");
+#endif
   snprintf (buf, 100, "%S = %f", tmp, wcstof (tmp, NULL));
+  DIAG_POP_NEEDS_COMMENT;
   printf ("\"%s\" -> %s\n", buf,
 	  strcmp (buf, "81 = 81.000000") == 0 ? "okay" : "buggy");
   result |= strcmp (buf, "81 = 81.000000") != 0;

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

commit ee5bfbe14c37667ed84d428e543a59765d9c8846
Author: Steve Ellcey <sellcey@caviumnetworks.com>
Date:   Tue Nov 1 16:00:09 2016 -0700

    Fix warning from latest GCC in tst-printf.c
    
    	* stdio-common/tst-printf.c: Ignore -Wformat-length warning.
    
    (cherry picked from commit 9032070deaa03431921315f973c548c2c403fecc)

diff --git a/stdio-common/tst-printf.c b/stdio-common/tst-printf.c
index 2896b18..ffe7ac7 100644
--- a/stdio-common/tst-printf.c
+++ b/stdio-common/tst-printf.c
@@ -32,6 +32,11 @@
    The compiler warnings are not useful here.  */
 DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat");
 
+#if __GNUC_PREREQ (7, 0)
+/* Compiler warnings about format lengths should also be ignored.  */
+DIAG_IGNORE_NEEDS_COMMENT (7.0, "-Wformat-length");
+#endif
+
 static void rfg1 (void);
 static void rfg2 (void);
 static void rfg3 (void);

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

commit b343a6c400a449040d828fa17903e82818150c4d
Author: Steve Ellcey <sellcey@caviumnetworks.com>
Date:   Wed Nov 2 16:00:39 2016 -0700

    Fix -Wformat-length warning in time/tst-strptime2.c
    
    	* time/tst-strptime2.c: Ignore -Wformat-length warning.
    
    (cherry picked from commit 26d7185d6f0a79188fdf02c5eec6e52bb29112f8)

diff --git a/time/tst-strptime2.c b/time/tst-strptime2.c
index 7fe7350..04f7cff 100644
--- a/time/tst-strptime2.c
+++ b/time/tst-strptime2.c
@@ -4,6 +4,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <time.h>
+#include <libc-internal.h>
 
 /* Dummy string is used to match strptime's %s specifier.  */
 
@@ -67,10 +68,20 @@ mkbuf (char *buf, bool neg, bool colon, unsigned int hhmm, size_t ndigits)
   long int expect = LONG_MAX;
 
   i = sprintf (buf, "%s %c", dummy_string, sign);
+#if __GNUC_PREREQ (7, 0)
+  /* GCC issues a warning when it thinks the snprintf buffer may be too short.
+     This test is explicitly using short buffers to force snprintf to truncate
+     the output so we ignore the warnings.  */
+  DIAG_PUSH_NEEDS_COMMENT;
+  DIAG_IGNORE_NEEDS_COMMENT (7.0, "-Wformat-length");
+#endif
   if (colon)
     snprintf (buf + i, ndigits + 2, "%02u:%02u", hh, mm);
   else
     snprintf (buf + i, ndigits + 1, "%04u", hhmm);
+#if __GNUC_PREREQ (7, 0)
+  DIAG_POP_NEEDS_COMMENT;
+#endif
 
   if (mm <= mm_max && (ndigits == 2 || ndigits == 4))
     {

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

commit a8d2af4a108dc4702cf7af55cd3e7c97fe608bf5
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Dec 21 23:44:01 2016 +0000

    Fix nss_nisplus build with mainline GCC (bug 20978).
    
    glibc build with current mainline GCC fails because
    nis/nss_nisplus/nisplus-alias.c contains code
    
      if (name != NULL)
        {
          *errnop = EINVAL;
          return NSS_STATUS_UNAVAIL;
        }
    
      char buf[strlen (name) + 9 + tablename_len];
    
    producing an error about strlen being called on a pointer that is
    always NULL (and a subsequent use of that pointer with a %s format in
    snprintf).
    
    As Andreas noted, the bogus conditional comes from a 1997 change:
    
    -  if (name == NULL || strlen(name) > 8)
    -    return NSS_STATUS_NOTFOUND;
    -  else
    +  if (name != NULL || strlen(name) <= 8)
    
    So the intention is clearly to return an error for NULL name.
    
    This patch duly inverts the sense of the conditional.  It fixes the
    build with GCC mainline, and passes usual glibc testsuite testing for
    x86_64.  However, I have not tried any actual substantive nisplus
    testing, do not have an environment for such testing, and do not know
    whether it is possible that strlen (name) or tablename_len might be
    large so that the VLA for buf is actually a security issue.  However,
    if it is a security issue, there are plenty of other similar instances
    in the nisplus code (that haven't been hidden by a bogus comparison
    with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
    string passed to nis_list, so a local fix in the caller wouldn't
    suffice anyway (see bug 20987).  (Calls to strdupa and other such
    macros that use alloca must be considered equally questionable
    regarding stack overflow issues as direct calls to alloca and VLA
    declarations.)
    
    	[BZ #20978]
    	* nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
    	Compare name == NULL, not name != NULL.
    
    (cherry picked from commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3)

diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
index 7f698b4..cb5acce 100644
--- a/nis/nss_nisplus/nisplus-alias.c
+++ b/nis/nss_nisplus/nisplus-alias.c
@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
 	return status;
     }
 
-  if (name != NULL)
+  if (name == NULL)
     {
       *errnop = EINVAL;
       return NSS_STATUS_UNAVAIL;

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

commit ee074bc17f6a9c81484e564cbacb55891390a78f
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Nov 8 23:44:51 2016 +0000

    Fix rpcgen buffer overrun (bug 20790).
    
    Building with GCC 7 produces an error building rpcgen:
    
    rpc_parse.c: In function 'get_prog_declaration':
    rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
         sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
                         ~~~~^
    rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
         sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    That buffer overrun is for the case where the .x file declares a
    program with a million arguments.  The strcpy two lines above can
    generate a buffer overrun much more simply for a long argument name.
    
    The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
    provides a bound on the buffer size needed, so this patch just changes
    the buffer size to MAXLINESIZE to avoid both possible buffer
    overruns.  A testcase is added that rpcgen does not crash with a
    500-character argument name, where it previously crashed.
    
    It would not at all surprise me if there are many other ways of
    crashing rpcgen with either valid or invalid input; fuzz testing would
    likely find various such bugs, though I don't think they are that
    important to fix (rpcgen is not that likely to be used with untrusted
    .x files as input).  (As well as fuzz-findable bugs there are probably
    also issues when various int variables get overflowed on very large
    input.)  The test infrastructure for rpcgen-not-crashing tests would
    need extending if tests are to be added for cases where rpcgen should
    produce an error, as opposed to cases where it should succeed.
    
    Tested for x86_64 and x86.
    
    	[BZ #20790]
    	* sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
    	to MAXLINESIZE.
    	* sunrpc/bug20790.x: New file.
    	* sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
    	variable.
    	[$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
    	[$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
    
    (cherry picked from commit 5874510faaf3cbd0bb112aaacab9f225002beed1)

diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index 789ef42..99e5c3c 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -103,6 +103,11 @@ ifeq ($(have-thread-library),yes)
 xtests += thrsvc
 endif
 
+ifeq ($(run-built-tests),yes)
+rpcgen-tests := $(objpfx)bug20790.out
+tests-special += $(rpcgen-tests)
+endif
+
 headers += $(rpcsvc:%.x=rpcsvc/%.h)
 extra-libs := librpcsvc
 extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
@@ -225,3 +230,9 @@ endif
 endif
 
 $(objpfx)thrsvc: $(common-objpfx)linkobj/libc.so $(shared-thread-library)
+
+ifeq ($(run-built-tests),yes)
+$(rpcgen-tests): $(objpfx)%.out: %.x $(objpfx)rpcgen
+	$(built-program-cmd) -c $< -o $@; \
+	$(evaluate-test)
+endif
diff --git a/sunrpc/bug20790.x b/sunrpc/bug20790.x
new file mode 100644
index 0000000..a00c9b3
--- /dev/null
+++ b/sunrpc/bug20790.x
@@ -0,0 +1 @@
+program TPROG { version TVERS { int FUNC(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) = 1; } = 1; } = 1;
diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
index 1a1df6d..505a655 100644
--- a/sunrpc/rpc_parse.c
+++ b/sunrpc/rpc_parse.c
@@ -521,7 +521,7 @@ static void
 get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
 {
   token tok;
-  char name[10];		/* argument name */
+  char name[MAXLINESIZE];		/* argument name */
 
   if (dkind == DEF_PROGRAM)
     {

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

commit cfc025ebb627c50d4f777c64fb6584c02e291690
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue Jun 13 22:09:59 2017 +0200

    configure: Suppress expected compiler error message
    
    (cherry picked from commit c2528fef3b05bcffb1ac27c6c09cc3ff24b7f03f)

diff --git a/configure b/configure
index f4aeb51..4eb6a17 100755
--- a/configure
+++ b/configure
@@ -5061,7 +5061,8 @@ fi
 # copy of those headers in Makerules.
 if test -n "$CXX"; then
   find_cxx_header () {
-    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "\,$1:,{s/:\$//;p}"
+    echo "#include <$1>" | $CXX -M -MP -x c++ - 2>/dev/null \
+	 | sed -n "\,$1:,{s/:\$//;p}"
   }
   CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
   CXX_CMATH_HEADER="$(find_cxx_header cmath)"
diff --git a/configure.ac b/configure.ac
index 7ce8b28..644ff5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1043,7 +1043,8 @@ AC_SUBST(CXX_SYSINCLUDES)
 # copy of those headers in Makerules.
 if test -n "$CXX"; then
   find_cxx_header () {
-    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "\,$1:,{s/:\$//;p}"
+    echo "#include <$1>" | $CXX -M -MP -x c++ - 2>/dev/null \
+	 | sed -n "\,$1:,{s/:\$//;p}"
   }
   CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
   CXX_CMATH_HEADER="$(find_cxx_header cmath)"

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

commit 67ca4485d7ab9384278d4104d18ece4f6c339c79
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jun 13 09:28:14 2017 -0700

    Make copy of <bits/std_abs.h> from GCC 7 [BZ #21573]
    
    <bits/std_abs.h> from GCC 7 will include /usr/include/stdlib.h from
    "#include_next" (instead of stdlib/stdlib.h in the glibc source
    directory), and this turns up as a make dependency.  Also make a copy
    of <bits/std_abs.h> to prevent it from including /usr/include/stdlib.h.
    
    	[BZ #21573]
    	* Makerules [$(c++-bits-std_abs-h) != ""] (before-compile): Add
    	$(common-objpfx)bits/std_abs.h.
    	[$(c++-bits-std_abs-h) != ""] ($(common-objpfx)bits/std_abs.h):
    	New target.
    	* config.make.in (c++-bits-std_abs-h): New.
    	* configure.ac (find_cxx_header): Use "\,$1," with sed.
    	(CXX_BITS_STD_ABS_H): New.
    	(AC_SUBST(CXX_BITS_STD_ABS_H)): Likewise.
    	* configure: Regenerated.
    
    (cherry picked from commit a65ea28d1833d3502c5070472e43bda04410e6b5)

diff --git a/Makerules b/Makerules
index c338850..ef82392 100644
--- a/Makerules
+++ b/Makerules
@@ -127,6 +127,14 @@ $(common-objpfx)cstdlib: $(c++-cstdlib-header)
 $(common-objpfx)cmath: $(c++-cmath-header)
 	$(INSTALL_DATA) $< $@T
 	$(move-if-change) $@T $@
+ifneq (,$(c++-bits-std_abs-h))
+# Also make a copy of <bits/std_abs.h> from GCC 7 to prevent it from
+# including /usr/include/stdlib.h.
+before-compile := $(common-objpfx)bits/std_abs.h $(before-compile)
+$(common-objpfx)bits/std_abs.h: $(c++-bits-std_abs-h)
+	$(INSTALL_DATA) $< $@T
+	$(move-if-change) $@T $@
+endif
 endif
 
 before-compile := $(common-objpfx)libc-abis.h $(before-compile)
diff --git a/config.make.in b/config.make.in
index 04a8b3e..2fff5ac 100644
--- a/config.make.in
+++ b/config.make.in
@@ -47,6 +47,7 @@ sysincludes = @SYSINCLUDES@
 c++-sysincludes = @CXX_SYSINCLUDES@
 c++-cstdlib-header = @CXX_CSTDLIB_HEADER@
 c++-cmath-header = @CXX_CMATH_HEADER@
+c++-bits-std_abs-h = @CXX_BITS_STD_ABS_H@
 all-warnings = @all_warnings@
 enable-werror = @enable_werror@
 
diff --git a/configure b/configure
index 405ff05..f4aeb51 100755
--- a/configure
+++ b/configure
@@ -635,6 +635,7 @@ BISON
 INSTALL_INFO
 PERL
 BASH_SHELL
+CXX_BITS_STD_ABS_H
 CXX_CMATH_HEADER
 CXX_CSTDLIB_HEADER
 CXX_SYSINCLUDES
@@ -5060,14 +5061,16 @@ fi
 # copy of those headers in Makerules.
 if test -n "$CXX"; then
   find_cxx_header () {
-    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "/$1:/{s/:\$//;p}"
+    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "\,$1:,{s/:\$//;p}"
   }
   CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
   CXX_CMATH_HEADER="$(find_cxx_header cmath)"
+  CXX_BITS_STD_ABS_H="$(find_cxx_header bits/std_abs.h)"
 fi
 
 
 
+
 # Test if LD_LIBRARY_PATH contains the notation for the current directory
 # since this would lead to problems installing/building glibc.
 # LD_LIBRARY_PATH contains the current directory if one of the following
diff --git a/configure.ac b/configure.ac
index 1905e93..7ce8b28 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1043,13 +1043,15 @@ AC_SUBST(CXX_SYSINCLUDES)
 # copy of those headers in Makerules.
 if test -n "$CXX"; then
   find_cxx_header () {
-    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "/$1:/{s/:\$//;p}"
+    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "\,$1:,{s/:\$//;p}"
   }
   CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
   CXX_CMATH_HEADER="$(find_cxx_header cmath)"
+  CXX_BITS_STD_ABS_H="$(find_cxx_header bits/std_abs.h)"
 fi
 AC_SUBST(CXX_CSTDLIB_HEADER)
 AC_SUBST(CXX_CMATH_HEADER)
+AC_SUBST(CXX_BITS_STD_ABS_H)
 
 # Test if LD_LIBRARY_PATH contains the notation for the current directory
 # since this would lead to problems installing/building glibc.

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

commit 3387375fc8f737f44079f7a682501d4f0d090e60
Author: Florian Weimer <fweimer@redhat.com>
Date:   Wed Sep 21 10:45:32 2016 +0200

    Avoid running $(CXX) during build to obtain header file paths
    
    This reduces the build time somewhat and is particularly noticeable
    during rebuilds with few code changes.
    
    (cherry picked from commit fc3e1337be1c6935ab58bd13520f97a535cf70cc)

diff --git a/Makerules b/Makerules
index 7e4077e..c338850 100644
--- a/Makerules
+++ b/Makerules
@@ -121,14 +121,10 @@ ifneq (,$(CXX))
 # will be used instead of /usr/include/stdlib.h and /usr/include/math.h.
 before-compile := $(common-objpfx)cstdlib $(common-objpfx)cmath \
 	          $(before-compile)
-cstdlib=$(shell echo "\#include <cstdlib>" | $(CXX) -M -MP -x c++ - \
-		| sed -n "/cstdlib:/{s/:$$//;p}")
-$(common-objpfx)cstdlib: $(cstdlib)
+$(common-objpfx)cstdlib: $(c++-cstdlib-header)
 	$(INSTALL_DATA) $< $@T
 	$(move-if-change) $@T $@
-cmath=$(shell echo "\#include <cmath>" | $(CXX) -M -MP -x c++ - \
-		| sed -n "/cmath:/{s/:$$//;p}")
-$(common-objpfx)cmath: $(cmath)
+$(common-objpfx)cmath: $(c++-cmath-header)
 	$(INSTALL_DATA) $< $@T
 	$(move-if-change) $@T $@
 endif
diff --git a/config.make.in b/config.make.in
index 95c6f36..04a8b3e 100644
--- a/config.make.in
+++ b/config.make.in
@@ -45,6 +45,8 @@ defines = @DEFINES@
 sysheaders = @sysheaders@
 sysincludes = @SYSINCLUDES@
 c++-sysincludes = @CXX_SYSINCLUDES@
+c++-cstdlib-header = @CXX_CSTDLIB_HEADER@
+c++-cmath-header = @CXX_CMATH_HEADER@
 all-warnings = @all_warnings@
 enable-werror = @enable_werror@
 
diff --git a/configure b/configure
index 9b5a486..405ff05 100755
--- a/configure
+++ b/configure
@@ -635,6 +635,8 @@ BISON
 INSTALL_INFO
 PERL
 BASH_SHELL
+CXX_CMATH_HEADER
+CXX_CSTDLIB_HEADER
 CXX_SYSINCLUDES
 SYSINCLUDES
 AUTOCONF
@@ -5054,6 +5056,18 @@ fi
 
 
 
+# Obtain some C++ header file paths.  This is used to make a local
+# copy of those headers in Makerules.
+if test -n "$CXX"; then
+  find_cxx_header () {
+    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "/$1:/{s/:\$//;p}"
+  }
+  CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
+  CXX_CMATH_HEADER="$(find_cxx_header cmath)"
+fi
+
+
+
 # Test if LD_LIBRARY_PATH contains the notation for the current directory
 # since this would lead to problems installing/building glibc.
 # LD_LIBRARY_PATH contains the current directory if one of the following
diff --git a/configure.ac b/configure.ac
index 8277d9f..1905e93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1039,6 +1039,18 @@ fi
 AC_SUBST(SYSINCLUDES)
 AC_SUBST(CXX_SYSINCLUDES)
 
+# Obtain some C++ header file paths.  This is used to make a local
+# copy of those headers in Makerules.
+if test -n "$CXX"; then
+  find_cxx_header () {
+    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "/$1:/{s/:\$//;p}"
+  }
+  CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
+  CXX_CMATH_HEADER="$(find_cxx_header cmath)"
+fi
+AC_SUBST(CXX_CSTDLIB_HEADER)
+AC_SUBST(CXX_CMATH_HEADER)
+
 # Test if LD_LIBRARY_PATH contains the notation for the current directory
 # since this would lead to problems installing/building glibc.
 # LD_LIBRARY_PATH contains the current directory if one of the following

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

commit f8e29d9269e985ec62383cd2b73f3715ed65afb2
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jun 29 10:26:04 2017 -0700

    i386: Increase MALLOC_ALIGNMENT to 16 [BZ #21120]
    
    GCC 7 changed the definition of max_align_t on i386:
    
    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9b5c49ef97e63cc63f1ffa13baf771368105ebe2
    
    As a result, glibc malloc no longer returns memory blocks which are as
    aligned as max_align_t requires.
    
    This causes malloc/tst-malloc-thread-fail to fail with an error like this
    one:
    
    error: allocation function 0, size 144 not aligned to 16
    
    This patch increases the malloc alignment to 16 for i386.
    
    	[BZ #21120]
    	* sysdeps/generic/malloc-alignment.h: New file.
    	* sysdeps/i386/malloc-alignment.h: Likewise.
    	* sysdeps/generic/malloc-machine.h: Include <malloc-alignment.h>.

diff --git a/sysdeps/generic/malloc-machine.h b/sysdeps/generic/malloc-alignment.h
similarity index 53%
copy from sysdeps/generic/malloc-machine.h
copy to sysdeps/generic/malloc-alignment.h
index 71b95c2..193e827 100644
--- a/sysdeps/generic/malloc-machine.h
+++ b/sysdeps/generic/malloc-alignment.h
@@ -1,6 +1,5 @@
-/* Basic platform-independent macro definitions for mutexes,
-   thread-specific data and parameters for malloc.
-   Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Define MALLOC_ALIGNMENT for malloc.  Generic version.
+   Copyright (C) 2017 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
@@ -17,25 +16,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GENERIC_MALLOC_MACHINE_H
-#define _GENERIC_MALLOC_MACHINE_H
+#ifndef _GENERIC_MALLOC_ALIGNMENT_H
+#define _GENERIC_MALLOC_ALIGNMENT_H
 
-#include <atomic.h>
+/* Use the default MALLOC_ALIGNMENT.  */
 
-#ifndef atomic_full_barrier
-# define atomic_full_barrier() __asm ("" ::: "memory")
-#endif
-
-#ifndef atomic_read_barrier
-# define atomic_read_barrier() atomic_full_barrier ()
-#endif
-
-#ifndef atomic_write_barrier
-# define atomic_write_barrier() atomic_full_barrier ()
-#endif
-
-#ifndef DEFAULT_TOP_PAD
-# define DEFAULT_TOP_PAD 131072
-#endif
-
-#endif /* !defined(_GENERIC_MALLOC_MACHINE_H) */
+#endif /* !defined(_GENERIC_MALLOC_ALIGNMENT_H) */
diff --git a/sysdeps/generic/malloc-machine.h b/sysdeps/generic/malloc-machine.h
index 71b95c2..930b088 100644
--- a/sysdeps/generic/malloc-machine.h
+++ b/sysdeps/generic/malloc-machine.h
@@ -21,6 +21,7 @@
 #define _GENERIC_MALLOC_MACHINE_H
 
 #include <atomic.h>
+#include <malloc-alignment.h>
 
 #ifndef atomic_full_barrier
 # define atomic_full_barrier() __asm ("" ::: "memory")
diff --git a/sysdeps/generic/malloc-machine.h b/sysdeps/i386/malloc-alignment.h
similarity index 53%
copy from sysdeps/generic/malloc-machine.h
copy to sysdeps/i386/malloc-alignment.h
index 71b95c2..f72f7a8 100644
--- a/sysdeps/generic/malloc-machine.h
+++ b/sysdeps/i386/malloc-alignment.h
@@ -1,6 +1,5 @@
-/* Basic platform-independent macro definitions for mutexes,
-   thread-specific data and parameters for malloc.
-   Copyright (C) 2003-2016 Free Software Foundation, Inc.
+/* Define MALLOC_ALIGNMENT for malloc.  i386 version.
+   Copyright (C) 2017 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
@@ -17,25 +16,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GENERIC_MALLOC_MACHINE_H
-#define _GENERIC_MALLOC_MACHINE_H
+#ifndef _I386_MALLOC_ALIGNMENT_H
+#define _I386_MALLOC_ALIGNMENT_H
 
-#include <atomic.h>
+#define MALLOC_ALIGNMENT 16
 
-#ifndef atomic_full_barrier
-# define atomic_full_barrier() __asm ("" ::: "memory")
-#endif
-
-#ifndef atomic_read_barrier
-# define atomic_read_barrier() atomic_full_barrier ()
-#endif
-
-#ifndef atomic_write_barrier
-# define atomic_write_barrier() atomic_full_barrier ()
-#endif
-
-#ifndef DEFAULT_TOP_PAD
-# define DEFAULT_TOP_PAD 131072
-#endif
-
-#endif /* !defined(_GENERIC_MALLOC_MACHINE_H) */
+#endif /* !defined(_I386_MALLOC_ALIGNMENT_H) */

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

commit 64a9f6a8acbbc0f7cd9c9532f5f16acefef15276
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jun 23 14:38:46 2017 -0700

    Avoid .symver on common symbols [BZ #21666]
    
    The .symver directive on common symbol just creates a new common symbol,
    not an alias and the newer assembler with the bug fix for
    
    https://sourceware.org/bugzilla/show_bug.cgi?id=21661
    
    will issue an error.  Before the fix, we got
    
    $ readelf -sW libc.so | grep "loc[12s]"
      5109: 00000000003a0608     8 OBJECT  LOCAL  DEFAULT   36 loc1
      5188: 00000000003a0610     8 OBJECT  LOCAL  DEFAULT   36 loc2
      5455: 00000000003a0618     8 OBJECT  LOCAL  DEFAULT   36 locs
      6575: 00000000003a05f0     8 OBJECT  GLOBAL DEFAULT   36 locs@GLIBC_2.2.5
      7156: 00000000003a05f8     8 OBJECT  GLOBAL DEFAULT   36 loc1@GLIBC_2.2.5
      7312: 00000000003a0600     8 OBJECT  GLOBAL DEFAULT   36 loc2@GLIBC_2.2.5
    
    in libc.so.  The versioned loc1, loc2 and locs have the wrong addresses.
    After the fix, we got
    
    $ readelf -sW libc.so | grep "loc[12s]"
      6570: 000000000039e3b8     8 OBJECT  GLOBAL DEFAULT   34 locs@GLIBC_2.2.5
      7151: 000000000039e3c8     8 OBJECT  GLOBAL DEFAULT   34 loc1@GLIBC_2.2.5
      7307: 000000000039e3c0     8 OBJECT  GLOBAL DEFAULT   34 loc2@GLIBC_2.2.5
    
    	[BZ #21666]
    	* misc/regexp.c (loc1): Add __attribute__ ((nocommon));
    	(loc2): Likewise.
    	(locs): Likewise.
    
    (cherry picked from commit 388b4f1a02f3a801965028bbfcd48d905638b797)

diff --git a/misc/regexp.c b/misc/regexp.c
index 3b36682..b2a2c6e 100644
--- a/misc/regexp.c
+++ b/misc/regexp.c
@@ -29,14 +29,15 @@
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
 
-/* Define the variables used for the interface.  */
-char *loc1;
-char *loc2;
+/* Define the variables used for the interface.  Avoid .symver on common
+   symbol, which just creates a new common symbol, not an alias.  */
+char *loc1 __attribute__ ((nocommon));
+char *loc2 __attribute__ ((nocommon));
 compat_symbol (libc, loc1, loc1, GLIBC_2_0);
 compat_symbol (libc, loc2, loc2, GLIBC_2_0);
 
 /* Although we do not support the use we define this variable as well.  */
-char *locs;
+char *locs __attribute__ ((nocommon));
 compat_symbol (libc, locs, locs, GLIBC_2_0);
 
 

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


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]