From c9be2cdeba9517152ceeb8a797e17ea95b466d484d59349757e91503a10ab976 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 24 Jun 2019 07:15:53 +0000 Subject: [PATCH 1/4] Accepting request 711647 from home:Andreas_Schwab:Factory - nss-files-long-lines-2.patch: Remove obsolete patch OBS-URL: https://build.opensuse.org/request/show/711647 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=529 --- glibc.changes | 5 ++ glibc.spec | 3 - nss-files-long-lines-2.patch | 164 ----------------------------------- 3 files changed, 5 insertions(+), 167 deletions(-) delete mode 100644 nss-files-long-lines-2.patch diff --git a/glibc.changes b/glibc.changes index 930ac70..8871bc1 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jun 12 12:10:59 UTC 2019 - Andreas Schwab + +- nss-files-long-lines-2.patch: Remove obsolete patch + ------------------------------------------------------------------- Wed May 15 15:55:36 UTC 2019 - Andreas Schwab diff --git a/glibc.spec b/glibc.spec index 418cbc8..86dd169 100644 --- a/glibc.spec +++ b/glibc.spec @@ -308,8 +308,6 @@ Patch1015: wfile-sync-crash.patch Patch2000: fix-locking-in-_IO_cleanup.patch # PATCH-FIX-UPSTREAM Fix fnmatch handling of collating elements (BZ #17396, BZ #16976) Patch2004: fnmatch-collating-elements.patch -# PATCH-FIX-UPSTREAM Properly reread entry after failure in nss_files getent function (BZ #18991) -Patch2005: nss-files-long-lines-2.patch # PATCH-FIX-UPSTREAM Fix iconv buffer handling with IGNORE error handler (BZ #18830) Patch2006: iconv-reset-input-buffer.patch # PATCH-FIX-UPSTREAM Avoid concurrency problem in ldconfig (BZ #23973) @@ -530,7 +528,6 @@ makedb: A program to create a database for nss %patch2000 -p1 %patch2004 -p1 -%patch2005 -p1 %patch2006 -p1 %patch2007 -p1 diff --git a/nss-files-long-lines-2.patch b/nss-files-long-lines-2.patch deleted file mode 100644 index 2e46d0c..0000000 --- a/nss-files-long-lines-2.patch +++ /dev/null @@ -1,164 +0,0 @@ -Properly reread entry after failure in nss_files getent function (bug 18991) - - * nss/nss_files/files-XXX.c (position, need_reread): New - variables. - (CONCAT(_nss_files_set,ENTNAME)): Initialize them. - (CONCAT(_nss_files_get,ENTNAME_r)): Likewise. Reposition stream - if last call was uncessful. - * nss/nss_files/files-alias.c (position, need_reread): New - variables. - (_nss_files_setaliasent): Initialize them. - (_nss_files_getaliasent_r): Likewise. Reposition stream if last - call was uncessful. - -Index: glibc-2.27/nss/nss_files/files-XXX.c -=================================================================== ---- glibc-2.27.orig/nss/nss_files/files-XXX.c -+++ glibc-2.27/nss/nss_files/files-XXX.c -@@ -65,6 +65,10 @@ __libc_lock_define_initialized (static, - getXXbyYY operations all use their own stream. */ - - static FILE *stream; -+/* Position after the last sucessfully read entry. */ -+static fpos_t position; -+/* Whether we need to reread the last entry on the next call. */ -+static bool need_reread; - - /* Open database file if not already opened. */ - static enum nss_status -@@ -96,6 +100,15 @@ CONCAT(_nss_files_set,ENTNAME) (int stay - - status = internal_setent (&stream); - -+ if (status == NSS_STATUS_SUCCESS && fgetpos (stream, &position) < 0) -+ { -+ fclose (stream); -+ stream = NULL; -+ status = NSS_STATUS_UNAVAIL; -+ } -+ -+ need_reread = false; -+ - __libc_lock_unlock (lock); - - return status; -@@ -251,11 +264,42 @@ CONCAT(_nss_files_get,ENTNAME_r) (struct - status = internal_setent (&stream); - - __set_errno (save_errno); -+ -+ if (status == NSS_STATUS_SUCCESS && fgetpos (stream, &position) < 0) -+ { -+ fclose (stream); -+ stream = NULL; -+ status = NSS_STATUS_UNAVAIL; -+ } -+ need_reread = false; -+ } -+ -+ if (status == NSS_STATUS_SUCCESS) -+ { -+ /* Reposition the stream if the last call was unsucessful. */ -+ if (need_reread) -+ { -+ if (fsetpos (stream, &position) < 0) -+ status = NSS_STATUS_UNAVAIL; -+ else -+ need_reread = false; -+ } - } - - if (status == NSS_STATUS_SUCCESS) -- status = internal_getent (stream, result, buffer, buflen, errnop -- H_ERRNO_ARG EXTRA_ARGS_VALUE); -+ { -+ status = internal_getent (stream, result, buffer, buflen, errnop -+ H_ERRNO_ARG EXTRA_ARGS_VALUE); -+ -+ /* Remember this position if we were successful. If the -+ operation failed we give the user a chance to repeat the -+ operation (perhaps the buffer was too small). */ -+ if (status == NSS_STATUS_SUCCESS) -+ fgetpos (stream, &position); -+ else -+ /* We must make sure we reposition the stream the next call. */ -+ need_reread = true; -+ } - - __libc_lock_unlock (lock); - -Index: glibc-2.27/nss/nss_files/files-alias.c -=================================================================== ---- glibc-2.27.orig/nss/nss_files/files-alias.c -+++ glibc-2.27/nss/nss_files/files-alias.c -@@ -38,6 +38,10 @@ __libc_lock_define_initialized (static, - getXXbyYY operations all use their own stream. */ - - static FILE *stream; -+/* Position after the last sucessfully read entry. */ -+static fpos_t position; -+/* Whether we need to reread the last entry on the next call. */ -+static bool need_reread; - - - static enum nss_status -@@ -69,6 +73,15 @@ _nss_files_setaliasent (void) - - status = internal_setent (&stream); - -+ if (status == NSS_STATUS_SUCCESS && fgetpos (stream, &position) < 0) -+ { -+ fclose (stream); -+ stream = NULL; -+ status = NSS_STATUS_UNAVAIL; -+ } -+ -+ need_reread = false; -+ - __libc_lock_unlock (lock); - - return status; -@@ -353,7 +366,29 @@ _nss_files_getaliasent_r (struct aliasen - - /* Be prepared that the set*ent function was not called before. */ - if (stream == NULL) -- status = internal_setent (&stream); -+ { -+ status = internal_setent (&stream); -+ -+ if (status == NSS_STATUS_SUCCESS && fgetpos (stream, &position) < 0) -+ { -+ fclose (stream); -+ stream = NULL; -+ status = NSS_STATUS_UNAVAIL; -+ } -+ need_reread = false; -+ } -+ -+ if (status == NSS_STATUS_SUCCESS) -+ { -+ /* Reposition the stream if the last call way unsucessful. */ -+ if (need_reread) -+ { -+ if (fsetpos (stream, &position) < 0) -+ status = NSS_STATUS_UNAVAIL; -+ else -+ need_reread = false; -+ } -+ } - - if (status == NSS_STATUS_SUCCESS) - { -@@ -363,6 +398,12 @@ _nss_files_getaliasent_r (struct aliasen - do - status = get_next_alias (stream, NULL, result, buffer, buflen, errnop); - while (status == NSS_STATUS_RETURN); -+ -+ /* If we successfully read an entry remember this position. */ -+ if (status == NSS_STATUS_SUCCESS) -+ fgetpos (stream, &position); -+ else -+ need_reread = true; - } - - __libc_lock_unlock (lock); From b8dcef20ae6c9b8c9bb40a34b0707b89fc7faaa003d9f47f18532e0b67ff336b Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 24 Jun 2019 11:56:25 +0000 Subject: [PATCH 2/4] Accepting request 711655 from home:marxin:branches:Base:System - Disable LTO due to a usage of top-level assembler that causes LTO issues (boo#1138807). OBS-URL: https://build.opensuse.org/request/show/711655 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=530 --- glibc.changes | 6 ++++++ glibc.spec | 3 +++ 2 files changed, 9 insertions(+) diff --git a/glibc.changes b/glibc.changes index 8871bc1..52efc48 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jun 20 10:02:20 UTC 2019 - Martin Liška + +- Disable LTO due to a usage of top-level assembler that + causes LTO issues (boo#1138807). + ------------------------------------------------------------------- Wed Jun 12 12:10:59 UTC 2019 - Andreas Schwab diff --git a/glibc.spec b/glibc.spec index 86dd169..5e333d0 100644 --- a/glibc.spec +++ b/glibc.spec @@ -554,6 +554,9 @@ rm -fv sysdeps/powerpc/powerpc32/power4/hp-timing.c sysdeps/powerpc/powerpc32/po find . -name configure | xargs touch %build +# Disable LTO due to a usage of top-level assembler that +# causes LTO issues (boo#1138807). +%define _lto_cflags %{nil} if [ -x /bin/uname.bin ]; then /bin/uname.bin -a else From e6a16310f418a1937651c95641b33da558a30dd12e6a73f67439453840f8f303 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 25 Jun 2019 13:42:26 +0000 Subject: [PATCH 3/4] Accepting request 711825 from home:marxin:branches:Base:System - Set optflags for i686 after _lto_cflags is set (boo#1138807). OBS-URL: https://build.opensuse.org/request/show/711825 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=531 --- glibc.changes | 5 +++++ glibc.spec | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/glibc.changes b/glibc.changes index 52efc48..f5034dc 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jun 25 07:30:13 UTC 2019 - Martin Liška + +- Set optflags for i686 after _lto_cflags is set (boo#1138807). + ------------------------------------------------------------------- Thu Jun 20 10:02:20 UTC 2019 - Martin Liška diff --git a/glibc.spec b/glibc.spec index 5e333d0..bf7b90a 100644 --- a/glibc.spec +++ b/glibc.spec @@ -83,7 +83,6 @@ BuildRequires: zlib-devel %if "%flavor" == "i686" ExclusiveArch: i586 i686 BuildArch: i686 -%global optflags %(echo "%optflags"|sed -e s/i586/i686/) -march=i686 -mtune=generic %endif %define __filter_GLIBC_PRIVATE 1 @@ -557,6 +556,9 @@ find . -name configure | xargs touch # Disable LTO due to a usage of top-level assembler that # causes LTO issues (boo#1138807). %define _lto_cflags %{nil} +%if "%flavor" == "i686" +%global optflags %(echo "%optflags"|sed -e s/i586/i686/) -march=i686 -mtune=generic +%endif if [ -x /bin/uname.bin ]; then /bin/uname.bin -a else From 3a6133b4ec57c842bd91820cd72cf014449c777260ab90f395c26318c20cd91d Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 26 Jun 2019 15:17:28 +0000 Subject: [PATCH 4/4] Accepting request 712158 from home:Andreas_Schwab:Factory - malloc-tests-warnings.patch: Fix warnings in malloc tests with GCC 9 OBS-URL: https://build.opensuse.org/request/show/712158 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=532 --- glibc.changes | 5 ++ glibc.spec | 3 + malloc-tests-warnings.patch | 123 ++++++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 malloc-tests-warnings.patch diff --git a/glibc.changes b/glibc.changes index f5034dc..52f8d53 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jun 26 07:41:20 UTC 2019 - Andreas Schwab + +- malloc-tests-warnings.patch: Fix warnings in malloc tests with GCC 9 + ------------------------------------------------------------------- Tue Jun 25 07:30:13 UTC 2019 - Martin Liška diff --git a/glibc.spec b/glibc.spec index bf7b90a..ad8805f 100644 --- a/glibc.spec +++ b/glibc.spec @@ -299,6 +299,8 @@ Patch1013: pldd-inf-loop.patch Patch1014: malloc-large-bin-corruption-check.patch # PATCH-FIX-UPSTREAM Fix crash in _IO_wfile_sync (BZ #20568) Patch1015: wfile-sync-crash.patch +# PATCH-FIX-UPSTREAM malloc: Fix warnings in tests with GCC 9 +Patch1016: malloc-tests-warnings.patch ### # Patches awaiting upstream approval @@ -524,6 +526,7 @@ makedb: A program to create a database for nss %patch1013 -p1 %patch1014 -p1 %patch1015 -p1 +%patch1016 -p1 %patch2000 -p1 %patch2004 -p1 diff --git a/malloc-tests-warnings.patch b/malloc-tests-warnings.patch new file mode 100644 index 0000000..d4c506e --- /dev/null +++ b/malloc-tests-warnings.patch @@ -0,0 +1,123 @@ +2019-04-18 Adhemerval Zanella + + * malloc/tst-memalign.c (do_test): Disable + -Walloc-size-larger-than= around tests of malloc with negative + sizes. + * malloc/tst-malloc-too-large.c (do_test): Likewise. + +Index: glibc-2.29/malloc/tst-malloc-too-large.c +=================================================================== +--- glibc-2.29.orig/malloc/tst-malloc-too-large.c ++++ glibc-2.29/malloc/tst-malloc-too-large.c +@@ -72,13 +72,28 @@ test_large_allocations (size_t size) + void * ptr_to_realloc; + + test_setup (); ++ 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 + TEST_VERIFY (malloc (size) == NULL); ++#if __GNUC_PREREQ (7, 0) ++ DIAG_POP_NEEDS_COMMENT; ++#endif + TEST_VERIFY (errno == ENOMEM); + + ptr_to_realloc = malloc (16); + TEST_VERIFY_EXIT (ptr_to_realloc != NULL); + test_setup (); ++#if __GNUC_PREREQ (7, 0) ++ DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than="); ++#endif + TEST_VERIFY (realloc (ptr_to_realloc, size) == NULL); ++#if __GNUC_PREREQ (7, 0) ++ DIAG_POP_NEEDS_COMMENT; ++#endif + TEST_VERIFY (errno == ENOMEM); + free (ptr_to_realloc); + +@@ -135,7 +150,13 @@ test_large_aligned_allocations (size_t s + for (align = 1; align <= pagesize; align *= 2) + { + test_setup (); ++#if __GNUC_PREREQ (7, 0) ++ DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than="); ++#endif + TEST_VERIFY (memalign (align, size) == NULL); ++#if __GNUC_PREREQ (7, 0) ++ DIAG_POP_NEEDS_COMMENT; ++#endif + TEST_VERIFY (errno == ENOMEM); + + /* posix_memalign expects an alignment that is a power of 2 *and* a +@@ -151,7 +172,13 @@ test_large_aligned_allocations (size_t s + if ((size % align) == 0) + { + test_setup (); ++#if __GNUC_PREREQ (7, 0) ++ DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than="); ++#endif + TEST_VERIFY (aligned_alloc (align, size) == NULL); ++#if __GNUC_PREREQ (7, 0) ++ DIAG_POP_NEEDS_COMMENT; ++#endif + TEST_VERIFY (errno == ENOMEM); + } + } +@@ -159,11 +186,23 @@ test_large_aligned_allocations (size_t s + /* Both valloc and pvalloc return page-aligned memory. */ + + test_setup (); ++#if __GNUC_PREREQ (7, 0) ++ DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than="); ++#endif + TEST_VERIFY (valloc (size) == NULL); ++#if __GNUC_PREREQ (7, 0) ++ DIAG_POP_NEEDS_COMMENT; ++#endif + TEST_VERIFY (errno == ENOMEM); + + test_setup (); ++#if __GNUC_PREREQ (7, 0) ++ DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than="); ++#endif + TEST_VERIFY (pvalloc (size) == NULL); ++#if __GNUC_PREREQ (7, 0) ++ DIAG_POP_NEEDS_COMMENT; ++#endif + TEST_VERIFY (errno == ENOMEM); + } + +Index: glibc-2.29/malloc/tst-memalign.c +=================================================================== +--- glibc-2.29.orig/malloc/tst-memalign.c ++++ glibc-2.29/malloc/tst-memalign.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + static int errors = 0; + +@@ -41,9 +42,18 @@ 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 + /* An attempt to allocate a huge value should return NULL and set + errno to ENOMEM. */ + p = memalign (sizeof (void *), -1); ++#if __GNUC_PREREQ (7, 0) ++ DIAG_POP_NEEDS_COMMENT; ++#endif + + save = errno; +