From e9dcd51d7741582a38918006e0ba05b2619608a7 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 2 Jan 2017 12:26:05 +0100 Subject: [PATCH] Remove patches which were workarounds for GCC 5 bugs --- glibc-bug-regex-gcc5.patch | 140 ----------------------------------- glibc-dns-host-gcc5.patch | 32 -------- glibc-gethnamaddr-gcc5.patch | 32 -------- glibc-ld-ctype-gcc5.patch | 72 ------------------ glibc-res-hconf-gcc5.patch | 29 -------- glibc.spec | 13 ---- 6 files changed, 318 deletions(-) delete mode 100644 glibc-bug-regex-gcc5.patch delete mode 100644 glibc-dns-host-gcc5.patch delete mode 100644 glibc-gethnamaddr-gcc5.patch delete mode 100644 glibc-ld-ctype-gcc5.patch delete mode 100644 glibc-res-hconf-gcc5.patch diff --git a/glibc-bug-regex-gcc5.patch b/glibc-bug-regex-gcc5.patch deleted file mode 100644 index c5a704e..0000000 --- a/glibc-bug-regex-gcc5.patch +++ /dev/null @@ -1,140 +0,0 @@ -Index: glibc-2.22-193-g315267a/posix/bug-regex11.c -=================================================================== ---- glibc-2.22-193-g315267a.orig/posix/bug-regex11.c -+++ glibc-2.22-193-g315267a/posix/bug-regex11.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - - /* Tests supposed to match. */ - struct -@@ -119,6 +120,14 @@ main (void) - continue; - } - -+ DIAG_PUSH_NEEDS_COMMENT -+#if __GNUC_PREREQ (5, 0) -+ /* GCC 5.0 warns about array subscript being above array bounds, -+ but that's not entirely possible since n is limited to -+ static nmatch which is limited to at most 5 (see tests above). -+ This is likely PR/59124 which is still not fixed. */ -+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds") -+#endif - for (n = 0; n < tests[i].nmatch; ++n) - if (rm[n].rm_so != tests[i].rm[n].rm_so - || rm[n].rm_eo != tests[i].rm[n].rm_eo) -@@ -130,6 +139,7 @@ main (void) - ret = 1; - break; - } -+ DIAG_POP_NEEDS_COMMENT - - regfree (&re); - } -Index: glibc-2.22-193-g315267a/posix/bug-regex17.c -=================================================================== ---- glibc-2.22-193-g315267a.orig/posix/bug-regex17.c -+++ glibc-2.22-193-g315267a/posix/bug-regex17.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - /* Tests supposed to match. */ - struct -@@ -87,6 +88,14 @@ do_test (void) - continue; - } - -+ DIAG_PUSH_NEEDS_COMMENT -+#if __GNUC_PREREQ (5, 0) -+ /* GCC 5.0 warns about array subscript being above array bounds, -+ but that's not entirely possible since n is limited to -+ static nmatch which is limited to at most 5 (see tests above). -+ This is likely PR/59124 which is still not fixed. */ -+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds") -+#endif - for (n = 0; n < tests[i].nmatch; ++n) - if (rm[n].rm_so != tests[i].rm[n].rm_so - || rm[n].rm_eo != tests[i].rm[n].rm_eo) -@@ -98,6 +107,7 @@ do_test (void) - ret = 1; - break; - } -+ DIAG_POP_NEEDS_COMMENT - - regfree (&re); - } -Index: glibc-2.22-193-g315267a/posix/bug-regex18.c -=================================================================== ---- glibc-2.22-193-g315267a.orig/posix/bug-regex18.c -+++ glibc-2.22-193-g315267a/posix/bug-regex18.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - /* Tests supposed to match. */ - struct -@@ -80,6 +81,14 @@ main (void) - continue; - } - -+ DIAG_PUSH_NEEDS_COMMENT -+#if __GNUC_PREREQ (5, 0) -+ /* GCC 5.0 warns about array subscript being above array bounds, -+ but that's not entirely possible since n is limited to -+ static nmatch which is limited to at most 5 (see tests above). -+ This is likely PR/59124 which is still not fixed. */ -+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds") -+#endif - for (n = 0; n < tests[i].nmatch; ++n) - if (rm[n].rm_so != tests[i].rm[n].rm_so - || rm[n].rm_eo != tests[i].rm[n].rm_eo) -@@ -91,6 +100,7 @@ main (void) - ret = 1; - break; - } -+ DIAG_POP_NEEDS_COMMENT - - regfree (&re); - } -Index: glibc-2.22-193-g315267a/posix/bug-regex30.c -=================================================================== ---- glibc-2.22-193-g315267a.orig/posix/bug-regex30.c -+++ glibc-2.22-193-g315267a/posix/bug-regex30.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - /* Tests supposed to match. */ - struct -@@ -80,6 +81,14 @@ do_test (void) - continue; - } - -+ DIAG_PUSH_NEEDS_COMMENT -+#if __GNUC_PREREQ (5, 0) -+ /* GCC 5.0 warns about array subscript being above array bounds, -+ but that's not entirely possible since n is limited to -+ static nmatch which is limited to at most 5 (see tests above). -+ This is likely PR/59124 which is still not fixed. */ -+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds") -+#endif - for (n = 0; n < tests[i].nmatch; ++n) - if (rm[n].rm_so != tests[i].rm[n].rm_so - || rm[n].rm_eo != tests[i].rm[n].rm_eo) -@@ -91,6 +100,7 @@ do_test (void) - ret = 1; - break; - } -+ DIAG_POP_NEEDS_COMMENT - - regfree (&re); - } diff --git a/glibc-dns-host-gcc5.patch b/glibc-dns-host-gcc5.patch deleted file mode 100644 index 3810a6e..0000000 --- a/glibc-dns-host-gcc5.patch +++ /dev/null @@ -1,32 +0,0 @@ -Index: glibc-2.23-276-gb65b205/resolv/nss_dns/dns-host.c -=================================================================== ---- glibc-2.23-276-gb65b205.orig/resolv/nss_dns/dns-host.c -+++ glibc-2.23-276-gb65b205/resolv/nss_dns/dns-host.c -@@ -78,6 +78,7 @@ - #include - #include - #include -+#include - - #include "nsswitch.h" - -@@ -566,10 +567,19 @@ addrsort (char **ap, int num) - num = MAX_NR_ADDRS; - for (i = 0; i < num; i++, p++) - { -+ DIAG_PUSH_NEEDS_COMMENT -+#if __GNUC_PREREQ (5, 0) -+ /* GCC 5.0 warns about array subscript being above array bounds, -+ but that's not entirely possible since i is limited to -+ _res.nsort which is limited to MAXRESOLVSORT. This -+ is likely PR/59124 which is still not fixed. */ -+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds") -+#endif - for (j = 0 ; (unsigned)j < _res.nsort; j++) - if (_res.sort_list[j].addr.s_addr == - (((struct in_addr *)(*p))->s_addr & _res.sort_list[j].mask)) - break; -+ DIAG_POP_NEEDS_COMMENT - aval[i] = j; - if (needsort == 0 && i > 0 && j < aval[i-1]) - needsort = i; diff --git a/glibc-gethnamaddr-gcc5.patch b/glibc-gethnamaddr-gcc5.patch deleted file mode 100644 index 92fa90f..0000000 --- a/glibc-gethnamaddr-gcc5.patch +++ /dev/null @@ -1,32 +0,0 @@ -Index: glibc-2.23-276-gb65b205/resolv/gethnamaddr.c -=================================================================== ---- glibc-2.23-276-gb65b205.orig/resolv/gethnamaddr.c -+++ glibc-2.23-276-gb65b205/resolv/gethnamaddr.c -@@ -68,6 +68,7 @@ - #include - #include - #include -+#include - - #define MAXALIASES 35 - #define MAXADDRS 35 -@@ -864,10 +865,19 @@ addrsort (char **ap, int num) - - p = ap; - for (i = 0; i < num; i++, p++) { -+ DIAG_PUSH_NEEDS_COMMENT -+#if __GNUC_PREREQ (5, 0) -+ /* GCC 5.0 warns about array subscript being above array bounds, -+ but that's not entirely possible since i is limited to -+ _res.nsort which is limited to MAXRESOLVSORT. This -+ is likely PR/59124 which is still not fixed. */ -+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds") -+#endif - for (j = 0 ; (unsigned)j < _res.nsort; j++) - if (_res.sort_list[j].addr.s_addr == - (((struct in_addr *)(*p))->s_addr & _res.sort_list[j].mask)) - break; -+ DIAG_POP_NEEDS_COMMENT - aval[i] = j; - if (needsort == 0 && i > 0 && j < aval[i-1]) - needsort = i; diff --git a/glibc-ld-ctype-gcc5.patch b/glibc-ld-ctype-gcc5.patch deleted file mode 100644 index 78e7fd4..0000000 --- a/glibc-ld-ctype-gcc5.patch +++ /dev/null @@ -1,72 +0,0 @@ -Index: glibc-2.22-193-g315267a/locale/programs/ld-ctype.c -=================================================================== ---- glibc-2.22-193-g315267a.orig/locale/programs/ld-ctype.c -+++ glibc-2.22-193-g315267a/locale/programs/ld-ctype.c -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - - #include "localedef.h" - #include "charmap.h" -@@ -2534,9 +2535,19 @@ with character code range values one mus - { - size_t cnt; - -+ DIAG_PUSH_NEEDS_COMMENT -+#if __GNUC_PREREQ (5, 0) -+ /* GCC 5.0 warns about array subscript being above array bounds, -+ but that's not possible since ctype_map_new prevents -+ map_collection_nr from being greater than MAX_NR_CHARMP which -+ is the size of mapnames. This is likely PR/59124 which is still -+ not fixed. */ -+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds") -+#endif - for (cnt = 2; cnt < ctype->map_collection_nr; ++cnt) - if (strcmp (now->val.str.startmb, ctype->mapnames[cnt]) == 0) - break; -+ DIAG_POP_NEEDS_COMMENT - - if (cnt < ctype->map_collection_nr) - free (now->val.str.startmb); -@@ -2807,9 +2818,19 @@ previous definition was here"))); - - /* This could mean one of several things. First test whether - it's a character class name. */ -+ DIAG_PUSH_NEEDS_COMMENT -+#if __GNUC_PREREQ (5, 0) -+ /* GCC 5.0 warns about array subscript being above array bounds, -+ but that's not possible since ctype_class_new prevents -+ nr_charclass from being greater than MAX_NR_CHARCLASS which -+ is the size of classnames. This is likely PR/59124 which is still -+ not fixed. */ -+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds") -+#endif - for (cnt = 0; cnt < ctype->nr_charclass; ++cnt) - if (strcmp (now->val.str.startmb, ctype->classnames[cnt]) == 0) - break; -+ DIAG_POP_NEEDS_COMMENT - if (cnt < ctype->nr_charclass) - { - class_bit = _ISwbit (cnt); -@@ -2817,9 +2838,19 @@ previous definition was here"))); - free (now->val.str.startmb); - goto read_charclass; - } -+ DIAG_PUSH_NEEDS_COMMENT -+#if __GNUC_PREREQ (5, 0) -+ /* GCC 5.0 warns about array subscript being above array bounds, -+ but that's not possible since ctype_map_new prevents -+ map_collection_nr from being greater than MAX_NR_CHARMP which -+ is the size of mapnames. This is likely PR/59124 which is still -+ not fixed. */ -+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds") -+#endif - for (cnt = 0; cnt < ctype->map_collection_nr; ++cnt) - if (strcmp (now->val.str.startmb, ctype->mapnames[cnt]) == 0) - break; -+ DIAG_POP_NEEDS_COMMENT - if (cnt < ctype->map_collection_nr) - { - mapidx = cnt; diff --git a/glibc-res-hconf-gcc5.patch b/glibc-res-hconf-gcc5.patch deleted file mode 100644 index 4f5ae83..0000000 --- a/glibc-res-hconf-gcc5.patch +++ /dev/null @@ -1,29 +0,0 @@ -Index: glibc-2.22-386-g95e8397/resolv/res_hconf.c -=================================================================== ---- glibc-2.22-386-g95e8397.orig/resolv/res_hconf.c -+++ glibc-2.22-386-g95e8397/resolv/res_hconf.c -@@ -46,6 +46,7 @@ - #include "res_hconf.h" - #include - #include -+#include - - #if IS_IN (libc) - # define fgets_unlocked __fgets_unlocked -@@ -577,7 +578,16 @@ _res_hconf_trim_domain (char *hostname) - - for (i = 0; i < _res_hconf.num_trimdomains; ++i) - { -+ DIAG_PUSH_NEEDS_COMMENT -+#if __GNUC_PREREQ (5, 0) -+ /* GCC 5.0 warns about array subscript being above array bounds, -+ but that's not entirely possible since i is limited to -+ num_trimdomains which is limited to <= TRIMDOMAINS_MAX. This -+ is likely PR/59124 which is still not fixed. */ -+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds") -+#endif - const char *trim = _res_hconf.trimdomain[i]; -+ DIAG_POP_NEEDS_COMMENT - - trim_len = strlen (trim); - if (hostname_len > trim_len diff --git a/glibc.spec b/glibc.spec index 634ac1f..ce10ccd 100644 --- a/glibc.spec +++ b/glibc.spec @@ -248,14 +248,6 @@ Patch0052: glibc-disable-rwlock-elision.patch # symlink to it. Patch0053: glibc-cs-path.patch -# Fix -Warray-bounds warning for GCC5, likely PR/59124 or PR/66422. -# See Fedora bug #1263817. -Patch0054: glibc-res-hconf-gcc5.patch -Patch0055: glibc-ld-ctype-gcc5.patch -Patch0056: glibc-gethnamaddr-gcc5.patch -Patch0057: glibc-dns-host-gcc5.patch -Patch0058: glibc-bug-regex-gcc5.patch - # Add C.UTF-8 locale into /usr/lib/locale/ Patch0059: glibc-c-utf8-locale.patch @@ -877,11 +869,6 @@ microbenchmark tests on the system. %patch2034 -p1 %patch0052 -p1 %patch0053 -p1 -%patch0054 -p1 -%patch0055 -p1 -%patch0056 -p1 -%patch0057 -p1 -%patch0058 -p1 %patch0059 -p1 %patch0060 -p1 %patch2036 -p1