From: Peter Michael Green Date: Thu, 24 Feb 2022 19:33:25 +0000 (+0000) Subject: Manual merge of version 2.33-5+rpi1 and 2.33-6 to produce 2.33-6+rpi1 X-Git-Tag: archive/raspbian/2.33-6+rpi1^0 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=dffbec69139158bde164868af8f088e866be78e4;p=glibc.git Manual merge of version 2.33-5+rpi1 and 2.33-6 to produce 2.33-6+rpi1 --- dffbec69139158bde164868af8f088e866be78e4 diff --cc debian/changelog index 7d4a514c9,cb6722bc2..49830df38 --- a/debian/changelog +++ b/debian/changelog @@@ -1,15 -1,17 +1,30 @@@ - glibc (2.33-5+rpi1) bookworm-staging; urgency=medium ++glibc (2.33-6+rpi1) bookworm-staging; urgency=medium + + [changes brought forward from 2.25-2+rpi1 by Peter Michael Green at Wed, 29 Nov 2017 03:00:21 +0000] + * Disable testsuite. + + [changes introduced in 2.32-4+rpi1 by Peter Michale Green] + * Change mode on sysdeps/x86_64/configure to 644, dgit does + like modes being changed by patches, the corresponding files + for other architectures are all 644 and we don't really care + about x86-64 in raspbian anyway. + - -- Peter Michael Green Thu, 03 Feb 2022 11:20:32 +0000 ++ -- Peter Michael Green Thu, 24 Feb 2022 19:25:03 +0000 ++ + glibc (2.33-6) unstable; urgency=medium + + [ Samuel Thibault ] + * debian/patches/hurd-i386/pthread_once.diff: Fix pthread_key safety. + + [ Aurelien Jarno ] + * debian/patches/git-updates.diff: update from upstream stable branch: + - Fix HTM aborts in AVX2 multiarch string functions + - Fix an overflow bug in some implementation of wcsnlen, wmemchr, and + wcsncat + - Fix an overflow bug in wcsncmp_avx2 and wcsncmp_evex + - Fix a race condition in __opensock + + -- Aurelien Jarno Tue, 15 Feb 2022 12:21:20 +0100 glibc (2.33-5) unstable; urgency=medium diff --cc debian/patches/git-updates.diff index 9f3ca126c,2d19e46a9..695321333 --- a/debian/patches/git-updates.diff +++ b/debian/patches/git-updates.diff @@@ -6875,28 -7687,651 +7687,649 @@@ index 0000000000..e4c8a623b +static int +do_test (void) +{ - + int result = EXIT_SUCCESS; + + return do_test_1 ("memcmp", LOOP, prepare, function); + +} + diff --git a/sysdeps/x86/tst-memmove-rtm.c b/sysdeps/x86/tst-memmove-rtm.c + new file mode 100644 + index 0000000000..4bf97ef1e3 + --- /dev/null + +++ b/sysdeps/x86/tst-memmove-rtm.c + @@ -0,0 +1,53 @@ + +/* Test case for memmove inside a transactionally executing RTM region. + + Copyright (C) 2021 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + - + for (int i = 0; i < array_length (sc_options); ++i) - + { - + long int scret = sysconf (sc_options[i]._SC_val); - + if (scret < 0) - + { - + printf ("sysconf (%s) returned < 0 (%ld)\n", - + sc_options[i].name, scret); - + result = EXIT_FAILURE; - + } - + else - + printf ("sysconf (%s): %ld\n", sc_options[i].name, scret); - + } + + The GNU C Library is free software; you can redistribute it and/or + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + - + return result; + + The GNU C Library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + + + You should have received a copy of the GNU Lesser General Public + + License along with the GNU C Library; if not, see + + . */ + + + +#include + + + +#define LOOP 3000 + +#define STRING_SIZE 1024 + +char string1[STRING_SIZE]; + +char string2[STRING_SIZE]; + + + +__attribute__ ((noinline, noclone)) + +static int + +prepare (void) + +{ + + memset (string1, 'a', STRING_SIZE); + + if (memmove (string2, string1, STRING_SIZE) == string2 + + && memcmp (string2, string1, STRING_SIZE) == 0) + + return EXIT_SUCCESS; + + else + + return EXIT_FAILURE; +} + - +#include - diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure - index 84f82c2406..fc1840e23f - --- a/sysdeps/x86_64/configure + +__attribute__ ((noinline, noclone)) + +static int + +function (void) + +{ + + if (memmove (string2, string1, STRING_SIZE) == string2 + + && memcmp (string2, string1, STRING_SIZE) == 0) + + return 0; + + else + + return 1; + +} + + + +static int + +do_test (void) + +{ + + return do_test_1 ("memmove", LOOP, prepare, function); + +} + diff --git a/sysdeps/x86/tst-memrchr-rtm.c b/sysdeps/x86/tst-memrchr-rtm.c + new file mode 100644 + index 0000000000..a57a5a8eb9 + --- /dev/null + +++ b/sysdeps/x86/tst-memrchr-rtm.c + @@ -0,0 +1,54 @@ + +/* Test case for memrchr inside a transactionally executing RTM region. + + Copyright (C) 2021 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 + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + + + + The GNU C Library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + + + You should have received a copy of the GNU Lesser General Public + + License along with the GNU C Library; if not, see + + . */ + + + +#include + + + +#define LOOP 3000 + +#define STRING_SIZE 1024 + +char string1[STRING_SIZE]; + + + +__attribute__ ((noinline, noclone)) + +static int + +prepare (void) + +{ + + memset (string1, 'a', STRING_SIZE); + + string1[100] = 'c'; + + string1[STRING_SIZE - 100] = 'c'; + + char *p = memrchr (string1, 'c', STRING_SIZE); + + if (p == &string1[STRING_SIZE - 100]) + + return EXIT_SUCCESS; + + else + + return EXIT_FAILURE; + +} + + + +__attribute__ ((noinline, noclone)) + +static int + +function (void) + +{ + + char *p = memrchr (string1, 'c', STRING_SIZE); + + if (p == &string1[STRING_SIZE - 100]) + + return 0; + + else + + return 1; + +} + + + +static int + +do_test (void) + +{ + + return do_test_1 ("memrchr", LOOP, prepare, function); + +} + diff --git a/sysdeps/x86/tst-memset-rtm.c b/sysdeps/x86/tst-memset-rtm.c + new file mode 100644 + index 0000000000..bf343a4dad + --- /dev/null + +++ b/sysdeps/x86/tst-memset-rtm.c + @@ -0,0 +1,45 @@ + +/* Test case for memset inside a transactionally executing RTM region. + + Copyright (C) 2021 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 + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + + + + The GNU C Library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + + + You should have received a copy of the GNU Lesser General Public + + License along with the GNU C Library; if not, see + + . */ + + + +#include + + + +#define LOOP 3000 + +#define STRING_SIZE 1024 + +char string1[STRING_SIZE]; + + + +__attribute__ ((noinline, noclone)) + +static int + +prepare (void) + +{ + + memset (string1, 'a', STRING_SIZE); + + return EXIT_SUCCESS; + +} + + + +__attribute__ ((noinline, noclone)) + +static int + +function (void) + +{ + + memset (string1, 'a', STRING_SIZE); + + return 0; + +} + + + +static int + +do_test (void) + +{ + + return do_test_1 ("memset", LOOP, prepare, function); + +} + diff --git a/sysdeps/x86/tst-strchr-rtm.c b/sysdeps/x86/tst-strchr-rtm.c + new file mode 100644 + index 0000000000..a82e29c072 + --- /dev/null + +++ b/sysdeps/x86/tst-strchr-rtm.c + @@ -0,0 +1,54 @@ + +/* Test case for strchr inside a transactionally executing RTM region. + + Copyright (C) 2021 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 + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + + + + The GNU C Library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + + + You should have received a copy of the GNU Lesser General Public + + License along with the GNU C Library; if not, see + + . */ + + + +#include + + + +#define LOOP 3000 + +#define STRING_SIZE 1024 + +char string1[STRING_SIZE]; + + + +__attribute__ ((noinline, noclone)) + +static int + +prepare (void) + +{ + + memset (string1, 'a', STRING_SIZE - 1); + + string1[100] = 'c'; + + string1[STRING_SIZE - 100] = 'c'; + + char *p = strchr (string1, 'c'); + + if (p == &string1[100]) + + return EXIT_SUCCESS; + + else + + return EXIT_FAILURE; + +} + + + +__attribute__ ((noinline, noclone)) + +static int + +function (void) + +{ + + char *p = strchr (string1, 'c'); + + if (p == &string1[100]) + + return 0; + + else + + return 1; + +} + + + +static int + +do_test (void) + +{ + + return do_test_1 ("strchr", LOOP, prepare, function); + +} + diff --git a/sysdeps/x86/tst-strcpy-rtm.c b/sysdeps/x86/tst-strcpy-rtm.c + new file mode 100644 + index 0000000000..2b2a583fb4 + --- /dev/null + +++ b/sysdeps/x86/tst-strcpy-rtm.c + @@ -0,0 +1,53 @@ + +/* Test case for strcpy inside a transactionally executing RTM region. + + Copyright (C) 2021 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 + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + + + + The GNU C Library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + + + You should have received a copy of the GNU Lesser General Public + + License along with the GNU C Library; if not, see + + . */ + + + +#include + + + +#define LOOP 3000 + +#define STRING_SIZE 1024 + +char string1[STRING_SIZE]; + +char string2[STRING_SIZE]; + + + +__attribute__ ((noinline, noclone)) + +static int + +prepare (void) + +{ + + memset (string1, 'a', STRING_SIZE - 1); + + if (strcpy (string2, string1) == string2 + + && strcmp (string2, string1) == 0) + + return EXIT_SUCCESS; + + else + + return EXIT_FAILURE; + +} + + + +__attribute__ ((noinline, noclone)) + +static int + +function (void) + +{ + + if (strcpy (string2, string1) == string2 + + && strcmp (string2, string1) == 0) + + return 0; + + else + + return 1; + +} + + + +static int + +do_test (void) + +{ + + return do_test_1 ("strcpy", LOOP, prepare, function); + +} + diff --git a/sysdeps/x86/tst-string-rtm.h b/sysdeps/x86/tst-string-rtm.h + new file mode 100644 + index 0000000000..d2470afa1e + --- /dev/null + +++ b/sysdeps/x86/tst-string-rtm.h + @@ -0,0 +1,72 @@ + +/* Test string function in a transactionally executing RTM region. + + Copyright (C) 2021 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 + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + + + + The GNU C Library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + + + You should have received a copy of the GNU Lesser General Public + + License along with the GNU C Library; if not, see + + . */ + + + +#include + +#include + +#include + +#include + +#include + + + +static int + +do_test_1 (const char *name, unsigned int loop, int (*prepare) (void), + + int (*function) (void)) + +{ + + if (!CPU_FEATURE_USABLE (RTM)) + + return EXIT_UNSUPPORTED; + + + + int status = prepare (); + + if (status != EXIT_SUCCESS) + + return status; + + + + unsigned int i; + + unsigned int naborts = 0; + + unsigned int failed = 0; + + for (i = 0; i < loop; i++) + + { + + failed |= function (); + + if (_xbegin() == _XBEGIN_STARTED) + + { + + failed |= function (); + + _xend(); + + } + + else + + { + + failed |= function (); + + ++naborts; + + } + + } + + + + if (failed) + + FAIL_EXIT1 ("%s() failed", name); + + + + if (naborts) + + { + + /* NB: Low single digit (<= 5%) noise-level aborts are normal for + + TSX. */ + + double rate = 100 * ((double) naborts) / ((double) loop); + + if (rate > 5) + + FAIL_EXIT1 ("TSX abort rate: %.2f%% (%d out of %d)", + + rate, naborts, loop); + + } + + + + return EXIT_SUCCESS; + +} + + + +static int do_test (void); + + + +#include + diff --git a/sysdeps/x86/tst-strlen-rtm.c b/sysdeps/x86/tst-strlen-rtm.c + new file mode 100644 + index 0000000000..0dcf14db87 + --- /dev/null + +++ b/sysdeps/x86/tst-strlen-rtm.c + @@ -0,0 +1,53 @@ + +/* Test case for strlen inside a transactionally executing RTM region. + + Copyright (C) 2021 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 + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + + + + The GNU C Library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + + + You should have received a copy of the GNU Lesser General Public + + License along with the GNU C Library; if not, see + + . */ + + + +#include + + + +#define LOOP 3000 + +#define STRING_SIZE 1024 + +char string1[STRING_SIZE]; + + + +__attribute__ ((noinline, noclone)) + +static int + +prepare (void) + +{ + + memset (string1, 'a', STRING_SIZE - 1); + + string1[STRING_SIZE - 100] = '\0'; + + size_t len = strlen (string1); + + if (len == STRING_SIZE - 100) + + return EXIT_SUCCESS; + + else + + return EXIT_FAILURE; + +} + + + +__attribute__ ((noinline, noclone)) + +static int + +function (void) + +{ + + size_t len = strlen (string1); + + if (len == STRING_SIZE - 100) + + return 0; + + else + + return 1; + +} + + + +static int + +do_test (void) + +{ + + return do_test_1 ("strlen", LOOP, prepare, function); + +} + diff --git a/sysdeps/x86/tst-strncmp-rtm.c b/sysdeps/x86/tst-strncmp-rtm.c + new file mode 100644 + index 0000000000..236ad951b5 + --- /dev/null + +++ b/sysdeps/x86/tst-strncmp-rtm.c + @@ -0,0 +1,52 @@ + +/* Test case for strncmp inside a transactionally executing RTM region. + + Copyright (C) 2021 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 + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + + + + The GNU C Library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + + + You should have received a copy of the GNU Lesser General Public + + License along with the GNU C Library; if not, see + + . */ + + + +#include + + + +#define LOOP 3000 + +#define STRING_SIZE 1024 + +char string1[STRING_SIZE]; + +char string2[STRING_SIZE]; + + + +__attribute__ ((noinline, noclone)) + +static int + +prepare (void) + +{ + + memset (string1, 'a', STRING_SIZE - 1); + + memset (string2, 'a', STRING_SIZE - 1); + + if (strncmp (string1, string2, STRING_SIZE) == 0) + + return EXIT_SUCCESS; + + else + + return EXIT_FAILURE; + +} + + + +__attribute__ ((noinline, noclone)) + +static int + +function (void) + +{ + + if (strncmp (string1, string2, STRING_SIZE) == 0) + + return 0; + + else + + return 1; + +} + + + +static int + +do_test (void) + +{ + + return do_test_1 ("strncmp", LOOP, prepare, function); + +} + diff --git a/sysdeps/x86/tst-strrchr-rtm.c b/sysdeps/x86/tst-strrchr-rtm.c + new file mode 100644 + index 0000000000..e32bfaf5f5 + --- /dev/null + +++ b/sysdeps/x86/tst-strrchr-rtm.c + @@ -0,0 +1,53 @@ + +/* Test case for strrchr inside a transactionally executing RTM region. + + Copyright (C) 2021 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 + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + + + + The GNU C Library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + + + You should have received a copy of the GNU Lesser General Public + + License along with the GNU C Library; if not, see + + . */ + + + +#include + + + +#define LOOP 3000 + +#define STRING_SIZE 1024 + +char string1[STRING_SIZE]; + + + +__attribute__ ((noinline, noclone)) + +static int + +prepare (void) + +{ + + memset (string1, 'a', STRING_SIZE - 1); + + string1[STRING_SIZE - 100] = 'c'; + + char *p = strrchr (string1, 'c'); + + if (p == &string1[STRING_SIZE - 100]) + + return EXIT_SUCCESS; + + else + + return EXIT_FAILURE; + +} + + + +__attribute__ ((noinline, noclone)) + +static int + +function (void) + +{ + + char *p = strrchr (string1, 'c'); + + if (p == &string1[STRING_SIZE - 100]) + + return 0; + + else + + return 1; + +} + + + +static int + +do_test (void) + +{ + + return do_test_1 ("strrchr", LOOP, prepare, function); + +} + diff --git a/sysdeps/x86/tst-sysconf-cache-linesize-static.c b/sysdeps/x86/tst-sysconf-cache-linesize-static.c + new file mode 100644 + index 0000000000..152ae68821 + --- /dev/null + +++ b/sysdeps/x86/tst-sysconf-cache-linesize-static.c + @@ -0,0 +1 @@ + +#include "tst-sysconf-cache-linesize.c" + diff --git a/sysdeps/x86/tst-sysconf-cache-linesize.c b/sysdeps/x86/tst-sysconf-cache-linesize.c + new file mode 100644 + index 0000000000..642dbde5d2 + --- /dev/null + +++ b/sysdeps/x86/tst-sysconf-cache-linesize.c + @@ -0,0 +1,57 @@ + +/* Test system cache line sizes. + + Copyright (C) 2021 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 + + modify it under the terms of the GNU Lesser General Public + + License as published by the Free Software Foundation; either + + version 2.1 of the License, or (at your option) any later version. + + + + The GNU C Library is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + + Lesser General Public License for more details. + + + + You should have received a copy of the GNU Lesser General Public + + License along with the GNU C Library; if not, see + + . */ + + + +#include + +#include + +#include + +#include + + + +static struct + +{ + + const char *name; + + int _SC_val; + +} sc_options[] = + + { + +#define N(name) { "_SC_"#name, _SC_##name } + + N (LEVEL1_ICACHE_LINESIZE), + + N (LEVEL1_DCACHE_LINESIZE), + + N (LEVEL2_CACHE_LINESIZE) + + }; + + + +static int + +do_test (void) + +{ + + int result = EXIT_SUCCESS; + + + + for (int i = 0; i < array_length (sc_options); ++i) + + { + + long int scret = sysconf (sc_options[i]._SC_val); + + if (scret < 0) + + { + + printf ("sysconf (%s) returned < 0 (%ld)\n", + + sc_options[i].name, scret); + + result = EXIT_FAILURE; + + } + + else + + printf ("sysconf (%s): %ld\n", sc_options[i].name, scret); + + } + + + + return result; + +} + + + +#include + diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile + index d1d7cb9d2e..2dd9fd5161 100644 + --- a/sysdeps/x86_64/Makefile + +++ b/sysdeps/x86_64/Makefile + @@ -20,6 +20,8 @@ endif + ifeq ($(subdir),string) + sysdep_routines += strcasecmp_l-nonascii strncase_l-nonascii + gen-as-const-headers += locale-defines.sym + +tests += \ + + tst-rsi-strlen + endif + + ifeq ($(subdir),elf) + @@ -189,6 +191,11 @@ ifeq ($(subdir),csu) + gen-as-const-headers += tlsdesc.sym rtld-offsets.sym + endif + + +ifeq ($(subdir),wcsmbs) + +tests += \ + + tst-rsi-wcslen + +endif + + + $(objpfx)x86_64/tst-x86_64mod-1.os: $(objpfx)tst-x86_64mod-1.os + $(make-target-directory) + rm -f $@ + diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure -old mode 100644 -new mode 100755 + index 198554d788..75c96d60d4 + --- a/sysdeps/x86_64/configure +++ b/sysdeps/x86_64/configure @@ -107,39 +107,6 @@ if test x"$build_mathvec" = xnotset; then build_mathvec=yes