!29 add filelist and backport many patch
Merge pull request !29 from wswsamao/mymaster
This commit is contained in:
commit
7e9c5e6176
62
Do-not-use-gettimeofday-in-random-id.patch
Normal file
62
Do-not-use-gettimeofday-in-random-id.patch
Normal file
@ -0,0 +1,62 @@
|
||||
From 359653aaacad463d916323f03c0ac3c47405aafa Mon Sep 17 00:00:00 2001
|
||||
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
Date: Wed, 16 Jan 2019 18:10:56 +0000
|
||||
Subject: [PATCH] Do not use HP_TIMING_NOW for random bits
|
||||
|
||||
This patch removes the HP_TIMING_BITS usage for fast random bits and replace
|
||||
with clock_gettime (CLOCK_MONOTONIC). It has unspecified starting time and
|
||||
nano-second accuracy, so its randomness is significantly better than
|
||||
gettimeofday.
|
||||
|
||||
Althoug it should incur in more overhead (specially for architecture that
|
||||
support hp-timing), the symbol is also common implemented as a vDSO.
|
||||
|
||||
Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu. I also
|
||||
checked on a i686-gnu build.
|
||||
|
||||
* include/random-bits.h: New file.
|
||||
* resolv/res_mkquery.c [HP_TIMING_AVAIL] (RANDOM_BITS,
|
||||
(__res_context_mkquery): Remove usage hp-timing usage and replace with
|
||||
random_bits.
|
||||
* resolv/res_send.c [HP_TIMING_AVAIL] (nameserver_offset): Likewise.
|
||||
* sysdeps/posix/tempname.c [HP_TIMING_AVAIL] (__gen_tempname):
|
||||
Likewise.
|
||||
|
||||
note that this patch is just parts of the origin one to adapt glibc-2.28
|
||||
|
||||
|
||||
---
|
||||
resolv/res_mkquery.c | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/resolv/res_mkquery.c b/resolv/res_mkquery.c
|
||||
index 213abeef..7ba40640 100644
|
||||
--- a/resolv/res_mkquery.c
|
||||
+++ b/resolv/res_mkquery.c
|
||||
@@ -95,6 +95,7 @@
|
||||
|
||||
#include <hp-timing.h>
|
||||
#include <stdint.h>
|
||||
+#include <time.h>
|
||||
#if HP_TIMING_AVAIL
|
||||
# define RANDOM_BITS(Var) { uint64_t v64; HP_TIMING_NOW (v64); Var = v64; }
|
||||
#endif
|
||||
@@ -124,9 +125,12 @@ __res_context_mkquery (struct resolv_context *ctx, int op, const char *dname,
|
||||
#ifdef RANDOM_BITS
|
||||
RANDOM_BITS (randombits);
|
||||
#else
|
||||
- struct timeval tv;
|
||||
- __gettimeofday (&tv, NULL);
|
||||
- randombits = (tv.tv_sec << 8) ^ tv.tv_usec;
|
||||
+ struct timespec tv;
|
||||
+ clock_gettime (CLOCK_MONOTONIC, &tv);
|
||||
+ /* Shuffle the lower bits to minimize the clock bias. */
|
||||
+ uint32_t ret = tv.tv_nsec ^ tv.tv_sec;
|
||||
+ ret ^= (ret << 24) | (ret >> 8);
|
||||
+ randombits = ret;
|
||||
#endif
|
||||
|
||||
hp->id = randombits;
|
||||
--
|
||||
2.19.1
|
||||
|
||||
52
Fix-avx2-strncmp-offset-compare-condition-check-BZ-2.patch
Normal file
52
Fix-avx2-strncmp-offset-compare-condition-check-BZ-2.patch
Normal file
@ -0,0 +1,52 @@
|
||||
From 75870237ff3bb363447b03f4b0af100227570910 Mon Sep 17 00:00:00 2001
|
||||
From: Sunil K Pandey <skpgkp1@gmail.com>
|
||||
Date: Fri, 12 Jun 2020 08:57:16 -0700
|
||||
Subject: [PATCH] Fix avx2 strncmp offset compare condition check [BZ #25933]
|
||||
|
||||
strcmp-avx2.S: In avx2 strncmp function, strings are compared in
|
||||
chunks of 4 vector size(i.e. 32x4=128 byte for avx2). After first 4
|
||||
vector size comparison, code must check whether it already passed
|
||||
the given offset. This patch implement avx2 offset check condition
|
||||
for strncmp function, if both string compare same for first 4 vector
|
||||
size.
|
||||
---
|
||||
sysdeps/x86_64/multiarch/strcmp-avx2.S | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S b/sysdeps/x86_64/multiarch/strcmp-avx2.S
|
||||
index 5f88a68262..d42b04b54f 100644
|
||||
--- a/sysdeps/x86_64/multiarch/strcmp-avx2.S
|
||||
+++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S
|
||||
@@ -591,7 +591,14 @@ L(loop_cross_page_2_vec):
|
||||
movl $(PAGE_SIZE / (VEC_SIZE * 4) - 1), %esi
|
||||
|
||||
testq %rdi, %rdi
|
||||
+# ifdef USE_AS_STRNCMP
|
||||
+ /* At this point, if %rdi value is 0, it already tested
|
||||
+ VEC_SIZE*4+%r10 byte starting from %rax. This label
|
||||
+ checks whether strncmp maximum offset reached or not. */
|
||||
+ je L(string_nbyte_offset_check)
|
||||
+# else
|
||||
je L(back_to_loop)
|
||||
+# endif
|
||||
tzcntq %rdi, %rcx
|
||||
addq %r10, %rcx
|
||||
/* Adjust for number of bytes skipped. */
|
||||
@@ -627,6 +634,14 @@ L(loop_cross_page_2_vec):
|
||||
VZEROUPPER
|
||||
ret
|
||||
|
||||
+# ifdef USE_AS_STRNCMP
|
||||
+L(string_nbyte_offset_check):
|
||||
+ leaq (VEC_SIZE * 4)(%r10), %r10
|
||||
+ cmpq %r10, %r11
|
||||
+ jbe L(zero)
|
||||
+ jmp L(back_to_loop)
|
||||
+# endif
|
||||
+
|
||||
.p2align 4
|
||||
L(cross_page_loop):
|
||||
/* Check one byte/dword at a time. */
|
||||
--
|
||||
2.19.1
|
||||
|
||||
251
Reset-converter-state-after-second-wchar_t-output-Bu.patch
Normal file
251
Reset-converter-state-after-second-wchar_t-output-Bu.patch
Normal file
@ -0,0 +1,251 @@
|
||||
From c580e6466d6da8262820cdbad19f32c5546226cf Mon Sep 17 00:00:00 2001
|
||||
From: Carlos O'Donell <carlos@redhat.com>
|
||||
Date: Fri, 27 Mar 2020 17:03:36 -0400
|
||||
Subject: [PATCH] Reset converter state after second wchar_t output (Bug 25734)
|
||||
|
||||
An input BIG5-HKSCS character may be converted into at most 2 wchar_t
|
||||
characters. After outputting the second whcar_t character (which was
|
||||
saved in the converter state) we must reset the state. If we fail
|
||||
to reset the state we will be stuck continually copying that
|
||||
character to the output even if we have further input to consider.
|
||||
|
||||
We add a new test case that covers the 4 BIG5-HKSCS characters
|
||||
that may become 2 wchar_t characters.
|
||||
|
||||
Reviewed-by: Tom Honermann <tom@honermann.net>
|
||||
---
|
||||
iconvdata/Makefile | 17 ++-
|
||||
iconvdata/big5hkscs.c | 3 +
|
||||
iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c | 160 ++++++++++++++++++++++
|
||||
3 files changed, 176 insertions(+), 4 deletions(-)
|
||||
create mode 100644 iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c
|
||||
|
||||
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
|
||||
index c83962f351b..4ec2741cdce 100644
|
||||
--- a/iconvdata/Makefile
|
||||
+++ b/iconvdata/Makefile
|
||||
@@ -73,7 +73,7 @@ modules.so := $(addsuffix .so, $(modules))
|
||||
ifeq (yes,$(build-shared))
|
||||
tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
|
||||
tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \
|
||||
- bug-iconv10 bug-iconv11 bug-iconv12
|
||||
+ bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4
|
||||
ifeq ($(have-thread-library),yes)
|
||||
tests += bug-iconv3
|
||||
endif
|
||||
@@ -275,16 +275,21 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
-include ../Rules
|
||||
-
|
||||
ifeq ($(run-built-tests),yes)
|
||||
-LOCALES := de_DE.UTF-8
|
||||
+LOCALES := \
|
||||
+ de_DE.UTF-8 \
|
||||
+ zh_HK.BIG5-HKSCS \
|
||||
+ $(NULL)
|
||||
+
|
||||
include ../gen-locales.mk
|
||||
|
||||
$(objpfx)bug-iconv6.out: $(gen-locales)
|
||||
$(objpfx)tst-iconv7.out: $(gen-locales)
|
||||
+$(objpfx)tst-iconv-big5-hkscs-to-2ucs4.out: $(gen-locales)
|
||||
endif
|
||||
|
||||
+include ../Rules
|
||||
+
|
||||
# Set libof-* for each routine.
|
||||
cpp-srcs-left := $(modules) $(generated-modules) $(libJIS-routines) \
|
||||
$(libKSC-routines) $(libGB-routines) $(libCNS-routines) \
|
||||
@@ -340,3 +345,7 @@ tst-tables-clean:
|
||||
|
||||
$(objpfx)gconv-modules: gconv-modules
|
||||
cat $(sysdeps-gconv-modules) $^ > $@
|
||||
+
|
||||
+# Test requires BIG5HKSCS.
|
||||
+$(objpfx)tst-iconv-big5-hkscs-to-2ucs4.out: $(objpfx)gconv-modules \
|
||||
+ $(addprefix $(objpfx),$(modules.so))
|
||||
diff --git a/iconvdata/big5hkscs.c b/iconvdata/big5hkscs.c
|
||||
index 01fcfeba76b..ef325119b18 100644
|
||||
--- a/iconvdata/big5hkscs.c
|
||||
+++ b/iconvdata/big5hkscs.c
|
||||
@@ -17895,6 +17895,9 @@ static struct
|
||||
else \
|
||||
++inptr; \
|
||||
} \
|
||||
+ else \
|
||||
+ /* Clear the queue and proceed to output the saved character. */ \
|
||||
+ *statep = 0; \
|
||||
\
|
||||
put32 (outptr, ch); \
|
||||
outptr += 4; \
|
||||
diff --git a/iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c b/iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c
|
||||
new file mode 100644
|
||||
index 00000000000..8389adebf27
|
||||
--- /dev/null
|
||||
+++ b/iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c
|
||||
@@ -0,0 +1,160 @@
|
||||
+/* Verify the BIG5HKSCS outputs that generate 2 wchar_t's (Bug 25734).
|
||||
+ Copyright (C) 2020 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
|
||||
+ <https://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <locale.h>
|
||||
+#include <wchar.h>
|
||||
+#include <support/check.h>
|
||||
+#include <support/support.h>
|
||||
+
|
||||
+/* A few BIG5-HKSCS characters map in two unicode code points.
|
||||
+ They are:
|
||||
+ /x88/x62 => <U00CA><U0304>
|
||||
+ /x88/x64 => <U00CA><U030C>
|
||||
+ /x88/xa3 => <U00EA><U0304>
|
||||
+ /x88/xa5 => <U00EA><U030C>
|
||||
+ Each of these is special cased in iconvdata/big5hkscs.c.
|
||||
+ This test ensures that we correctly reset the shift state after
|
||||
+ outputting any of these characters. We do this by converting
|
||||
+ each them followed by converting an ASCII character. If we fail
|
||||
+ to reset the shift state (bug 25734) then we'll see the last
|
||||
+ character in the queue output again. */
|
||||
+
|
||||
+/* Each test has name, input bytes, and expected wide character
|
||||
+ output. */
|
||||
+struct testdata {
|
||||
+ const char *name;
|
||||
+ const char input[3];
|
||||
+ wchar_t expected[3];
|
||||
+};
|
||||
+
|
||||
+/* In BIG5-HKSCS (2008) there are 4 characters that generate multiple
|
||||
+ wide characters. */
|
||||
+struct testdata tests[4] = {
|
||||
+ /* <H-8862>X => <U+00CA><U+0304>X */
|
||||
+ { "<H-8862>", "\x88\x62\x58", { 0x00CA, 0x0304, 0x0058 } },
|
||||
+ /* <H-8864>X => <U+00CA><U+030C>X */
|
||||
+ { "<H-8864>", "\x88\x64\x58", { 0x00CA, 0x030C, 0x0058 } },
|
||||
+ /* <H-88A3>X => <U+00EA><U+0304>X */
|
||||
+ { "<H-88A3>", "\x88\xa3\x58", { 0x00EA, 0x0304, 0x0058 } },
|
||||
+ /* <H-88A5>X => <U+00EA><U+030C>X */
|
||||
+ { "<H-88A5>", "\x88\xa5\x58", { 0x00EA, 0x030C, 0x0058 } }
|
||||
+};
|
||||
+
|
||||
+/* Each test is of the form:
|
||||
+ - Translate first code sequence (two bytes)
|
||||
+ - Translate second (zero bytes)
|
||||
+ - Translate the third (one byte). */
|
||||
+static int
|
||||
+check_conversion (struct testdata test)
|
||||
+{
|
||||
+ int err = 0;
|
||||
+ wchar_t wc;
|
||||
+ mbstate_t st;
|
||||
+ size_t ret;
|
||||
+ const char *mbs = test.input;
|
||||
+ int consumed = 0;
|
||||
+ /* Input is always 3 bytes long. */
|
||||
+ int inlen = 3;
|
||||
+
|
||||
+ memset (&st, 0, sizeof (st));
|
||||
+ /* First conversion: Consumes first 2 bytes. */
|
||||
+ ret = mbrtowc (&wc, mbs, inlen - consumed, &st);
|
||||
+ if (ret != 2)
|
||||
+ {
|
||||
+ printf ("error: First conversion consumed only %zd bytes.\n", ret);
|
||||
+ err++;
|
||||
+ }
|
||||
+ /* Advance the two consumed bytes. */
|
||||
+ mbs += ret;
|
||||
+ consumed += ret;
|
||||
+ if (wc != test.expected[0])
|
||||
+ {
|
||||
+ printf ("error: Result of first conversion was wrong.\n");
|
||||
+ err++;
|
||||
+ }
|
||||
+ /* Second conversion: Consumes 0 bytes. */
|
||||
+ ret = mbrtowc (&wc, mbs, inlen - consumed, &st);
|
||||
+ if (ret != 0)
|
||||
+ {
|
||||
+ printf ("error: Second conversion consumed only %zd bytes.\n", ret);
|
||||
+ err++;
|
||||
+ }
|
||||
+ /* Advance the zero consumed bytes. */
|
||||
+ mbs += ret;
|
||||
+ consumed += ret;
|
||||
+ if (wc != test.expected[1])
|
||||
+ {
|
||||
+ printf ("error: Result of second conversion was wrong.\n");
|
||||
+ err++;
|
||||
+ }
|
||||
+ /* After the second conversion the state of the converter should be
|
||||
+ in the initial state. It is in the initial state because the two
|
||||
+ input BIG5-HKSCS bytes have been consumed and the 2 wchar_t's have
|
||||
+ been output. */
|
||||
+ if (mbsinit (&st) == 0)
|
||||
+ {
|
||||
+ printf ("error: Converter not in initial state.\n");
|
||||
+ err++;
|
||||
+ }
|
||||
+ /* Third conversion: Consumes 1 byte (it's an ASCII character). */
|
||||
+ ret = mbrtowc (&wc, mbs, inlen - consumed, &st);
|
||||
+ if (ret != 1)
|
||||
+ {
|
||||
+ printf ("error: Third conversion consumed only %zd bytes.\n", ret);
|
||||
+ err++;
|
||||
+ }
|
||||
+ /* Advance the one byte. */
|
||||
+ mbs += ret;
|
||||
+ consumed += ret;
|
||||
+ if (wc != test.expected[2])
|
||||
+ {
|
||||
+ printf ("error: Result of third conversion was wrong.\n");
|
||||
+ err++;
|
||||
+ }
|
||||
+ /* Return 0 if we saw no errors. */
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+do_test (void)
|
||||
+{
|
||||
+ int err = 0;
|
||||
+ int ret;
|
||||
+ /* Testing BIG5-HKSCS. */
|
||||
+ setlocale (LC_ALL, "zh_HK.BIG5-HKSCS");
|
||||
+
|
||||
+ /* Run all the special conversions. */
|
||||
+ for (int i = 0; i < (sizeof (tests) / sizeof (struct testdata)); i++)
|
||||
+ {
|
||||
+ printf ("Running test for %s\n", tests[i].name);
|
||||
+ ret = check_conversion (tests[i]);
|
||||
+ if (ret > 0)
|
||||
+ printf ("Test %s failed.\n", tests[i].name);
|
||||
+ err += ret;
|
||||
+ }
|
||||
+
|
||||
+ /* Fail if any conversion had an error. */
|
||||
+ if (err > 0)
|
||||
+ FAIL_EXIT1 ("One or more conversions failed.");
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+#include <support/test-driver.c>
|
||||
--
|
||||
2.19.1
|
||||
|
||||
417
glibc.spec
417
glibc.spec
@ -59,7 +59,7 @@
|
||||
##############################################################################
|
||||
Name: glibc
|
||||
Version: 2.28
|
||||
Release: 40
|
||||
Release: 41
|
||||
Summary: The GNU libc libraries
|
||||
License: %{all_license}
|
||||
URL: http://www.gnu.org/software/glibc/
|
||||
@ -77,6 +77,14 @@ Patch0: Fix-use-after-free-in-glob-when-expanding-user-bug-2.patch
|
||||
Patch1: backport-Kunpeng-patches.patch
|
||||
Patch2: Avoid-ldbl-96-stack-corruption-from-range-reduction-.patch
|
||||
Patch3: backport-CVE-2020-1751-Fix-array-overflow-in-backtrace-on-PowerPC-bug-25423.patch
|
||||
Patch4: Do-not-use-gettimeofday-in-random-id.patch
|
||||
Patch5: Reset-converter-state-after-second-wchar_t-output-Bu.patch
|
||||
Patch6: Fix-avx2-strncmp-offset-compare-condition-check-BZ-2.patch
|
||||
Patch7: nptl-wait-for-pending-setxid-request-also-in-detache.patch
|
||||
Patch8: x86-64-Use-RDX_LP-on-__x86_shared_non_temporal_thres.patch
|
||||
Patch9: x86_64-Use-xmmN-with-vpxor-to-clear-a-vector-registe.patch
|
||||
Patch10: nptl-Don-t-madvise-user-provided-stack.patch
|
||||
Patch11: turn-REP_STOSB_THRESHOLD-from-2k-to-1M.patch
|
||||
|
||||
Provides: ldconfig rtld(GNU_HASH) bundled(gnulib)
|
||||
|
||||
@ -161,6 +169,7 @@ Summary: All language packs for %{name}.
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: %{name}-common = %{version}-%{release}
|
||||
Provides: %{name}-langpack = %{version}-%{release}
|
||||
Obsoletes: %{name}-minimal-langpack = 2.28
|
||||
|
||||
%{lua:
|
||||
-- List the Symbol provided by all-langpacks
|
||||
@ -168,7 +177,7 @@ lang_provides = {}
|
||||
for line in io.lines(rpm.expand("%{SOURCE7}")) do
|
||||
print(rpm.expand([[
|
||||
Provides:]]..line..[[ = %{version}-%{release}
|
||||
Obsoletes:]]..line..[[
|
||||
Obsoletes:]]..line..[[ = 2.28
|
||||
]]))
|
||||
end
|
||||
}
|
||||
@ -212,8 +221,8 @@ Provides: %{name}-headers = %{version}-%{release}
|
||||
Provides: %{name}-headers(%{_target_cpu})
|
||||
Provides: %{name}-headers%{_isa} = %{version}-%{release}
|
||||
|
||||
Obsoletes: %{name}-static
|
||||
Obsoletes: %{name}-headers
|
||||
Obsoletes: %{name}-static = 2.28
|
||||
Obsoletes: %{name}-headers = 2.28
|
||||
|
||||
%description devel
|
||||
The glibc-devel package contains the object files necessary for developing
|
||||
@ -248,7 +257,7 @@ Provides: nss_db = %{version}-%{release}
|
||||
Provides: nss_db%{_isa} = %{version}-%{release}
|
||||
Provides: nss_hesiod = %{version}-%{release}
|
||||
Provides: nss_hesiod%{_isa} = %{version}-%{release}
|
||||
Obsoletes: nss_db nss_hesiod
|
||||
Obsoletes: nss_db = 2.28, nss_hesiod = 2.28
|
||||
|
||||
%description -n nss_modules
|
||||
This package contains nss_db and nss_hesiod. The former uses hash-indexed files
|
||||
@ -299,19 +308,47 @@ to run microbenchmark tests on the system.
|
||||
%package debugutils
|
||||
Summary: debug files for %{name}
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: %{name}-debuginfo = %{version}-%{release}
|
||||
|
||||
Provides: %{name}-debuginfo = %{version}-%{release}
|
||||
Provides: %{name}-debuginfo%{_isa} = %{version}-%{release}
|
||||
Provides: %{name}-utils = %{version}-%{release}
|
||||
Provides: %{name}-utils%{_isa} = %{version}-%{release}
|
||||
|
||||
Obsoletes: %{name}-utils
|
||||
Obsoletes: %{name}-utils = 2.28
|
||||
|
||||
%description debugutils
|
||||
This package provides many static files for debug. Besides, It contain memusage,
|
||||
a memory usage profiler, mtrace, a memory leak tracer and xtrace, a function
|
||||
call tracer, all of which is not necessory for you.
|
||||
This package provides memusage, a memory usage profiler, mtrace, a memory leak
|
||||
tracer and xtrace, a function call tracer, all of which is not necessory for you.
|
||||
|
||||
##############################################################################
|
||||
# glibc debuginfo sub-package
|
||||
##############################################################################
|
||||
%if 0%{?_enable_debug_packages}
|
||||
%define debug_package %{nil}
|
||||
%define __debug_install_post %{nil}
|
||||
%global __debug_package 1
|
||||
|
||||
%undefine _debugsource_packages
|
||||
%undefine _debuginfo_subpackages
|
||||
%undefine _unique_debug_names
|
||||
%undefine _unique_debug_srcs
|
||||
|
||||
%package debuginfo
|
||||
Summary: Debug information for %{name}
|
||||
AutoReqProv: no
|
||||
|
||||
%description debuginfo
|
||||
This package provides debug information for package %{name}.
|
||||
Debug information is useful when developing applications that use this
|
||||
package or when debugging this package.
|
||||
|
||||
%package debugsource
|
||||
Summary: Debug source for %{name}
|
||||
AutoReqProv: no
|
||||
|
||||
%description debugsource
|
||||
This package provides debug sources for package %{name}.
|
||||
Debug sources are useful when developing applications that use this
|
||||
package or when debugging this package.
|
||||
|
||||
%endif # 0%{?_enable_debug_packages}
|
||||
|
||||
##############################################################################
|
||||
# glibc help sub-package
|
||||
@ -344,6 +381,7 @@ touch locale/programs/*-kw.h
|
||||
%build
|
||||
|
||||
BuildFlags="-O2 -g -Wno-error"
|
||||
BuildFlags="$BuildFlags -DNDEBUG"
|
||||
reference=" \
|
||||
"-Wp,-D_GLIBCXX_ASSERTIONS" \
|
||||
"-fasynchronous-unwind-tables" \
|
||||
@ -607,7 +645,216 @@ for i in $RPM_BUILD_ROOT%{_prefix}/bin/{xtrace,memusage}; do
|
||||
-e 's~='\''/\\\$LIB/libmemusage.so~='\''%{_prefix}/\\$LIB/libmemusage.so~' \
|
||||
-i $i
|
||||
done
|
||||
|
||||
touch master.filelist
|
||||
touch glibc.filelist
|
||||
touch common.filelist
|
||||
touch devel.filelist
|
||||
touch nscd.filelist
|
||||
touch nss_modules.filelist
|
||||
touch nss-devel.filelist
|
||||
touch libnsl.filelist
|
||||
touch debugutils.filelist
|
||||
touch benchtests.filelist
|
||||
touch debuginfo.filelist
|
||||
|
||||
{
|
||||
find $RPM_BUILD_ROOT \( -type f -o -type l \) \
|
||||
\( \
|
||||
-name etc -printf "%%%%config " -o \
|
||||
-name gconv-modules \
|
||||
-printf "%%%%verify(not md5 size mtime) %%%%config(noreplace) " -o \
|
||||
-name gconv-modules.cache \
|
||||
-printf "%%%%verify(not md5 size mtime) " \
|
||||
, \
|
||||
! -path "*/lib/debug/*" -printf "/%%P\n" \)
|
||||
|
||||
find $RPM_BUILD_ROOT -type d \
|
||||
\( -path '*%{_prefix}/share/locale' -prune -o \
|
||||
\( -path '*%{_prefix}/share/*' \
|
||||
%if %{with docs}
|
||||
! -path '*%{_infodir}' -o \
|
||||
%endif
|
||||
-path "*%{_prefix}/include/*" \
|
||||
\) -printf "%%%%dir /%%P\n" \)
|
||||
} | {
|
||||
sed -e '\,.*/share/locale/\([^/_]\+\).*/LC_MESSAGES/.*\.mo,d' \
|
||||
-e '\,.*/share/i18n/locales/.*,d' \
|
||||
-e '\,.*/share/i18n/charmaps/.*,d' \
|
||||
-e '\,.*/etc/\(localtime\|nsswitch.conf\|ld\.so\.conf\|ld\.so\.cache\|default\|rpc\|gai\.conf\),d' \
|
||||
-e '\,.*/%{_libdir}/lib\(pcprofile\|memusage\)\.so,d' \
|
||||
-e '\,.*/bin/\(memusage\|mtrace\|xtrace\|pcprofiledump\),d'
|
||||
} | sort > master.filelist
|
||||
|
||||
chmod 0444 master.filelist
|
||||
|
||||
##############################################################################
|
||||
# glibc - The GNU C Library (glibc) core package.
|
||||
##############################################################################
|
||||
cat master.filelist \
|
||||
| grep -v \
|
||||
-e '%{_infodir}' \
|
||||
-e '%{_libdir}/lib.*_p.a' \
|
||||
-e '%{_prefix}/include' \
|
||||
-e '%{_libdir}/lib.*\.a' \
|
||||
-e '%{_libdir}/.*\.o' \
|
||||
-e '%{_libdir}/lib.*\.so' \
|
||||
-e 'nscd' \
|
||||
-e '%{_prefix}/bin' \
|
||||
-e '%{_prefix}/lib/locale' \
|
||||
-e '%{_prefix}/sbin/[^gi]' \
|
||||
-e '%{_prefix}/share' \
|
||||
-e '/var/db/Makefile' \
|
||||
-e '/libnss_.*\.so[0-9.]*$' \
|
||||
-e '/libnsl' \
|
||||
-e 'glibc-benchtests' \
|
||||
-e 'aux-cache' \
|
||||
-e 'build-locale-archive' \
|
||||
> glibc.filelist
|
||||
|
||||
for module in compat files dns; do
|
||||
cat master.filelist \
|
||||
| grep -E \
|
||||
-e "/libnss_$module(\.so\.[0-9.]+|-[0-9.]+\.so)$" \
|
||||
>> glibc.filelist
|
||||
done
|
||||
grep -e "libmemusage.so" -e "libpcprofile.so" master.filelist >> glibc.filelist
|
||||
|
||||
##############################################################################
|
||||
# glibc "common" sub-package
|
||||
##############################################################################
|
||||
grep '%{_prefix}/bin' master.filelist > common.filelist
|
||||
grep '%{_prefix}/sbin/[^gi]' master.filelist \
|
||||
| grep -v 'nscd' >> common.filelist
|
||||
|
||||
grep '%{_prefix}/share' master.filelist \
|
||||
| grep -v \
|
||||
-e '%{_prefix}/share/info/libc.info.*' \
|
||||
-e '%%dir %{prefix}/share/info' \
|
||||
-e '%%dir %{prefix}/share' \
|
||||
>> common.filelist
|
||||
|
||||
echo '%{_prefix}/sbin/build-locale-archive' >> common.filelist
|
||||
|
||||
###############################################################################
|
||||
# glibc "devel" sub-package
|
||||
###############################################################################
|
||||
%if %{with docs}
|
||||
grep '%{_infodir}' master.filelist | grep -v '%{_infodir}/dir' > devel.filelist
|
||||
%endif
|
||||
|
||||
grep '%{_libdir}/lib.*\.a' master.filelist \
|
||||
| grep '/lib\(\(c\|pthread\|nldbl\|mvec\)_nonshared\|g\|ieee\|mcheck\)\.a$' \
|
||||
>> devel.filelist
|
||||
|
||||
grep '%{_libdir}/.*\.o' < master.filelist >> devel.filelist
|
||||
grep '%{_libdir}/lib.*\.so' < master.filelist >> devel.filelist
|
||||
|
||||
sed -i -e '\,libmemusage.so,d' \
|
||||
-e '\,libpcprofile.so,d' \
|
||||
-e '\,/libnss_[a-z]*\.so$,d' \
|
||||
devel.filelist
|
||||
|
||||
grep '%{_prefix}/include' < master.filelist >> devel.filelist
|
||||
|
||||
grep '%{_libdir}/lib.*\.a' < master.filelist \
|
||||
| grep -v '/lib\(\(c\|pthread\|nldbl\|mvec\)_nonshared\|g\|ieee\|mcheck\)\.a$' \
|
||||
>> devel.filelist
|
||||
|
||||
|
||||
##############################################################################
|
||||
# glibc "nscd" sub-package
|
||||
##############################################################################
|
||||
echo '%{_prefix}/sbin/nscd' > nscd.filelist
|
||||
|
||||
##############################################################################
|
||||
# nss modules sub-package
|
||||
##############################################################################
|
||||
grep -E "/libnss_(db|hesiod)(\.so\.[0-9.]+|-[0-9.]+\.so)$" \
|
||||
master.filelist > nss_modules.filelist
|
||||
|
||||
##############################################################################
|
||||
# nss-devel sub-package
|
||||
##############################################################################
|
||||
grep '/libnss_[a-z]*\.so$' master.filelist > nss-devel.filelist
|
||||
|
||||
##############################################################################
|
||||
# libnsl subpackage
|
||||
##############################################################################
|
||||
grep '/libnsl-[0-9.]*.so$' master.filelist > libnsl.filelist
|
||||
test $(wc -l < libnsl.filelist) -eq 1
|
||||
|
||||
##############################################################################
|
||||
# glibc debugutils sub-package
|
||||
##############################################################################
|
||||
cat > debugutils.filelist <<EOF
|
||||
%if %{without bootstrap}
|
||||
%{_prefix}/bin/memusage
|
||||
%{_prefix}/bin/memusagestat
|
||||
%endif
|
||||
%{_prefix}/bin/mtrace
|
||||
%{_prefix}/bin/pcprofiledump
|
||||
%{_prefix}/bin/xtrace
|
||||
EOF
|
||||
|
||||
##############################################################################
|
||||
# glibc benchtests sub-package
|
||||
##############################################################################
|
||||
find build-%{target}/benchtests -type f -executable | while read b; do
|
||||
echo "%{_prefix}/libexec/glibc-benchtests/$(basename $b)"
|
||||
done > benchtests.filelist
|
||||
# ... and the makefile.
|
||||
for b in %{SOURCE4} %{SOURCE5}; do
|
||||
echo "%{_prefix}/libexec/glibc-benchtests/$(basename $b)" >> benchtests.filelist
|
||||
done
|
||||
# ... and finally, the comparison scripts.
|
||||
echo "%{_prefix}/libexec/glibc-benchtests/benchout.schema.json" >> benchtests.filelist
|
||||
echo "%{_prefix}/libexec/glibc-benchtests/compare_bench.py*" >> benchtests.filelist
|
||||
echo "%{_prefix}/libexec/glibc-benchtests/import_bench.py*" >> benchtests.filelist
|
||||
echo "%{_prefix}/libexec/glibc-benchtests/validate_benchout.py*" >> benchtests.filelist
|
||||
%endif # 0%{?_enable_debug_packages}
|
||||
|
||||
##############################################################################
|
||||
# glibc debuginfo sub-package
|
||||
##############################################################################
|
||||
touch debuginfo_additional.filelist
|
||||
find_debuginfo_args='--strict-build-id -i'
|
||||
%ifarch %{x86_arches}
|
||||
find_debuginfo_args="$find_debuginfo_args \
|
||||
-l common.filelist \
|
||||
-l debugutils.filelist \
|
||||
-l nscd.filelist \
|
||||
-p '.*/(sbin|libexec)/.*' \
|
||||
-o debuginfo_additional.filelist \
|
||||
-l nss_modules.filelist \
|
||||
-l libnsl.filelist \
|
||||
-l glibc.filelist \
|
||||
%if %{with benchtests}
|
||||
-l benchtests.filelist
|
||||
%endif
|
||||
"
|
||||
%endif
|
||||
|
||||
/usr/lib/rpm/find-debuginfo.sh $find_debuginfo_args -o debuginfo.filelist
|
||||
|
||||
%ifarch %{x86_arches}
|
||||
sed -i '\#^$RPM_BUILD_ROOT%{_prefix}/src/debug/#d' debuginfo_additional.filelist
|
||||
cat debuginfo_additional.filelist >> debuginfo.filelist
|
||||
find $RPM_BUILD_ROOT%{_prefix}/src/debug \
|
||||
\( -type d -printf '%%%%dir ' \) , \
|
||||
-printf '%{_prefix}/src/debug/%%P\n' >> debuginfo.filelist
|
||||
|
||||
add_dir=%{_prefix}/lib/debug%{_libdir}
|
||||
find $RPM_BUILD_ROOT$add_dir -name "*.a" -printf "$add_dir/%%P\n" >> debuginfo.filelist
|
||||
%endif # %{x86_arches}
|
||||
|
||||
remove_dir="%{_prefix}/src/debug"
|
||||
remove_dir="$remove_dir $(echo %{_prefix}/lib/debug{,/%{_lib},/bin,/sbin})"
|
||||
remove_dir="$remove_dir $(echo %{_prefix}/lib/debug%{_prefix}{,/%{_lib},/libexec,/bin,/sbin})"
|
||||
|
||||
for d in $(echo $remove_dir | sed 's/ /\n/g'); do
|
||||
sed -i "\|^%%dir $d/\?$|d" debuginfo.filelist
|
||||
done
|
||||
%endif # %{with benchtests}
|
||||
##############################################################################
|
||||
# Run the glibc testsuite
|
||||
@ -734,68 +981,35 @@ fi
|
||||
##############################################################################
|
||||
# Files list
|
||||
##############################################################################
|
||||
%files
|
||||
%files -f glibc.filelist
|
||||
%dir %{_prefix}/%{_lib}/audit
|
||||
%verify(not md5 size mtime) %config(noreplace) /etc/nsswitch.conf
|
||||
%verify(not md5 size mtime) %config(noreplace) /etc/ld.so.conf
|
||||
%verify(not md5 size mtime) %config(noreplace) /etc/rpc
|
||||
%verify(not md5 size mtime) %config(noreplace) /usr/lib64/gconv/gconv-modules
|
||||
%verify(not md5 size mtime) /usr/lib64/gconv/gconv-modules.cache
|
||||
%dir /etc/ld.so.conf.d
|
||||
%dir %{_prefix}/libexec/getconf
|
||||
%{_prefix}/libexec/getconf/*
|
||||
%dir %{_libdir}/gconv
|
||||
%{_libdir}/gconv/*.so
|
||||
%dir %{_libdir}/audit
|
||||
%{_libdir}/audit/*
|
||||
%dir %attr(0700,root,root) /var/cache/ldconfig
|
||||
%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/cache/ldconfig/aux-cache
|
||||
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache
|
||||
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/gai.conf
|
||||
%{_sbindir}/glibc*
|
||||
%{_sbindir}/iconvconfig
|
||||
/lib/*
|
||||
%{_libdir}/libmemusage.so
|
||||
%{_libdir}/libpcprofile.so
|
||||
/sbin/ldconfig
|
||||
/%{_lib}/*.*
|
||||
%exclude /%{_lib}/libnss_db*
|
||||
%exclude /%{_lib}/libnss_hesiod*
|
||||
%exclude /%{_lib}/libnsl*
|
||||
%exclude /lib/systemd
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
%license COPYING COPYING.LIB LICENSES
|
||||
|
||||
%files common
|
||||
%dir %{_prefix}/share/i18n
|
||||
%dir %{_prefix}/share/i18n/charmaps
|
||||
%dir %{_prefix}/share/i18n/locales
|
||||
%files -f common.filelist common
|
||||
%attr(0644,root,root) %verify(not md5 size mtime) %{_prefix}/lib/locale/locale-archive.tmpl
|
||||
%attr(0644,root,root) %verify(not md5 size mtime mode) %ghost %config(missingok,noreplace) %{_prefix}/lib/locale/locale-archive
|
||||
%{_prefix}/lib/locale/C.utf8
|
||||
%dir %{_prefix}/lib/locale
|
||||
%dir %{_prefix}/lib/locale/C.utf8
|
||||
%{_prefix}/lib/locale/C.utf8/*
|
||||
%{_prefix}/lib/locale/zh_CN.utf8
|
||||
%{_prefix}/lib/locale/en_US.utf8
|
||||
%{_prefix}/share/locale/zh_CN
|
||||
%{_prefix}/share/locale/en_GB
|
||||
%{_prefix}/bin/catchsegv
|
||||
%{_prefix}/bin/gencat
|
||||
%{_prefix}/bin/getconf
|
||||
%{_prefix}/bin/getent
|
||||
%{_prefix}/bin/iconv
|
||||
%{_prefix}/bin/ldd
|
||||
%{_prefix}/bin/locale
|
||||
%{_prefix}/bin/localedef
|
||||
%{_prefix}/bin/makedb
|
||||
%{_prefix}/bin/pldd
|
||||
%{_prefix}/bin/sotruss
|
||||
%{_prefix}/bin/sprof
|
||||
%{_prefix}/bin/tzselect
|
||||
%dir %attr(755,root,root) /etc/default
|
||||
%verify(not md5 size mtime) %config(noreplace) /etc/default/nss
|
||||
%{_prefix}/share/locale/locale.alias
|
||||
%{_sbindir}/build-locale-archive
|
||||
%{_sbindir}/zdump
|
||||
%{_sbindir}/zic
|
||||
|
||||
%files all-langpacks -f libc.lang
|
||||
%files -f libc.lang all-langpacks
|
||||
%{_prefix}/lib/locale
|
||||
%exclude %{_prefix}/lib/locale/locale-archive
|
||||
%exclude %{_prefix}/lib/locale/locale-archive.tmpl
|
||||
@ -806,61 +1020,14 @@ fi
|
||||
%exclude %{_prefix}/share/locale/en_GB
|
||||
|
||||
%files locale-source
|
||||
%dir %{_prefix}/share/i18n/locales
|
||||
%{_prefix}/share/i18n/locales/*
|
||||
%dir %{_prefix}/share/i18n/charmaps
|
||||
%{_prefix}/share/i18n/charmaps/*
|
||||
|
||||
%files devel
|
||||
%{_infodir}/*
|
||||
%{_libdir}/*.a
|
||||
%{_libdir}/*.o
|
||||
%{_libdir}/*.so
|
||||
%{_prefix}/include/*.h
|
||||
%dir %{_prefix}/include/arpa
|
||||
%dir %{_prefix}/include/bits
|
||||
%dir %{_prefix}/include/bits/types
|
||||
%dir %{_prefix}/include/gnu
|
||||
%dir %{_prefix}/include/net
|
||||
%dir %{_prefix}/include/netash
|
||||
%dir %{_prefix}/include/netatalk
|
||||
%dir %{_prefix}/include/netax25
|
||||
%dir %{_prefix}/include/neteconet
|
||||
%dir %{_prefix}/include/netinet
|
||||
%dir %{_prefix}/include/netipx
|
||||
%dir %{_prefix}/include/netiucv
|
||||
%dir %{_prefix}/include/netpacket
|
||||
%dir %{_prefix}/include/netrom
|
||||
%dir %{_prefix}/include/netrose
|
||||
%dir %{_prefix}/include/nfs
|
||||
%dir %{_prefix}/include/protocols
|
||||
%dir %{_prefix}/include/rpc
|
||||
%dir %{_prefix}/include/scsi
|
||||
%dir %{_prefix}/include/sys
|
||||
%{_prefix}/include/arpa/*
|
||||
%{_prefix}/include/bits/*
|
||||
%{_prefix}/include/gnu/*
|
||||
%{_prefix}/include/net/*
|
||||
%{_prefix}/include/netash/*
|
||||
%{_prefix}/include/netatalk/*
|
||||
%{_prefix}/include/netax25/*
|
||||
%{_prefix}/include/neteconet/*
|
||||
%{_prefix}/include/netinet/*
|
||||
%{_prefix}/include/netipx/*
|
||||
%{_prefix}/include/netiucv/*
|
||||
%{_prefix}/include/netpacket/*
|
||||
%{_prefix}/include/netrom/*
|
||||
%{_prefix}/include/netrose/*
|
||||
%{_prefix}/include/nfs/*
|
||||
%{_prefix}/include/protocols/*
|
||||
%{_prefix}/include/rpc/*
|
||||
%{_prefix}/include/scsi/*
|
||||
%{_prefix}/include/sys/*
|
||||
%exclude %{_libdir}/libmemusage.so
|
||||
%exclude %{_libdir}/libpcprofile.so
|
||||
%exclude %{_libdir}/libnss*
|
||||
%exclude %{_prefix}/bin/rpcgen
|
||||
%exclude %{_prefix}/include/rpcsvc/*
|
||||
%files -f devel.filelist devel
|
||||
|
||||
%files -n nscd
|
||||
%files -f nscd.filelist -n nscd
|
||||
%config(noreplace) /etc/nscd.conf
|
||||
%dir %attr(0755,root,root) /var/run/nscd
|
||||
%dir %attr(0755,root,root) /var/db/nscd
|
||||
@ -878,50 +1045,42 @@ fi
|
||||
%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/db/nscd/hosts
|
||||
%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/db/nscd/services
|
||||
%ghost %config(missingok,noreplace) /etc/sysconfig/nscd
|
||||
%{_sbindir}/nscd
|
||||
|
||||
%files -n nss_modules
|
||||
%files -f nss_modules.filelist -n nss_modules
|
||||
/var/db/Makefile
|
||||
/%{_lib}/libnss_db*
|
||||
/%{_lib}/libnss_hesiod*
|
||||
|
||||
%files nss-devel
|
||||
%{_libdir}/libnss*
|
||||
%files -f nss-devel.filelist nss-devel
|
||||
|
||||
%files -n libnsl
|
||||
/%{_lib}/libnsl*
|
||||
%files -f libnsl.filelist -n libnsl
|
||||
/%{_lib}/libnsl.so.1
|
||||
|
||||
%files -f debugutils.filelist debugutils
|
||||
|
||||
%if %{with benchtests}
|
||||
%files benchtests
|
||||
%{_prefix}/libexec/glibc-benchtests/*
|
||||
%files -f benchtests.filelist benchtests
|
||||
%endif
|
||||
|
||||
%files debugutils
|
||||
%if %{without bootstrap}
|
||||
%{_prefix}/bin/memusage
|
||||
%{_prefix}/bin/memusagestat
|
||||
%endif
|
||||
%{_prefix}/bin/mtrace
|
||||
%{_prefix}/bin/pcprofiledump
|
||||
%{_prefix}/bin/xtrace
|
||||
%{_prefix}/lib/debug/usr/bin/*.debug
|
||||
%{_prefix}/lib/debug/usr/lib64/*.a
|
||||
%if 0%{?_enable_debug_packages}
|
||||
%files -f debuginfo.filelist debuginfo
|
||||
|
||||
%files debugsource
|
||||
%endif
|
||||
|
||||
%files help
|
||||
#Doc of glibc package
|
||||
%doc README NEWS INSTALL elf/rtld-debugger-interface.txt
|
||||
|
||||
#Doc of common sub-package
|
||||
%doc documentation/README.timezone
|
||||
%doc documentation/gai.conf
|
||||
|
||||
#Doc of nss_modules sub-package
|
||||
%doc hesiod/README.hesiod
|
||||
|
||||
|
||||
%changelog
|
||||
* Sat May 23 2020 liqingqing<liqignqing3@huawei.com> - 2.28-40
|
||||
* Thu Jul 2 2020 Wang Shuo<wangshuo47@huawei.com> - 2.28-41
|
||||
- add filelist to improve the scalability
|
||||
- backport many patch for bugfix
|
||||
|
||||
* Sat May 30 2020 liqingqing<liqignqing3@huawei.com> - 2.28-40
|
||||
- Fix array overflow in backtrace on PowerPC (bug 25423)
|
||||
|
||||
* Thu May 28 2020 jdkboy<guoge1@huawei.com> - 2.28-39
|
||||
|
||||
41
nptl-Don-t-madvise-user-provided-stack.patch
Normal file
41
nptl-Don-t-madvise-user-provided-stack.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From 087942251f26d5fd5802b8d14e47d460263a0c4d Mon Sep 17 00:00:00 2001
|
||||
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||
Date: Wed, 24 Jun 2020 07:47:15 +0100
|
||||
Subject: [PATCH] nptl: Don't madvise user provided stack
|
||||
|
||||
User provided stack should not be released nor madvised at
|
||||
thread exit because it's owned by the user.
|
||||
|
||||
If the memory is shared or file based then MADV_DONTNEED
|
||||
can have unwanted effects. With memory tagging on aarch64
|
||||
linux the tags are dropped and thus it may invalidate
|
||||
pointers.
|
||||
|
||||
Tested on aarch64-linux-gnu with MTE, it fixes
|
||||
|
||||
FAIL: nptl/tst-stack3
|
||||
FAIL: nptl/tst-stack3-mem
|
||||
|
||||
---
|
||||
nptl/pthread_create.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
|
||||
index 179f07a1..00931c19 100644
|
||||
--- a/nptl/pthread_create.c
|
||||
+++ b/nptl/pthread_create.c
|
||||
@@ -573,8 +573,9 @@ START_THREAD_DEFN
|
||||
}
|
||||
#endif
|
||||
|
||||
- advise_stack_range (pd->stackblock, pd->stackblock_size, (uintptr_t) pd,
|
||||
- pd->guardsize);
|
||||
+ if (!pd->user_stack)
|
||||
+ advise_stack_range (pd->stackblock, pd->stackblock_size, (uintptr_t) pd,
|
||||
+ pd->guardsize);
|
||||
|
||||
if (__glibc_unlikely (pd->cancelhandling & SETXID_BITMASK))
|
||||
{
|
||||
--
|
||||
2.19.1
|
||||
|
||||
52
nptl-wait-for-pending-setxid-request-also-in-detache.patch
Normal file
52
nptl-wait-for-pending-setxid-request-also-in-detache.patch
Normal file
@ -0,0 +1,52 @@
|
||||
From 4cab20fa49b3ea3e3454fdc4f13bf3828d8efd19 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schwab <schwab@suse.de>
|
||||
Date: Thu, 7 May 2020 15:50:09 +0200
|
||||
Subject: [PATCH] nptl: wait for pending setxid request also in detached thread
|
||||
(bug 25942)
|
||||
|
||||
There is a race between __nptl_setxid and exiting detached thread, which
|
||||
causes a deadlock on stack_cache_lock. The deadlock happens in this
|
||||
state:
|
||||
|
||||
T1: setgroups -> __nptl_setxid (holding stack_cache_lock, waiting on cmdp->cntr == 0)
|
||||
T2 (detached, exiting): start_thread -> __deallocate_stack (waiting on stack_cache_lock)
|
||||
more threads waiting on stack_cache_lock in pthread_create
|
||||
|
||||
For non-detached threads, start_thread waits for its own setxid handler to
|
||||
finish before exiting. Do this for detached threads as well.
|
||||
---
|
||||
nptl/pthread_create.c | 11 ++++++-----
|
||||
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
|
||||
index afd379e89a..a43089065c 100644
|
||||
--- a/nptl/pthread_create.c
|
||||
+++ b/nptl/pthread_create.c
|
||||
@@ -552,11 +552,7 @@ START_THREAD_DEFN
|
||||
advise_stack_range (pd->stackblock, pd->stackblock_size, (uintptr_t) pd,
|
||||
pd->guardsize);
|
||||
|
||||
- /* If the thread is detached free the TCB. */
|
||||
- if (IS_DETACHED (pd))
|
||||
- /* Free the TCB. */
|
||||
- __free_tcb (pd);
|
||||
- else if (__glibc_unlikely (pd->cancelhandling & SETXID_BITMASK))
|
||||
+ if (__glibc_unlikely (pd->cancelhandling & SETXID_BITMASK))
|
||||
{
|
||||
/* Some other thread might call any of the setXid functions and expect
|
||||
us to reply. In this case wait until we did that. */
|
||||
@@ -572,6 +568,11 @@ START_THREAD_DEFN
|
||||
pd->setxid_futex = 0;
|
||||
}
|
||||
|
||||
+ /* If the thread is detached free the TCB. */
|
||||
+ if (IS_DETACHED (pd))
|
||||
+ /* Free the TCB. */
|
||||
+ __free_tcb (pd);
|
||||
+
|
||||
/* We cannot call '_exit' here. '_exit' will terminate the process.
|
||||
|
||||
The 'exit' implementation in the kernel will signal when the
|
||||
--
|
||||
2.19.1
|
||||
|
||||
25
turn-REP_STOSB_THRESHOLD-from-2k-to-1M.patch
Normal file
25
turn-REP_STOSB_THRESHOLD-from-2k-to-1M.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 44314a556239a7524b5a6451025737c1bdbb1cd0 Mon Sep 17 00:00:00 2001
|
||||
From: Wang Shuo <wangshuo47@huawei.com>
|
||||
Date: Thu, 21 May 2020 11:23:06 +0800
|
||||
Subject: [PATCH] turn REP_STOSB_THRESHOLD from 2k to 1M
|
||||
|
||||
---
|
||||
sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S
|
||||
index dcd63c92..92c08eed 100644
|
||||
--- a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S
|
||||
+++ b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S
|
||||
@@ -65,7 +65,7 @@
|
||||
Enhanced REP STOSB. Since the stored value is fixed, larger register
|
||||
size has minimal impact on threshold. */
|
||||
#ifndef REP_STOSB_THRESHOLD
|
||||
-# define REP_STOSB_THRESHOLD 2048
|
||||
+# define REP_STOSB_THRESHOLD 1048576
|
||||
#endif
|
||||
|
||||
#ifndef SECTION
|
||||
--
|
||||
2.19.1
|
||||
|
||||
50
x86-64-Use-RDX_LP-on-__x86_shared_non_temporal_thres.patch
Normal file
50
x86-64-Use-RDX_LP-on-__x86_shared_non_temporal_thres.patch
Normal file
@ -0,0 +1,50 @@
|
||||
From 55c7bcc71b84123d5d4bd2814366a6b05fcf8ebd Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Sat, 9 May 2020 12:04:23 -0700
|
||||
Subject: [PATCH] x86-64: Use RDX_LP on __x86_shared_non_temporal_threshold [BZ
|
||||
#25966]
|
||||
|
||||
Since __x86_shared_non_temporal_threshold is defined as
|
||||
|
||||
long int __x86_shared_non_temporal_threshold;
|
||||
|
||||
and long int is 4 bytes for x32, use RDX_LP to compare against
|
||||
__x86_shared_non_temporal_threshold in assembly code.
|
||||
---
|
||||
sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
|
||||
index c763b7d871..74953245aa 100644
|
||||
--- a/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
|
||||
+++ b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S
|
||||
@@ -244,7 +244,7 @@ L(return):
|
||||
ret
|
||||
|
||||
L(movsb):
|
||||
- cmpq __x86_shared_non_temporal_threshold(%rip), %rdx
|
||||
+ cmp __x86_shared_non_temporal_threshold(%rip), %RDX_LP
|
||||
jae L(more_8x_vec)
|
||||
cmpq %rsi, %rdi
|
||||
jb 1f
|
||||
@@ -402,7 +402,7 @@ L(more_8x_vec):
|
||||
addq %r8, %rdx
|
||||
#if (defined USE_MULTIARCH || VEC_SIZE == 16) && IS_IN (libc)
|
||||
/* Check non-temporal store threshold. */
|
||||
- cmpq __x86_shared_non_temporal_threshold(%rip), %rdx
|
||||
+ cmp __x86_shared_non_temporal_threshold(%rip), %RDX_LP
|
||||
ja L(large_forward)
|
||||
#endif
|
||||
L(loop_4x_vec_forward):
|
||||
@@ -454,7 +454,7 @@ L(more_8x_vec_backward):
|
||||
subq %r8, %rdx
|
||||
#if (defined USE_MULTIARCH || VEC_SIZE == 16) && IS_IN (libc)
|
||||
/* Check non-temporal store threshold. */
|
||||
- cmpq __x86_shared_non_temporal_threshold(%rip), %rdx
|
||||
+ cmp __x86_shared_non_temporal_threshold(%rip), %RDX_LP
|
||||
ja L(large_backward)
|
||||
#endif
|
||||
L(loop_4x_vec_backward):
|
||||
--
|
||||
2.19.1
|
||||
|
||||
43
x86_64-Use-xmmN-with-vpxor-to-clear-a-vector-registe.patch
Normal file
43
x86_64-Use-xmmN-with-vpxor-to-clear-a-vector-registe.patch
Normal file
@ -0,0 +1,43 @@
|
||||
From a35a59036ebae3efcdf5e8167610e0656fca9770 Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Thu, 11 Jun 2020 12:41:18 -0700
|
||||
Subject: [PATCH] x86_64: Use %xmmN with vpxor to clear a vector register
|
||||
|
||||
Since "vpxor %xmmN, %xmmN, %xmmN" clears the whole vector register, use
|
||||
%xmmN, instead of %ymmN, with vpxor to clear a vector register.
|
||||
---
|
||||
sysdeps/x86_64/multiarch/strcmp-avx2.S | 4 ++--
|
||||
sysdeps/x86_64/multiarch/strrchr-avx2.S | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S b/sysdeps/x86_64/multiarch/strcmp-avx2.S
|
||||
index 48d03a9f46..5f88a68262 100644
|
||||
--- a/sysdeps/x86_64/multiarch/strcmp-avx2.S
|
||||
+++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S
|
||||
@@ -91,8 +91,8 @@ ENTRY (STRCMP)
|
||||
# endif
|
||||
movl %edi, %eax
|
||||
xorl %edx, %edx
|
||||
- /* Make %ymm7 all zeros in this function. */
|
||||
- vpxor %ymm7, %ymm7, %ymm7
|
||||
+ /* Make %xmm7 (%ymm7) all zeros in this function. */
|
||||
+ vpxor %xmm7, %xmm7, %xmm7
|
||||
orl %esi, %eax
|
||||
andl $(PAGE_SIZE - 1), %eax
|
||||
cmpl $(PAGE_SIZE - (VEC_SIZE * 4)), %eax
|
||||
diff --git a/sysdeps/x86_64/multiarch/strrchr-avx2.S b/sysdeps/x86_64/multiarch/strrchr-avx2.S
|
||||
index 23077b4c45..146bdd51d0 100644
|
||||
--- a/sysdeps/x86_64/multiarch/strrchr-avx2.S
|
||||
+++ b/sysdeps/x86_64/multiarch/strrchr-avx2.S
|
||||
@@ -44,7 +44,7 @@ ENTRY (STRRCHR)
|
||||
movl %edi, %ecx
|
||||
/* Broadcast CHAR to YMM4. */
|
||||
VPBROADCAST %xmm4, %ymm4
|
||||
- vpxor %ymm0, %ymm0, %ymm0
|
||||
+ vpxor %xmm0, %xmm0, %xmm0
|
||||
|
||||
/* Check if we may cross page boundary with one vector load. */
|
||||
andl $(2 * VEC_SIZE - 1), %ecx
|
||||
--
|
||||
2.19.1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user