init from upstream 2.35
Signed-off-by: Chunmei Xu <xuchunmei@linux.alibaba.com>
This commit is contained in:
parent
ea4e782eee
commit
c72de9c3c7
20 changed files with 10362 additions and 0 deletions
65
0001-Regenerate-configure.patch
Normal file
65
0001-Regenerate-configure.patch
Normal file
|
@ -0,0 +1,65 @@
|
|||
From 9e8281add35dde70478464389fab6f0f7e75b880 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schwab <schwab@linux-m68k.org>
|
||||
Date: Thu, 3 Feb 2022 09:37:42 +0100
|
||||
Subject: [PATCH 01/13] Regenerate configure
|
||||
|
||||
---
|
||||
configure | 14 +-------------
|
||||
1 file changed, 1 insertion(+), 13 deletions(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 00dc638388..8e5bee775a 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -730,7 +730,6 @@ infodir
|
||||
docdir
|
||||
oldincludedir
|
||||
includedir
|
||||
-runstatedir
|
||||
localstatedir
|
||||
sharedstatedir
|
||||
sysconfdir
|
||||
@@ -845,7 +844,6 @@ datadir='${datarootdir}'
|
||||
sysconfdir='${prefix}/etc'
|
||||
sharedstatedir='${prefix}/com'
|
||||
localstatedir='${prefix}/var'
|
||||
-runstatedir='${localstatedir}/run'
|
||||
includedir='${prefix}/include'
|
||||
oldincludedir='/usr/include'
|
||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||
@@ -1098,15 +1096,6 @@ do
|
||||
| -silent | --silent | --silen | --sile | --sil)
|
||||
silent=yes ;;
|
||||
|
||||
- -runstatedir | --runstatedir | --runstatedi | --runstated \
|
||||
- | --runstate | --runstat | --runsta | --runst | --runs \
|
||||
- | --run | --ru | --r)
|
||||
- ac_prev=runstatedir ;;
|
||||
- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
||||
- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
||||
- | --run=* | --ru=* | --r=*)
|
||||
- runstatedir=$ac_optarg ;;
|
||||
-
|
||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||
ac_prev=sbindir ;;
|
||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||
@@ -1244,7 +1233,7 @@ fi
|
||||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||
- libdir localedir mandir runstatedir
|
||||
+ libdir localedir mandir
|
||||
do
|
||||
eval ac_val=\$$ac_var
|
||||
# Remove trailing slashes.
|
||||
@@ -1397,7 +1386,6 @@ Fine tuning of the installation directories:
|
||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||
- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||
--includedir=DIR C header files [PREFIX/include]
|
||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||
--
|
||||
2.29.2
|
||||
|
147
0002-posix-Fix-tst-spawn6-terminal-handling-BZ-28853.patch
Normal file
147
0002-posix-Fix-tst-spawn6-terminal-handling-BZ-28853.patch
Normal file
|
@ -0,0 +1,147 @@
|
|||
From d2e4d2a38e4e7bc3ca407607e717b7f50b20c63f Mon Sep 17 00:00:00 2001
|
||||
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
Date: Wed, 2 Feb 2022 18:31:59 -0300
|
||||
Subject: [PATCH 02/13] posix: Fix tst-spawn6 terminal handling (BZ #28853)
|
||||
|
||||
The test changes the current foreground process group, which might
|
||||
break testing depending of how the make check is issued. For instance:
|
||||
|
||||
nohup make -j1 test t=posix/tst-spawn6 | less
|
||||
|
||||
Will set 'make' and 'less' to be in the foreground process group in
|
||||
the current session. When tst-spawn6 new child takes over it becomes
|
||||
the foreground process and 'less' is stopped and backgrounded which
|
||||
interrupts the 'make check' command.
|
||||
|
||||
To fix it a pseudo-terminal is allocated, the test starts in new
|
||||
session (so there is no controlling terminal associated), and the
|
||||
pseudo-terminal is set as the controlling one (similar to what
|
||||
login_tty does).
|
||||
|
||||
Checked on x86_64-linux-gnu.
|
||||
|
||||
Tested-by: Carlos O'Donell <carlos@redhat.com>
|
||||
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
|
||||
|
||||
(cherry picked from a9d35765728cbc5b66af5eeda5428298bccf9b69)
|
||||
---
|
||||
NEWS | 8 ++++++
|
||||
posix/tst-spawn6.c | 62 ++++++++++++++++++++++++++++++++++++++--------
|
||||
2 files changed, 59 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index faa7ec1871..b1aae94cfb 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -4,6 +4,14 @@ See the end for copying conditions.
|
||||
|
||||
Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
|
||||
using `glibc' in the "product" field.
|
||||
+
|
||||
+Version 2.35.1
|
||||
+
|
||||
+The following bugs are resolved with this release:
|
||||
+
|
||||
+ [28853] libc: tst-spawn6 changes current foreground process group
|
||||
+ (breaks test isolation)
|
||||
+
|
||||
|
||||
Version 2.35
|
||||
|
||||
diff --git a/posix/tst-spawn6.c b/posix/tst-spawn6.c
|
||||
index 911e90a461..044abd8535 100644
|
||||
--- a/posix/tst-spawn6.c
|
||||
+++ b/posix/tst-spawn6.c
|
||||
@@ -29,7 +29,14 @@
|
||||
#include <support/check.h>
|
||||
#include <support/xunistd.h>
|
||||
#include <sys/wait.h>
|
||||
+#include <sys/ioctl.h>
|
||||
#include <stdlib.h>
|
||||
+#include <termios.h>
|
||||
+
|
||||
+#ifndef PATH_MAX
|
||||
+# define PATH_MAX 1024
|
||||
+#endif
|
||||
+static char ptmxpath[PATH_MAX];
|
||||
|
||||
static int
|
||||
handle_restart (const char *argv1, const char *argv2)
|
||||
@@ -115,7 +122,7 @@ run_subprogram (int argc, char *argv[], const posix_spawnattr_t *attr,
|
||||
}
|
||||
|
||||
static int
|
||||
-do_test (int argc, char *argv[])
|
||||
+run_test (int argc, char *argv[])
|
||||
{
|
||||
/* We must have either:
|
||||
- four parameters left if called initially:
|
||||
@@ -127,16 +134,7 @@ do_test (int argc, char *argv[])
|
||||
+ --setgrpr optional
|
||||
*/
|
||||
|
||||
- if (restart)
|
||||
- return handle_restart (argv[1], argv[2]);
|
||||
-
|
||||
- int tcfd = open64 (_PATH_TTY, O_RDONLY, 0600);
|
||||
- if (tcfd == -1)
|
||||
- {
|
||||
- if (errno == ENXIO)
|
||||
- FAIL_UNSUPPORTED ("terminal not available, skipping test");
|
||||
- FAIL_EXIT1 ("open64 (\"%s\", 0x%x, 0600): %m", _PATH_TTY, O_RDONLY);
|
||||
- }
|
||||
+ int tcfd = xopen (ptmxpath, O_RDONLY, 0600);
|
||||
|
||||
/* Check setting the controlling terminal without changing the group. */
|
||||
{
|
||||
@@ -198,5 +196,47 @@ do_test (int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int
|
||||
+do_test (int argc, char *argv[])
|
||||
+{
|
||||
+ if (restart)
|
||||
+ return handle_restart (argv[1], argv[2]);
|
||||
+
|
||||
+ pid_t pid = xfork ();
|
||||
+ if (pid == 0)
|
||||
+ {
|
||||
+ /* Create a pseudo-terminal to avoid interfering with the one using by
|
||||
+ test itself, creates a new session (so there is no controlling
|
||||
+ terminal), and set the pseudo-terminal as the controlling one. */
|
||||
+ int ptmx = posix_openpt (0);
|
||||
+ if (ptmx == -1)
|
||||
+ {
|
||||
+ if (errno == ENXIO)
|
||||
+ FAIL_UNSUPPORTED ("terminal not available, skipping test");
|
||||
+ FAIL_EXIT1 ("posix_openpt (0): %m");
|
||||
+ }
|
||||
+ TEST_VERIFY_EXIT (grantpt (ptmx) == 0);
|
||||
+ TEST_VERIFY_EXIT (unlockpt (ptmx) == 0);
|
||||
+
|
||||
+ TEST_VERIFY_EXIT (setsid () != -1);
|
||||
+ TEST_VERIFY_EXIT (ioctl (ptmx, TIOCSCTTY, NULL) == 0);
|
||||
+ while (dup2 (ptmx, STDIN_FILENO) == -1 && errno == EBUSY)
|
||||
+ ;
|
||||
+ while (dup2 (ptmx, STDOUT_FILENO) == -1 && errno == EBUSY)
|
||||
+ ;
|
||||
+ while (dup2 (ptmx, STDERR_FILENO) == -1 && errno == EBUSY)
|
||||
+ ;
|
||||
+ TEST_VERIFY_EXIT (ptsname_r (ptmx, ptmxpath, sizeof ptmxpath) == 0);
|
||||
+ xclose (ptmx);
|
||||
+
|
||||
+ run_test (argc, argv);
|
||||
+ _exit (0);
|
||||
+ }
|
||||
+ int status;
|
||||
+ xwaitpid (pid, &status, 0);
|
||||
+ TEST_VERIFY (WIFEXITED (status));
|
||||
+ exit (0);
|
||||
+}
|
||||
+
|
||||
#define TEST_FUNCTION_ARGV do_test
|
||||
#include <support/test-driver.c>
|
||||
--
|
||||
2.29.2
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
From a2f1675634b3513c09c38e55e6766e8c05768b1f Mon Sep 17 00:00:00 2001
|
||||
From: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
|
||||
Date: Tue, 1 Feb 2022 22:39:02 +0000
|
||||
Subject: [PATCH 03/13] linux: __get_nprocs_sched: do not feed CPU_COUNT_S with
|
||||
garbage [BZ #28850]
|
||||
|
||||
Pass the actual number of bytes returned by the kernel.
|
||||
|
||||
Fixes: 33099d72e41c ("linux: Simplify get_nprocs")
|
||||
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
|
||||
|
||||
(cherry picked from commit 97ba273b505763325efd802dc3a9562dbba79579)
|
||||
---
|
||||
NEWS | 1 +
|
||||
sysdeps/unix/sysv/linux/getsysstats.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index b1aae94cfb..d1602051d1 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -9,6 +9,7 @@ Version 2.35.1
|
||||
|
||||
The following bugs are resolved with this release:
|
||||
|
||||
+ [28850] linux: __get_nprocs_sched reads uninitialized memory from the stack
|
||||
[28853] libc: tst-spawn6 changes current foreground process group
|
||||
(breaks test isolation)
|
||||
|
||||
diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c
|
||||
index 4798cc337e..c98c8ce3d4 100644
|
||||
--- a/sysdeps/unix/sysv/linux/getsysstats.c
|
||||
+++ b/sysdeps/unix/sysv/linux/getsysstats.c
|
||||
@@ -44,7 +44,7 @@ __get_nprocs_sched (void)
|
||||
int r = INTERNAL_SYSCALL_CALL (sched_getaffinity, 0, cpu_bits_size,
|
||||
cpu_bits);
|
||||
if (r > 0)
|
||||
- return CPU_COUNT_S (cpu_bits_size, (cpu_set_t*) cpu_bits);
|
||||
+ return CPU_COUNT_S (r, (cpu_set_t*) cpu_bits);
|
||||
else if (r == -EINVAL)
|
||||
/* The input buffer is still not enough to store the number of cpus. This
|
||||
is an arbitrary values assuming such systems should be rare and there
|
||||
--
|
||||
2.29.2
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
From 7001c1e38b46d5f5a90f7915b1211782341ab6a8 Mon Sep 17 00:00:00 2001
|
||||
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
Date: Thu, 3 Feb 2022 16:52:52 -0300
|
||||
Subject: [PATCH 04/13] linux: Fix missing __convert_scm_timestamps (BZ #28860)
|
||||
|
||||
Commit 948ce73b31 made recvmsg/recvmmsg to always call
|
||||
__convert_scm_timestamps for 64 bit time_t symbol, so adjust it to
|
||||
always build it for __TIMESIZE != 64.
|
||||
|
||||
It fixes build for architecture with 32 bit time_t support when
|
||||
configured with minimum kernel of 5.1.
|
||||
|
||||
(cherry picked from 798d716df71fb23dc89d1d5dba1fc26a1b5c0024)
|
||||
---
|
||||
sysdeps/unix/sysv/linux/convert_scm_timestamps.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
|
||||
index 82171bf325..dfc8c2beff 100644
|
||||
--- a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
|
||||
+++ b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
|
||||
@@ -16,9 +16,9 @@
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
-#include <kernel-features.h>
|
||||
+#include <bits/timesize.h>
|
||||
|
||||
-#ifndef __ASSUME_TIME64_SYSCALLS
|
||||
+#if __TIMESIZE != 64
|
||||
# include <stdint.h>
|
||||
# include <string.h>
|
||||
# include <sys/socket.h>
|
||||
--
|
||||
2.29.2
|
||||
|
25
0005-Add-BZ-28860-reference-on-NEWS.patch
Normal file
25
0005-Add-BZ-28860-reference-on-NEWS.patch
Normal file
|
@ -0,0 +1,25 @@
|
|||
From 24962427071fa532c3c48c918e9d64d719cc8a6c Mon Sep 17 00:00:00 2001
|
||||
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
Date: Thu, 3 Feb 2022 17:50:13 -0300
|
||||
Subject: [PATCH 05/13] Add BZ#28860 reference on NEWS
|
||||
|
||||
---
|
||||
NEWS | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index d1602051d1..6b8db4e947 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -12,6 +12,8 @@ The following bugs are resolved with this release:
|
||||
[28850] linux: __get_nprocs_sched reads uninitialized memory from the stack
|
||||
[28853] libc: tst-spawn6 changes current foreground process group
|
||||
(breaks test isolation)
|
||||
+ [28860] build: --enable-kernel=5.1.0 build fails because of missing
|
||||
+ __convert_scm_timestamps
|
||||
|
||||
|
||||
Version 2.35
|
||||
--
|
||||
2.29.2
|
||||
|
7374
ChangeLog.old
Normal file
7374
ChangeLog.old
Normal file
File diff suppressed because it is too large
Load diff
77
bench.mk
Normal file
77
bench.mk
Normal file
|
@ -0,0 +1,77 @@
|
|||
objpfx = $(prefix)/$(ver)/usr/libexec/glibc-benchtests/
|
||||
|
||||
bench-math := acos acosh asin asinh atan atanh cos cosh exp exp2 ffs ffsll \
|
||||
log log2 modf pow rint sin sincos sinh sqrt tan tanh
|
||||
|
||||
bench-pthread := pthread_once
|
||||
|
||||
bench := $(bench-math) $(bench-pthread)
|
||||
|
||||
run-bench := $(prefix)/$(ver)/lib64/ld-linux-x86-64.so.2 --library-path $(prefix)/$(ver)/lib64 $${run}
|
||||
|
||||
# String function benchmarks.
|
||||
string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \
|
||||
mempcpy memset rawmemchr stpcpy stpncpy strcasecmp strcasestr \
|
||||
strcat strchr strchrnul strcmp strcpy strcspn strlen \
|
||||
strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \
|
||||
strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok
|
||||
string-bench-all := $(string-bench)
|
||||
|
||||
stdlib-bench := strtod
|
||||
|
||||
benchset := $(string-bench-all) $(stdlib-bench)
|
||||
|
||||
bench-malloc := malloc-thread
|
||||
|
||||
binaries-bench := $(addprefix $(objpfx)bench-,$(bench))
|
||||
binaries-benchset := $(addprefix $(objpfx)bench-,$(benchset))
|
||||
binaries-bench-malloc := $(addprefix $(objpfx)bench-,$(bench-malloc))
|
||||
|
||||
DETAILED_OPT :=
|
||||
|
||||
ifdef DETAILED
|
||||
DETAILED_OPT := -d
|
||||
endif
|
||||
|
||||
bench: bench-set bench-func bench-malloc
|
||||
|
||||
bench-set: $(binaries-benchset)
|
||||
for run in $^; do \
|
||||
outfile=$(prefix)/$$(basename $${run}.$(ver).out); \
|
||||
echo "Running $${run}"; \
|
||||
$(run-bench) > $${outfile}.tmp; \
|
||||
mv $${outfile}{.tmp,}; \
|
||||
done
|
||||
|
||||
bench-malloc: $(binaries-bench-malloc)
|
||||
run=$(objpfx)bench-malloc-thread; \
|
||||
outfile=$(prefix)/$$(basename $${run}.$(ver).out); \
|
||||
for thr in 1 8 16 32; do \
|
||||
echo "Running $${run} $${thr}"; \
|
||||
$(run-bench) $${thr} > $${outfile}.tmp; \
|
||||
mv $${outfile}{.tmp,}; \
|
||||
done
|
||||
|
||||
# Build and execute the benchmark functions. This target generates JSON
|
||||
# formatted bench.out. Each of the programs produce independent JSON output,
|
||||
# so one could even execute them individually and process it using any JSON
|
||||
# capable language or tool.
|
||||
bench-func: $(binaries-bench)
|
||||
{ echo "{\"timing_type\": \"hp-timing\","; \
|
||||
echo " \"functions\": {"; \
|
||||
for run in $^; do \
|
||||
if ! [ "x$${run}" = "x$<" ]; then \
|
||||
echo ","; \
|
||||
fi; \
|
||||
echo "Running $${run}" >&2; \
|
||||
$(run-bench) $(DETAILED_OPT); \
|
||||
done; \
|
||||
echo; \
|
||||
echo " }"; \
|
||||
echo "}"; } > $(prefix)/bench.$(ver).out-tmp; \
|
||||
if [ -f $(prefix)/bench.$(ver).out ]; then \
|
||||
mv -f $(prefix)/bench.$(ver).out{,.old}; \
|
||||
fi; \
|
||||
mv -f $(prefix)/bench.$(ver).out{-tmp,}
|
||||
# scripts/validate_benchout.py bench.out \
|
||||
# scripts/benchout.schema.json
|
BIN
glibc-2.35-5-g2496242707.tar.xz
Normal file
BIN
glibc-2.35-5-g2496242707.tar.xz
Normal file
Binary file not shown.
BIN
glibc-2.35.tar.xz
Normal file
BIN
glibc-2.35.tar.xz
Normal file
Binary file not shown.
153
glibc-bench-compare
Executable file
153
glibc-bench-compare
Executable file
|
@ -0,0 +1,153 @@
|
|||
#!/usr/bin/bash
|
||||
# This script can be invoked as follows:
|
||||
#
|
||||
# glibc-bench-compare [options] <BUILD> [BUILD]
|
||||
#
|
||||
# Options may be one of the following:
|
||||
#
|
||||
# -t The BUILD arguments are task ids and not a version-release string
|
||||
# -a ARCH Do comparison for ARCH architecture
|
||||
#
|
||||
# If any of the above options are given, both BUILD arguments must be given.
|
||||
# Otherwise, if only one BUILD is specified, then it is compared against the
|
||||
# installed glibc.
|
||||
|
||||
# Silence the pushd/popd messages
|
||||
pushd() {
|
||||
command pushd "$@" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
popd() {
|
||||
command popd "$@" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
# Clean up any downloaded files before we exit
|
||||
trap "rm -rf /tmp/glibc-bench-compare.$BASHPID.*" EXIT
|
||||
|
||||
task=0
|
||||
arch=$(uname -i)
|
||||
options=0
|
||||
path=0
|
||||
installed=
|
||||
|
||||
# Look for any commandline options
|
||||
while getopts ":tpa:" opt; do
|
||||
case $opt in
|
||||
p)
|
||||
path=1
|
||||
;;
|
||||
t)
|
||||
task=1
|
||||
options=1
|
||||
echo "Not implemented."
|
||||
exit 1
|
||||
;;
|
||||
a)
|
||||
arch=$OPTARG
|
||||
options=1
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Done, now shift all option arguments out.
|
||||
shift $((OPTIND-1))
|
||||
|
||||
if [ $# -gt 2 ] || [ $# -eq 0 ] || [ $# -lt 2 -a $options -eq 1 ]; then
|
||||
echo "Usage: $0 [OPTIONS] <old> [new]"
|
||||
echo
|
||||
echo "OPTIONS:"
|
||||
echo -e "\t-t\tCompare two brew tasks"
|
||||
echo -e "\t-a ARCH\tGet rpms for the ARCH architecture"
|
||||
echo -e "\t-p\tCompare built rpms in two paths."
|
||||
echo -e "\t\tThis minimally needs glibc, glibc-common and glibc-benchtests"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z $2 ]; then
|
||||
new="$1"
|
||||
old=$(rpm --queryformat "%{VERSION}-%{RELEASE}\n" -q glibc | head -1)
|
||||
installed=$old
|
||||
else
|
||||
new="$2"
|
||||
old="$1"
|
||||
fi
|
||||
|
||||
decompress_rpms() {
|
||||
# We were given a path to the rpms. Figure out the version-release and
|
||||
# decompress the rpms.
|
||||
if [ -n $1 ]; then
|
||||
vr=$(rpm --queryformat="%{VERSION}-%{RELEASE}" -qp $1/glibc-2*.rpm | head -1)
|
||||
mkdir $vr && pushd $vr
|
||||
fi
|
||||
|
||||
for r in $1*.rpm; do
|
||||
( rpm2cpio $r | cpio -di ) > /dev/null
|
||||
done
|
||||
|
||||
if [ -n $1 ]; then
|
||||
popd
|
||||
echo $vr
|
||||
fi
|
||||
}
|
||||
|
||||
# Get rpms for a build and decompress them
|
||||
get_build() {
|
||||
echo "Processing build $1"
|
||||
mkdir $1 && pushd $1
|
||||
brew buildinfo "glibc-$1" |
|
||||
sed -n -e "s|/mnt/koji\(.\+$arch.\+\)|http://kojipkgs.fedoraproject.org\1|p" |
|
||||
while read url; do
|
||||
echo "Downloading $url"
|
||||
wget -q $url
|
||||
done
|
||||
decompress_rpms
|
||||
|
||||
echo "Removing rpms"
|
||||
rm -f $1/*.rpm
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
# Run benchmarks for a build
|
||||
run_bench() {
|
||||
if [ -z $1 ]; then
|
||||
make DETAILED=1 ver=$installed prefix= -f /usr/libexec/glibc-benchtests/bench.mk bench
|
||||
else
|
||||
make DETAILED=1 ver=$1 prefix=$PWD -f $1/usr/libexec/glibc-benchtests/bench.mk bench
|
||||
fi
|
||||
}
|
||||
|
||||
# Get absolute paths if needed, since we will change into the working directory
|
||||
# next.
|
||||
if [ $path -eq 1 ]; then
|
||||
old_path=$(realpath $old)/
|
||||
new_path=$(realpath $new)/
|
||||
fi
|
||||
|
||||
tmpdir=$(mktemp -p /tmp -d glibc-bench-compare.$$.XXXX)
|
||||
pushd $tmpdir
|
||||
|
||||
# Get both builds.
|
||||
if [ $path -eq 0 ]; then
|
||||
if [ -z $installed ]; then
|
||||
get_build $old
|
||||
fi
|
||||
get_build $new
|
||||
else
|
||||
old=$(decompress_rpms $old_path)
|
||||
new=$(decompress_rpms $new_path)
|
||||
fi
|
||||
|
||||
# make bench for each of those.
|
||||
if [ -z $installed ]; then
|
||||
run_bench $old
|
||||
else
|
||||
run_bench
|
||||
fi
|
||||
run_bench $new
|
||||
|
||||
# Now run the comparison script.
|
||||
$old/usr/libexec/glibc-benchtests/compare_bench.py $old/usr/libexec/glibc-benchtests/benchout.schema.json \
|
||||
bench.$old.out bench.$new.out
|
44
glibc-cs-path.patch
Normal file
44
glibc-cs-path.patch
Normal file
|
@ -0,0 +1,44 @@
|
|||
Short description: Adjust CS_PATH and the test container layout.
|
||||
Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
|
||||
Origin: PATCH
|
||||
Upstream status: not-needed
|
||||
|
||||
In Fedora we should return only /usr/bin as CS_PATH because /bin is just
|
||||
a symlink to /usr/bin after MoveToUsr transition (which glibc has not
|
||||
really completed).
|
||||
|
||||
We also create /{bin,lib,lib64,sbin} in the test container as symbolic
|
||||
links. This brings the test container in line with Fedora's filesystem
|
||||
layout and avoids some test failures. For example, because Fedora's
|
||||
CS_PATH is /usr/bin, tst-vfork3 will try to execute /usr/bin/echo in the
|
||||
container. Without this change the container installs `echo' in /bin
|
||||
not /usr/bin, causing the test to fail.
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index a49870d3d1e636a9..feb2599203b10098 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -598,9 +598,13 @@ $(tests-container) $(addsuffix /tests,$(subdirs)) : \
|
||||
$(objpfx)testroot.pristine/install.stamp :
|
||||
test -d $(objpfx)testroot.pristine || \
|
||||
mkdir $(objpfx)testroot.pristine
|
||||
- # We need a working /bin/sh for some of the tests.
|
||||
- test -d $(objpfx)testroot.pristine/bin || \
|
||||
- mkdir $(objpfx)testroot.pristine/bin
|
||||
+ # Set up symlinks to directories whose contents got moved to /usr
|
||||
+ for moved in bin lib lib64 sbin; do \
|
||||
+ test -d $(objpfx)testroot.pristine/usr/$$moved || \
|
||||
+ mkdir -p $(objpfx)testroot.pristine/usr/$$moved ;\
|
||||
+ test -e $(objpfx)testroot.pristine/$$moved || \
|
||||
+ ln -s usr/$$moved $(objpfx)testroot.pristine/$$moved ;\
|
||||
+ done
|
||||
# We need the compiled locale dir for localedef tests.
|
||||
test -d $(objpfx)testroot.pristine/$(complocaledir) || \
|
||||
mkdir -p $(objpfx)testroot.pristine/$(complocaledir)
|
||||
diff --git a/sysdeps/unix/confstr.h b/sysdeps/unix/confstr.h
|
||||
index 15859c3b2759878e..9b63b7f8069866fd 100644
|
||||
--- a/sysdeps/unix/confstr.h
|
||||
+++ b/sysdeps/unix/confstr.h
|
||||
@@ -1 +1 @@
|
||||
-#define CS_PATH "/bin:/usr/bin"
|
||||
+#define CS_PATH "/usr/bin"
|
20
glibc-deprecated-selinux-makedb.patch
Normal file
20
glibc-deprecated-selinux-makedb.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
This is necessary to get things building again after libselinux changes.
|
||||
A proper fix is under discussion upstream:
|
||||
|
||||
<https://sourceware.org/pipermail/libc-alpha/2020-July/116504.html>
|
||||
|
||||
diff --git a/nss/makedb.c b/nss/makedb.c
|
||||
index 8e389a1683747cf1..9d81aed57d384a22 100644
|
||||
--- a/nss/makedb.c
|
||||
+++ b/nss/makedb.c
|
||||
@@ -17,6 +17,10 @@
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
+/* This file uses deprecated declarations from libselinux. */
|
||||
+#include <libc-diag.h>
|
||||
+DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations");
|
||||
+
|
||||
#include <argp.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
37
glibc-fix-newlocale-error-return.patch
Normal file
37
glibc-fix-newlocale-error-return.patch
Normal file
|
@ -0,0 +1,37 @@
|
|||
Short description: Fix newlocale error return.
|
||||
Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
|
||||
Origin: PATCH
|
||||
Bug-RHEL: #832516
|
||||
Bug-Fedora: #827510
|
||||
Bug-Upstream: #14247
|
||||
Upstream status: not-submitted
|
||||
|
||||
This needs to go upstream right away to fix the error case for
|
||||
newlocale not correctly returning an error.
|
||||
|
||||
2012-06-14 Jeff Law <law@redhat.com>
|
||||
|
||||
* locale/loadlocale.c (_nl_load_locale): Delay setting
|
||||
file->decided until we have successfully loaded the file's
|
||||
data.
|
||||
|
||||
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
|
||||
index e3fa187..9fd9216 100644
|
||||
--- a/locale/loadlocale.c
|
||||
+++ b/locale/loadlocale.c
|
||||
@@ -169,7 +169,6 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
|
||||
int save_err;
|
||||
int alloc = ld_mapped;
|
||||
|
||||
- file->decided = 1;
|
||||
file->data = NULL;
|
||||
|
||||
fd = __open_nocancel (file->filename, O_RDONLY | O_CLOEXEC);
|
||||
@@ -278,6 +277,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
|
||||
newdata->alloc = alloc;
|
||||
|
||||
file->data = newdata;
|
||||
+ file->decided = 1;
|
||||
}
|
||||
|
||||
void
|
21
glibc-no-archive-for-localedef.patch
Normal file
21
glibc-no-archive-for-localedef.patch
Normal file
|
@ -0,0 +1,21 @@
|
|||
Short description: Fedora-specific glibc install locale changes.
|
||||
Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
|
||||
Origin: PATCH
|
||||
Upstream status: not-needed
|
||||
|
||||
The Fedora glibc build and install does not need the normal install
|
||||
behaviour which updates the locale archive. The Fedora install phase
|
||||
in the spec file of the rpm will handle this manually.
|
||||
|
||||
diff --git a/localedata/Makefile b/localedata/Makefile
|
||||
index 0eea396ad86da956..54caabda33728207 100644
|
||||
--- a/localedata/Makefile
|
||||
+++ b/localedata/Makefile
|
||||
@@ -413,6 +413,7 @@ define build-one-locale
|
||||
echo -n '...'; \
|
||||
input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
|
||||
$(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
|
||||
+ --no-archive \
|
||||
-i locales/$$input -f charmaps/$$charset \
|
||||
$(addprefix --prefix=,$(install_root)) $$locale \
|
||||
&& echo ' done';
|
38
glibc-nscd-add-syslog-target-dependency.patch
Normal file
38
glibc-nscd-add-syslog-target-dependency.patch
Normal file
|
@ -0,0 +1,38 @@
|
|||
Short description: Add syslog.target dependency.
|
||||
Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
|
||||
Origin: PATCH
|
||||
Bug-Fedora: #1070416
|
||||
Upstream status: not-needed
|
||||
|
||||
Fedora-specific changes to the nscd.service file.
|
||||
See also: glibc-nscd-sysconfig.patch.
|
||||
|
||||
--- a/nscd/nscd.service
|
||||
+++ b/nscd/nscd.service
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
[Unit]
|
||||
Description=Name Service Cache Daemon
|
||||
+After=syslog.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
@@ -17,3 +18,4 @@
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
+Also=nscd.socket
|
||||
diff --git a/nscd/nscd.socket b/nscd/nscd.socket
|
||||
new file mode 100644
|
||||
index 0000000..7e512d5
|
||||
--- /dev/null
|
||||
+++ b/nscd/nscd.socket
|
||||
@@ -0,0 +1,8 @@
|
||||
+[Unit]
|
||||
+Description=Name Service Cache Daemon Socket
|
||||
+
|
||||
+[Socket]
|
||||
+ListenDatagram=/var/run/nscd/socket
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=sockets.target
|
31
glibc-place-info-into-Libraries-category.patch
Normal file
31
glibc-place-info-into-Libraries-category.patch
Normal file
|
@ -0,0 +1,31 @@
|
|||
Short description: Place glibc info into "Libraries" category.
|
||||
Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
|
||||
Origin: PATCH
|
||||
Upstream status: not-needed
|
||||
|
||||
The category names for libraries is completely random including
|
||||
"Libraries", "GNU Libraries", "GNU libraries", and "Software libraries."
|
||||
In the GNU info manual the "Software libraries" category is given as an
|
||||
example, but really we need to standardize on a category for upstream.
|
||||
I suggest we drop this change after some upstream discussion.
|
||||
|
||||
From 4820b9175535e13df79ce816106016040014916e Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jelinek <jakub@redhat.com>
|
||||
Date: Fri, 3 Nov 2006 16:31:21 +0000
|
||||
Subject: [PATCH] Change @dircategory.
|
||||
|
||||
---
|
||||
manual/libc.texinfo | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
--- a/manual/libc.texinfo
|
||||
+++ b/manual/libc.texinfo
|
||||
@@ -7,7 +7,7 @@
|
||||
@include macros.texi
|
||||
|
||||
@comment Tell install-info what to do.
|
||||
-@dircategory Software libraries
|
||||
+@dircategory Libraries
|
||||
@direntry
|
||||
* Libc: (libc). C library.
|
||||
@end direntry
|
31
glibc-python3.patch
Normal file
31
glibc-python3.patch
Normal file
|
@ -0,0 +1,31 @@
|
|||
Use python3 for installed executable python scripts.
|
||||
|
||||
Fedora is a Python3-only distribution:
|
||||
https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
|
||||
|
||||
This fixes build failures where builders may strictly enforce only
|
||||
python3 during a transitional phase.
|
||||
|
||||
Author: Carlos O'Donell <carlos@redhat.com>
|
||||
|
||||
|
||||
diff --git a/benchtests/scripts/compare_bench.py b/benchtests/scripts/compare_bench.py
|
||||
index a85ca3a38be1fdeb..9f1ea9d85f4b833a 100755
|
||||
--- a/benchtests/scripts/compare_bench.py
|
||||
+++ b/benchtests/scripts/compare_bench.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
# Copyright (C) 2015-2022 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
#
|
||||
diff --git a/benchtests/scripts/import_bench.py b/benchtests/scripts/import_bench.py
|
||||
index d8bdde7753885a4d..698c4ff81b13f697 100644
|
||||
--- a/benchtests/scripts/import_bench.py
|
||||
+++ b/benchtests/scripts/import_bench.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
# Copyright (C) 2015-2022 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
#
|
2061
glibc.spec
Normal file
2061
glibc.spec
Normal file
File diff suppressed because it is too large
Load diff
40
parse-SUPPORTED.py
Normal file
40
parse-SUPPORTED.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/python3
|
||||
#
|
||||
# This script turns localedata/SUPPORTED (whose path is passed as the
|
||||
# first argument) into a normalized list of LANGUAGE "_" REGION pairs.
|
||||
# (If there is no REGION defined, only LANGUAGE is used.) The list
|
||||
# is written to standard output, with one element per line.
|
||||
|
||||
import sys
|
||||
|
||||
supported, = sys.argv[1:]
|
||||
|
||||
# Pairs seen so far. Used to suppress duplicates.
|
||||
seen = set()
|
||||
with open(supported) as inp:
|
||||
for line in inp:
|
||||
if line.startswith("#") or line == "SUPPORTED-LOCALES=\\\n":
|
||||
# Comment or prefix.
|
||||
continue
|
||||
if not line.endswith(" \\\n"):
|
||||
raise IOError("line without continuation: " + repr(line))
|
||||
try:
|
||||
slash = line.index("/")
|
||||
except ValueError:
|
||||
raise IOError("line without slash: " + repr(line))
|
||||
spec = line[:slash]
|
||||
for separator in ".@":
|
||||
try:
|
||||
# Strip charset, variant specifiers.
|
||||
spec = spec[:spec.index(separator)]
|
||||
except ValueError:
|
||||
pass
|
||||
seen.add(spec)
|
||||
|
||||
# The C locale does not correspond to a language.
|
||||
seen.remove("C")
|
||||
|
||||
# The glibc source file is not sorted.
|
||||
for spec in sorted(seen):
|
||||
print(spec)
|
||||
print() # The Lua generator produces a trailing newline.
|
117
wrap-find-debuginfo.sh
Normal file
117
wrap-find-debuginfo.sh
Normal file
|
@ -0,0 +1,117 @@
|
|||
#!/bin/bash
|
||||
# Wrapper script for find-debuginfo.sh
|
||||
#
|
||||
# Usage:
|
||||
# wrap-find-debuginfo.sh SYSROOT-PATH SCRIPT-PATH SCRIPT-ARGS...
|
||||
#
|
||||
# The wrapper saves the original version of ld.so found in SYSROOT-PATH,
|
||||
# invokes SCRIPT-PATH with SCRIPT-ARGS, and then restores the
|
||||
# LDSO-PATH file, followed by note merging and DWZ compression.
|
||||
# As a result, ld.so has (mostly) unchanged debuginfo even
|
||||
# after debuginfo extraction.
|
||||
#
|
||||
# For libc.so.6, a set of strategic symbols is preserved in .symtab
|
||||
# that are frequently used in valgrind suppressions and elsewhere.
|
||||
|
||||
set -ex
|
||||
|
||||
ldso_tmp="$(mktemp)"
|
||||
libc_tmp="$(mktemp)"
|
||||
|
||||
# Prefer a separately installed debugedit over the RPM-integrated one.
|
||||
if command -v debugedit >/dev/null ; then
|
||||
debugedit=debugedit
|
||||
else
|
||||
debugedit=/usr/lib/rpm/debugedit
|
||||
fi
|
||||
|
||||
cleanup () {
|
||||
rm -f "$ldso_tmp" "$libc_tmp"
|
||||
}
|
||||
trap cleanup 0
|
||||
|
||||
sysroot_path="$1"
|
||||
shift
|
||||
script_path="$1"
|
||||
shift
|
||||
|
||||
# See ldso_path setting in glibc.spec.
|
||||
ldso_path=
|
||||
for ldso_candidate in `find "$sysroot_path" -regextype posix-extended \
|
||||
-regex '.*/ld(-.*|64|)\.so\.[0-9]+$' -type f` ; do
|
||||
if test -z "$ldso_path" ; then
|
||||
ldso_path="$ldso_candidate"
|
||||
else
|
||||
echo "error: multiple ld.so candidates: $ldso_path, $ldso_candidate"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# libc.so.6 always uses this name, so it is simpler to locate.
|
||||
libc_path=
|
||||
for libc_candidate in `find "$sysroot_path" -name libc.so.6`; do
|
||||
if test -z "$libc_path" ; then
|
||||
libc_path="$libc_candidate"
|
||||
else
|
||||
echo "error: multiple libc.so.6 candidates: $libc_path, $libc_candidate"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# Preserve the original files.
|
||||
cp "$ldso_path" "$ldso_tmp"
|
||||
cp "$libc_path" "$libc_tmp"
|
||||
|
||||
# Run the debuginfo extraction.
|
||||
"$script_path" "$@"
|
||||
|
||||
# Restore the original files.
|
||||
cp "$ldso_tmp" "$ldso_path"
|
||||
cp "$libc_tmp" "$libc_path"
|
||||
|
||||
# Reduce the size of notes. Primarily for annobin.
|
||||
objcopy --merge-notes "$ldso_path"
|
||||
objcopy --merge-notes "$libc_path"
|
||||
|
||||
# libc.so.6: Reduce to valuable symbols. Eliminate file symbols,
|
||||
# annobin symbols, and symbols used by the glibc build to implement
|
||||
# hidden aliases (__EI_*). We would also like to remove __GI_*
|
||||
# symbols, but even listing them explicitly (as in -K __GI_strlen)
|
||||
# still causes strip to remove them, so there is no filtering of
|
||||
# __GI_* here. (Debuginfo is gone after this, so no need to optimize
|
||||
# it.)
|
||||
strip -w \
|
||||
-K '*' \
|
||||
-K '!*.c' \
|
||||
-K '!*.os' \
|
||||
-K '!.annobin_*' \
|
||||
-K '!__EI_*' \
|
||||
-K '!__PRETTY_FUNCTION__*' \
|
||||
"$libc_path"
|
||||
|
||||
# ld.so: Rewrite the source file paths to match the extracted
|
||||
# locations. First compute the arguments for invoking debugedit.
|
||||
# See find-debuginfo.sh.
|
||||
debug_dest_name="/usr/src/debug"
|
||||
last_arg=
|
||||
while true ; do
|
||||
arg="$1"
|
||||
shift || break
|
||||
case "$arg" in
|
||||
(--unique-debug-src-base)
|
||||
debug_dest_name="/usr/src/debug/$1"
|
||||
shift
|
||||
;;
|
||||
(-*)
|
||||
;;
|
||||
(*)
|
||||
last_arg="$arg"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
debug_base_name=${last_arg:-$RPM_BUILD_ROOT}
|
||||
$debugedit -b "$debug_base_name" -d "$debug_dest_name" -n $ldso_path
|
||||
|
||||
# Apply single-file DWARF optimization.
|
||||
dwz $ldso_path
|
Loading…
Add table
Reference in a new issue