init from glibc master, commit 4cadcf
This commit is contained in:
parent
d756058c85
commit
392f53d06f
2321
0001-add-base-files-for-libphtread-condition-family.patch
Normal file
2321
0001-add-base-files-for-libphtread-condition-family.patch
Normal file
File diff suppressed because it is too large
Load Diff
2609
0002-add-header-files-for-libphtread_2_17_so.patch
Normal file
2609
0002-add-header-files-for-libphtread_2_17_so.patch
Normal file
File diff suppressed because it is too large
Load Diff
135
0003-add-build-script-and-files-of-libpthread_2_17_so.patch
Normal file
135
0003-add-build-script-and-files-of-libpthread_2_17_so.patch
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
From 7cb15fbef45361db6ad718077a4f0a6d2dc845f2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Yang Yanchao <yangyanchao6@huawei.com>
|
||||||
|
Date: Wed Nov 24 09:31:31 2021 +0800
|
||||||
|
Subject: [PATCH 3/9] build extra lipthreadcond so
|
||||||
|
|
||||||
|
Add the build script and file of libpthread-2.17.so
|
||||||
|
|
||||||
|
---
|
||||||
|
nptl_2_17/Makefile | 52 +++++++++++++++++++++++++++
|
||||||
|
nptl_2_17/build_libpthread-2.17.so.sh | 10 ++++++
|
||||||
|
nptl_2_17/libpthread-2.17-aarch64.map | 14 ++++++++
|
||||||
|
nptl_2_17/libpthread-2.17-x86_64.map | 14 ++++++++
|
||||||
|
4 files changed, 90 insertions(+)
|
||||||
|
create mode 100644 nptl_2_17/Makefile
|
||||||
|
create mode 100644 nptl_2_17/build_libpthread-2.17.so.sh
|
||||||
|
create mode 100644 nptl_2_17/libpthread-2.17-aarch64.map
|
||||||
|
create mode 100644 nptl_2_17/libpthread-2.17-x86_64.map
|
||||||
|
|
||||||
|
diff --git a/nptl_2_17/Makefile b/nptl_2_17/Makefile
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..f248ce56
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/Makefile
|
||||||
|
@@ -0,0 +1,52 @@
|
||||||
|
+include libpthread-2.17_config
|
||||||
|
+subdir=libpthread-2.17
|
||||||
|
+objdir=../$(build_dir)/
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ifdef subdir
|
||||||
|
+.. := ../
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
+objpfx := $(patsubst %//,%/,$(objdir)/$(subdir)/)
|
||||||
|
+common-objpfx = $(objdir)/
|
||||||
|
+common-objdir = $(objdir)
|
||||||
|
+
|
||||||
|
+sysdep_dir := $(..)sysdeps
|
||||||
|
+export sysdep_dir := $(sysdep_dir)
|
||||||
|
+
|
||||||
|
+include $(common-objpfx)soversions.mk
|
||||||
|
+include $(common-objpfx)config.make
|
||||||
|
+
|
||||||
|
+uses-callbacks = -fexceptions
|
||||||
|
+
|
||||||
|
+sysdirs := $(foreach D,$(config-sysdirs),$(firstword $(filter /%,$D) $(..)$D))
|
||||||
|
+
|
||||||
|
++sysdep_dirs = $(sysdirs)
|
||||||
|
++sysdep_dirs := $(objdir) $(+sysdep_dirs)
|
||||||
|
+
|
||||||
|
++sysdep-includes := $(foreach dir,$(+sysdep_dirs), $(addprefix -I,$(wildcard $(dir)/include) $(dir)))
|
||||||
|
+
|
||||||
|
+compile_obj = pthread_cond_wait_2_17.os pthread_cond_signal_2_17.os pthread_cond_broadcast_2_17.os pthread_cond_init_2_17.os pthread_cond_destroy_2_17.os pthread_condattr_getclock_2_17.os pthread_condattr_getpshared_2_17.os pthread_condattr_init_2_17.os pthread_condattr_setclock_2_17.os cleanup_compat_2_17.os pthread_mutex_lock_2_17.os pthread_mutex_unlock_2_17.os tpp_2_17.os vars_2_17.os pause_nocancel_2_17.os lll_timedlock_wait_2_17.os pthread_mutex_cond_lock_2_17.os cancellation_2_17.os lowlevellock_2_17.os unwind_2_17.os
|
||||||
|
+
|
||||||
|
+ifeq (x86_64, $(arch))
|
||||||
|
+compile_obj += elision-timed_2_17.os elision-trylock_2_17.os elision-lock_2_17.os elision-unlock_2_17.os
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
+exist_obj_dir = $(foreach n,$(exist_obj),../$(build_dir)/nptl/$(n))
|
||||||
|
+
|
||||||
|
+compile_obj_dir = $(foreach n,$(compile_obj),../$(build_dir)/nptl/$(n))
|
||||||
|
+
|
||||||
|
+CFLAGS = -c -std=gnu11 -fgnu89-inline -fPIE -DNDEBUG -O2 -Wall -Werror -Wp,-D_GLIBCXX_ASSERTIONS -Wundef -Wwrite-strings -fasynchronous-unwind-tables -fmerge-all-constants -frounding-math -fstack-clash-protection -fstack-protector-strong -g -mtune=generic -Wstrict-prototypes -Wold-style-definition -fno-math-errno -fPIC -fexceptions -fasynchronous-unwind-tables -ftls-model=initial-exec -D_FORTIFY_SOURCE=2 -DSHARED -DTOP_NAMESPACE=glibc
|
||||||
|
+
|
||||||
|
+Headers = -I../include -I../$(build_dir)/nptl $(+sysdep-includes) -I../nptl_2_17 -I../nptl -I../libio -I../. -D_LIBC_REENTRANT -include ../$(build_dir)/libc-modules.h -include include/libc-symbols.h
|
||||||
|
+
|
||||||
|
+all: libpthread-2.17.so
|
||||||
|
+
|
||||||
|
+libpthread-2.17.so : $(compile_obj) libpthread-2.17_pic.a
|
||||||
|
+ gcc -shared -static-libgcc -Wl,-O1 -Wl,-z,defs -Wl,-dynamic-linker=/usr/local/lib/$(ld.so-version) -B../$(build_dir)/csu/ -Wl,--version-script=libpthread-2.17-$(arch).map -Wl,-soname=libpthread-2.17.so.0 -Wl,-z,noexecstack -Wtrampolines -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,now -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst -L../$(build_dir) -L../$(build_dir)/math -L../$(build_dir)/elf -L../$(build_dir)/dlfcn -L../$(build_dir)/nss -L../$(build_dir)/nis -L../$(build_dir)/rt -L../$(build_dir)/resolv -L../$(build_dir)/mathvec -L../$(build_dir)/support -L../$(build_dir)/crypt -L../$(build_dir)/nptl -Wl,-rpath-link=../$(build_dir):../$(build_dir)/math:../$(build_dir)/elf:../$(build_dir)/dlfcn:../$(build_dir)/nss:../$(build_dir)/nis:../$(build_dir)/rt:../$(build_dir)/resolv:../$(build_dir)/mathvec:../$(build_dir)/support:../$(build_dir)/crypt:../$(build_dir)/nptl -o ../$(build_dir)/nptl/libpthread-2.17.so ../$(build_dir)/csu/abi-note.o -Wl,--whole-archive ../$(build_dir)/nptl/libpthread-2.17_pic.a -Wl,--no-whole-archive -Wl,--start-group ../$(build_dir)/libc.so ../$(build_dir)/libc_nonshared.a -Wl,--as-needed ../$(build_dir)/elf/ld.so -Wl,--no-as-needed -Wl,--end-group
|
||||||
|
+
|
||||||
|
+libpthread-2.17_pic.a : $(compile_obj_dir) $(exist_obj_dir)
|
||||||
|
+ ar cruv ../$(build_dir)/nptl/$@ $^
|
||||||
|
+
|
||||||
|
+$(compile_obj) : %.os : %.c
|
||||||
|
+ gcc $< $(CFLAGS) $(Headers) -o ../$(build_dir)/nptl/$@ -MD -MP -MF ../$(build_dir)/nptl/$@.dt -MT ../$(build_dir)/nptl/$@
|
||||||
|
diff --git a/nptl_2_17/build_libpthread-2.17.so.sh b/nptl_2_17/build_libpthread-2.17.so.sh
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..bdb97d0f
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/build_libpthread-2.17.so.sh
|
||||||
|
@@ -0,0 +1,10 @@
|
||||||
|
+#!/bin/sh
|
||||||
|
+set -e
|
||||||
|
+build_arch=$1
|
||||||
|
+build_dir=$2
|
||||||
|
+config_dir=libpthread-2.17_config
|
||||||
|
+
|
||||||
|
+echo arch=${build_arch} > ${config_dir}
|
||||||
|
+echo build_dir=${build_dir} >> ${config_dir}
|
||||||
|
+make
|
||||||
|
+rm -rf ${config_dir}
|
||||||
|
diff --git a/nptl_2_17/libpthread-2.17-aarch64.map b/nptl_2_17/libpthread-2.17-aarch64.map
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..2c49fe17
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/libpthread-2.17-aarch64.map
|
||||||
|
@@ -0,0 +1,14 @@
|
||||||
|
+GLIBC_2.17 {
|
||||||
|
+ global:
|
||||||
|
+ pthread_cond_init; pthread_cond_destroy;
|
||||||
|
+ pthread_cond_signal; pthread_cond_broadcast;
|
||||||
|
+ pthread_cond_wait; pthread_cond_timedwait;
|
||||||
|
+ local:
|
||||||
|
+ *;
|
||||||
|
+};
|
||||||
|
+GLIBC_2.34 {
|
||||||
|
+ global:
|
||||||
|
+ pthread_cond_clockwait;
|
||||||
|
+ local:
|
||||||
|
+ *;
|
||||||
|
+};
|
||||||
|
diff --git a/nptl_2_17/libpthread-2.17-x86_64.map b/nptl_2_17/libpthread-2.17-x86_64.map
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..b01e7d0d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/libpthread-2.17-x86_64.map
|
||||||
|
@@ -0,0 +1,14 @@
|
||||||
|
+GLIBC_2.3.2 {
|
||||||
|
+ global:
|
||||||
|
+ pthread_cond_init; pthread_cond_destroy;
|
||||||
|
+ pthread_cond_signal; pthread_cond_broadcast;
|
||||||
|
+ pthread_cond_wait; pthread_cond_timedwait;
|
||||||
|
+ local:
|
||||||
|
+ *;
|
||||||
|
+};
|
||||||
|
+GLIBC_2.34 {
|
||||||
|
+ global:
|
||||||
|
+ pthread_cond_clockwait;
|
||||||
|
+ local:
|
||||||
|
+ *;
|
||||||
|
+};
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
166
0004-add-two-header-files-with-some-deleted-macros.patch
Normal file
166
0004-add-two-header-files-with-some-deleted-macros.patch
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
From d6e6184b4f10ef2cbdec09eae60350ced71e3de7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Yang Yanchao <yangyanchao6@huawei.com>
|
||||||
|
Date: Wed Nov 24 09:31:31 2021 +0800
|
||||||
|
Subject: [PATCH 4/9] build extra lipthreadcond so
|
||||||
|
|
||||||
|
For compatibility with glibc2.17, two header files are added with some
|
||||||
|
deleted macros.
|
||||||
|
|
||||||
|
---
|
||||||
|
nptl_2_17/compat_pthread_2_17.h | 61 +++++++++++++++++++++++++++
|
||||||
|
nptl_2_17/old_macros_2_17.h | 75 +++++++++++++++++++++++++++++++++
|
||||||
|
2 files changed, 136 insertions(+)
|
||||||
|
create mode 100644 nptl_2_17/compat_pthread_2_17.h
|
||||||
|
create mode 100644 nptl_2_17/old_macros_2_17.h
|
||||||
|
|
||||||
|
diff --git a/nptl_2_17/compat_pthread_2_17.h b/nptl_2_17/compat_pthread_2_17.h
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..d13051ba
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/compat_pthread_2_17.h
|
||||||
|
@@ -0,0 +1,61 @@
|
||||||
|
+#ifndef _COMPAT_PTHREAD_2_17_H
|
||||||
|
+#define _COMPAT_PTHREAD_2_17_H 1
|
||||||
|
+
|
||||||
|
+#include <bits/struct_rwlock.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+
|
||||||
|
+#ifdef __x86_64__
|
||||||
|
+#define __PTHREAD_COMPAT_PADDING_MID
|
||||||
|
+#define __PTHREAD_COMPAT_PADDING_END
|
||||||
|
+#define __PTHREAD_MUTEX_LOCK_ELISION 1
|
||||||
|
+# define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0
|
||||||
|
+# define __PTHREAD_MUTEX_USE_UNION 0
|
||||||
|
+//# define ENABLE_ELISION_SUPPORT 1
|
||||||
|
+#else
|
||||||
|
+#define __PTHREAD_COMPAT_PADDING_MID
|
||||||
|
+#define __PTHREAD_COMPAT_PADDING_END
|
||||||
|
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
|
||||||
|
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0
|
||||||
|
+#define __PTHREAD_MUTEX_USE_UNION 0
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#define CANCELSTATE_BIT 0
|
||||||
|
+#define CANCELSTATE_BITMASK (0x01 << CANCELSTATE_BIT)
|
||||||
|
+ /* Bit set if asynchronous cancellation mode is selected. */
|
||||||
|
+#define CANCELTYPE_BIT 1
|
||||||
|
+#define CANCELTYPE_BITMASK (0x01 << CANCELTYPE_BIT)
|
||||||
|
+ /* Bit set if canceling has been initiated. */
|
||||||
|
+#define CANCELING_BIT 2
|
||||||
|
+#define CANCELING_BITMASK (0x01 << CANCELING_BIT)
|
||||||
|
+ /* Bit set if canceled. */
|
||||||
|
+#define CANCELED_BIT 3
|
||||||
|
+#define CANCELED_BITMASK (0x01 << CANCELED_BIT)
|
||||||
|
+ /* Bit set if thread is exiting. */
|
||||||
|
+#define EXITING_BIT 4
|
||||||
|
+#define EXITING_BITMASK (0x01 << EXITING_BIT)
|
||||||
|
+ /* Bit set if thread terminated and TCB is freed. */
|
||||||
|
+#define TERMINATED_BIT 5
|
||||||
|
+#define TERMINATED_BITMASK (0x01 << TERMINATED_BIT)
|
||||||
|
+ /* Bit set if thread is supposed to change XID. */
|
||||||
|
+#define SETXID_BIT 6
|
||||||
|
+#define SETXID_BITMASK (0x01 << SETXID_BIT)
|
||||||
|
+ /* Mask for the rest. Helps the compiler to optimize. */
|
||||||
|
+#define CANCEL_RESTMASK 0xffffff80
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+#define CANCEL_ENABLED_AND_CANCELED_AND_ASYNCHRONOUS(value) \
|
||||||
|
+ (((value) & (CANCELSTATE_BITMASK | CANCELTYPE_BITMASK | CANCELED_BITMASK \
|
||||||
|
+ | EXITING_BITMASK | CANCEL_RESTMASK | TERMINATED_BITMASK)) \
|
||||||
|
+ == (CANCELTYPE_BITMASK | CANCELED_BITMASK))
|
||||||
|
+
|
||||||
|
+# define INTERNAL_SYSCALL_DECL(err) do { } while (0)
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * __pause_nocancel delete by fbb4a3143724ef3f044a4f05351,add it
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+__typeof (pause) __pause_nocancel;
|
||||||
|
+hidden_proto (__pause_nocancel)
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
diff --git a/nptl_2_17/old_macros_2_17.h b/nptl_2_17/old_macros_2_17.h
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..334b2ab1
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/old_macros_2_17.h
|
||||||
|
@@ -0,0 +1,75 @@
|
||||||
|
+#ifndef _OLD_MACROS_2_17_H
|
||||||
|
+#define _OLD_MACROS_2_17_H 1
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Contains macros that have been defined in glibc2.34.
|
||||||
|
+ * Cancel the definition and use the old version.
|
||||||
|
+ * This header file needs to be included at the end.
|
||||||
|
+ */
|
||||||
|
+#undef __lll_unlock
|
||||||
|
+#define __lll_unlock(futex, private) \
|
||||||
|
+ ((void) \
|
||||||
|
+ ({ \
|
||||||
|
+ int *__futex = (futex); \
|
||||||
|
+ int __private = (private); \
|
||||||
|
+ int __oldval = atomic_exchange_rel (__futex, 0); \
|
||||||
|
+ if (__glibc_unlikely (__oldval > 1)) \
|
||||||
|
+ lll_futex_wake (__futex, 1, __private); \
|
||||||
|
+ }))
|
||||||
|
+
|
||||||
|
+#undef lll_unlock
|
||||||
|
+#define lll_unlock(futex, private) \
|
||||||
|
+ __lll_unlock (&(futex), private)
|
||||||
|
+
|
||||||
|
+extern int __lll_timedlock_wait (int *futex, const struct timespec *,
|
||||||
|
+ int private) attribute_hidden;
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+/* As __lll_lock, but with a timeout. If the timeout occurs then return
|
||||||
|
+ ETIMEDOUT. If ABSTIME is invalid, return EINVAL. */
|
||||||
|
+#define __lll_timedlock(futex, abstime, private) \
|
||||||
|
+ ({ \
|
||||||
|
+ int *__futex = (futex); \
|
||||||
|
+ int __val = 0; \
|
||||||
|
+ \
|
||||||
|
+ if (__glibc_unlikely \
|
||||||
|
+ (atomic_compare_and_exchange_bool_acq (__futex, 1, 0))) \
|
||||||
|
+ __val = __lll_timedlock_wait (__futex, abstime, private); \
|
||||||
|
+ __val; \
|
||||||
|
+ })
|
||||||
|
+#define lll_timedlock(futex, abstime, private) \
|
||||||
|
+ __lll_timedlock (&(futex), abstime, private)
|
||||||
|
+
|
||||||
|
+/* Verify whether the supplied clockid is supported by
|
||||||
|
+ lll_futex_clock_wait_bitset. */
|
||||||
|
+#define lll_futex_supported_clockid(clockid) \
|
||||||
|
+ ((clockid) == CLOCK_REALTIME || (clockid) == CLOCK_MONOTONIC)
|
||||||
|
+
|
||||||
|
+/* The kernel currently only supports CLOCK_MONOTONIC or
|
||||||
|
+ CLOCK_REALTIME timeouts for FUTEX_WAIT_BITSET. We could attempt to
|
||||||
|
+ convert others here but currently do not. */
|
||||||
|
+#define lll_futex_clock_wait_bitset(futexp, val, clockid, timeout, private) \
|
||||||
|
+ ({ \
|
||||||
|
+ long int __ret; \
|
||||||
|
+ if (lll_futex_supported_clockid (clockid)) \
|
||||||
|
+ { \
|
||||||
|
+ const unsigned int clockbit = \
|
||||||
|
+ (clockid == CLOCK_REALTIME) ? FUTEX_CLOCK_REALTIME : 0; \
|
||||||
|
+ const int op = \
|
||||||
|
+ __lll_private_flag (FUTEX_WAIT_BITSET | clockbit, private); \
|
||||||
|
+ \
|
||||||
|
+ __ret = lll_futex_syscall (6, futexp, op, val, \
|
||||||
|
+ timeout, NULL /* Unused. */, \
|
||||||
|
+ FUTEX_BITSET_MATCH_ANY); \
|
||||||
|
+ } \
|
||||||
|
+ else \
|
||||||
|
+ __ret = -EINVAL; \
|
||||||
|
+ __ret; \
|
||||||
|
+ })
|
||||||
|
+
|
||||||
|
+# undef INTERNAL_VSYSCALL
|
||||||
|
+# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
|
||||||
|
+# undef INLINE_VSYSCALL
|
||||||
|
+# define INLINE_VSYSCALL INLINE_SYSCALL
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
140
0005-add-pthread-functions_h.patch
Normal file
140
0005-add-pthread-functions_h.patch
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
From 463dc947b4f9bc4137c9919ee72b896403926474 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Roland McGrath <roland@hack.frob.com>
|
||||||
|
Date: Thu Jun 12 13:48:47 2014 -0700
|
||||||
|
Subject: [PATCH 5/9] build extra lipthreadcond so
|
||||||
|
|
||||||
|
add pthread-functions.h which delete by 1d67cf9e8a0194588e66fb3b7afcbdc3bf836a
|
||||||
|
|
||||||
|
---
|
||||||
|
nptl_2_17/pthread-functions_2_17.h | 119 +++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 119 insertions(+)
|
||||||
|
create mode 100644 nptl_2_17/pthread-functions_2_17.h
|
||||||
|
|
||||||
|
diff --git a/nptl_2_17/pthread-functions_2_17.h b/nptl_2_17/pthread-functions_2_17.h
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..07ca8e7e
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/pthread-functions_2_17.h
|
||||||
|
@@ -0,0 +1,119 @@
|
||||||
|
+/* Copyright (C) 2003-2018 Free Software Foundation, Inc.
|
||||||
|
+ This file is part of the GNU C Library.
|
||||||
|
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
|
||||||
|
+
|
||||||
|
+ 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
|
||||||
|
+ <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+#ifndef _PTHREAD_FUNCTIONS_H
|
||||||
|
+#define _PTHREAD_FUNCTIONS_H 1
|
||||||
|
+
|
||||||
|
+#include <pthread.h>
|
||||||
|
+#include <setjmp.h>
|
||||||
|
+#include <internaltypes.h>
|
||||||
|
+#include <sysdep.h>
|
||||||
|
+
|
||||||
|
+struct xid_command;
|
||||||
|
+
|
||||||
|
+/* Data type shared with libc. The libc uses it to pass on calls to
|
||||||
|
+ the thread functions. */
|
||||||
|
+struct pthread_functions
|
||||||
|
+{
|
||||||
|
+ int (*ptr_pthread_attr_destroy) (pthread_attr_t *);
|
||||||
|
+ int (*ptr___pthread_attr_init_2_0) (pthread_attr_t *);
|
||||||
|
+ int (*ptr___pthread_attr_init_2_1) (pthread_attr_t *);
|
||||||
|
+ int (*ptr_pthread_attr_getdetachstate) (const pthread_attr_t *, int *);
|
||||||
|
+ int (*ptr_pthread_attr_setdetachstate) (pthread_attr_t *, int);
|
||||||
|
+ int (*ptr_pthread_attr_getinheritsched) (const pthread_attr_t *, int *);
|
||||||
|
+ int (*ptr_pthread_attr_setinheritsched) (pthread_attr_t *, int);
|
||||||
|
+ int (*ptr_pthread_attr_getschedparam) (const pthread_attr_t *,
|
||||||
|
+ struct sched_param *);
|
||||||
|
+ int (*ptr_pthread_attr_setschedparam) (pthread_attr_t *,
|
||||||
|
+ const struct sched_param *);
|
||||||
|
+ int (*ptr_pthread_attr_getschedpolicy) (const pthread_attr_t *, int *);
|
||||||
|
+ int (*ptr_pthread_attr_setschedpolicy) (pthread_attr_t *, int);
|
||||||
|
+ int (*ptr_pthread_attr_getscope) (const pthread_attr_t *, int *);
|
||||||
|
+ int (*ptr_pthread_attr_setscope) (pthread_attr_t *, int);
|
||||||
|
+ int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *);
|
||||||
|
+ int (*ptr_pthread_condattr_init) (pthread_condattr_t *);
|
||||||
|
+ int (*ptr___pthread_cond_broadcast) (pthread_cond_t *);
|
||||||
|
+ int (*ptr___pthread_cond_destroy) (pthread_cond_t *);
|
||||||
|
+ int (*ptr___pthread_cond_init) (pthread_cond_t *,
|
||||||
|
+ const pthread_condattr_t *);
|
||||||
|
+ int (*ptr___pthread_cond_signal) (pthread_cond_t *);
|
||||||
|
+ int (*ptr___pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *);
|
||||||
|
+ int (*ptr___pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *,
|
||||||
|
+ const struct timespec *);
|
||||||
|
+ int (*ptr___pthread_cond_clockwait) (pthread_cond_t *,
|
||||||
|
+ pthread_mutex_t *,
|
||||||
|
+ clockid_t,
|
||||||
|
+ const struct timespec *);
|
||||||
|
+ int (*ptr___pthread_cond_broadcast_2_0) (pthread_cond_2_0_t *);
|
||||||
|
+ int (*ptr___pthread_cond_destroy_2_0) (pthread_cond_2_0_t *);
|
||||||
|
+ int (*ptr___pthread_cond_init_2_0) (pthread_cond_2_0_t *,
|
||||||
|
+ const pthread_condattr_t *);
|
||||||
|
+ int (*ptr___pthread_cond_signal_2_0) (pthread_cond_2_0_t *);
|
||||||
|
+ int (*ptr___pthread_cond_wait_2_0) (pthread_cond_2_0_t *, pthread_mutex_t *);
|
||||||
|
+ int (*ptr___pthread_cond_timedwait_2_0) (pthread_cond_2_0_t *,
|
||||||
|
+ pthread_mutex_t *,
|
||||||
|
+ const struct timespec *);
|
||||||
|
+ int (*ptr_pthread_equal) (pthread_t, pthread_t);
|
||||||
|
+ void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__));
|
||||||
|
+ int (*ptr_pthread_getschedparam) (pthread_t, int *, struct sched_param *);
|
||||||
|
+ int (*ptr_pthread_setschedparam) (pthread_t, int,
|
||||||
|
+ const struct sched_param *);
|
||||||
|
+ int (*ptr_pthread_mutex_destroy) (pthread_mutex_t *);
|
||||||
|
+ int (*ptr_pthread_mutex_init) (pthread_mutex_t *,
|
||||||
|
+ const pthread_mutexattr_t *);
|
||||||
|
+ int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
|
||||||
|
+ int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
|
||||||
|
+ int (*ptr___pthread_setcancelstate) (int, int *);
|
||||||
|
+ int (*ptr_pthread_setcanceltype) (int, int *);
|
||||||
|
+ void (*ptr___pthread_cleanup_upto) (__jmp_buf, char *);
|
||||||
|
+ int (*ptr___pthread_once) (pthread_once_t *, void (*) (void));
|
||||||
|
+ int (*ptr___pthread_rwlock_rdlock) (pthread_rwlock_t *);
|
||||||
|
+ int (*ptr___pthread_rwlock_wrlock) (pthread_rwlock_t *);
|
||||||
|
+ int (*ptr___pthread_rwlock_unlock) (pthread_rwlock_t *);
|
||||||
|
+ int (*ptr___pthread_key_create) (pthread_key_t *, void (*) (void *));
|
||||||
|
+ void *(*ptr___pthread_getspecific) (pthread_key_t);
|
||||||
|
+ int (*ptr___pthread_setspecific) (pthread_key_t, const void *);
|
||||||
|
+ void (*ptr__pthread_cleanup_push_defer) (struct _pthread_cleanup_buffer *,
|
||||||
|
+ void (*) (void *), void *);
|
||||||
|
+ void (*ptr__pthread_cleanup_pop_restore) (struct _pthread_cleanup_buffer *,
|
||||||
|
+ int);
|
||||||
|
+#define HAVE_PTR_NTHREADS
|
||||||
|
+ unsigned int *ptr_nthreads;
|
||||||
|
+ void (*ptr___pthread_unwind) (__pthread_unwind_buf_t *)
|
||||||
|
+ __attribute ((noreturn)) __cleanup_fct_attribute;
|
||||||
|
+ void (*ptr__nptl_deallocate_tsd) (void);
|
||||||
|
+ int (*ptr__nptl_setxid) (struct xid_command *);
|
||||||
|
+ void (*ptr_set_robust) (struct pthread *);
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+/* Variable in libc.so. */
|
||||||
|
+extern struct pthread_functions __libc_pthread_functions attribute_hidden;
|
||||||
|
+extern int __libc_pthread_functions_init attribute_hidden;
|
||||||
|
+
|
||||||
|
+#ifdef PTR_DEMANGLE
|
||||||
|
+# define PTHFCT_CALL(fct, params) \
|
||||||
|
+ ({ __typeof (__libc_pthread_functions.fct) __p; \
|
||||||
|
+ __p = __libc_pthread_functions.fct; \
|
||||||
|
+ PTR_DEMANGLE (__p); \
|
||||||
|
+ __p params; })
|
||||||
|
+#else
|
||||||
|
+# define PTHFCT_CALL(fct, params) \
|
||||||
|
+ __libc_pthread_functions.fct params
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#endif /* pthread-functions.h */
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
587
0006-add-elsion-function-which-moved-to-libc-in-glibc-2.34.patch
Normal file
587
0006-add-elsion-function-which-moved-to-libc-in-glibc-2.34.patch
Normal file
@ -0,0 +1,587 @@
|
|||||||
|
From 1cdbe579482c07e9f4bb3baa4864da2d3e7eb837 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andi Kleen <ak@linux.intel.com>
|
||||||
|
Date: Sat, 10 Nov 2012 00:51:26 -0800i
|
||||||
|
Subject: [PATCH 6/9] build extra lipthreadcond so
|
||||||
|
|
||||||
|
add elsion functions which moved to libc in glibc-2.34.
|
||||||
|
Some attributes are changed and cannot be directly referenced.
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
nptl_2_17/lll_timedlock_wait_2_17.c | 59 +++++++++++++++++++++++++++++
|
||||||
|
nptl_2_17/elision-conf_2_17.c | 138 +++++++++++++++++++++++++++++++
|
||||||
|
nptl_2_17/elision-lock_2_17.c | 107 ++++++++++++++++++++++++
|
||||||
|
nptl_2_17/elision-timed_2_17.c | 27 ++++++
|
||||||
|
nptl_2_17/elision-trylock_2_17.c | 75 +++++++++++++++++
|
||||||
|
nptl_2_17/elision-unlock_2_17.c | 34 ++++++++
|
||||||
|
nptl_2_17/hle_2_17.h | 75 +++++++++++++++++
|
||||||
|
6 files changed, 515
|
||||||
|
insertions(+)
|
||||||
|
create mode 100644 nptl_2_17/lll_timedlock_wait_2_17.c
|
||||||
|
create mode 100644 nptl_2_17/elision-conf_2_17.c
|
||||||
|
create mode 100644 nptl_2_17/elision-lock_2_17.c
|
||||||
|
create mode 100644 nptl_2_17/elision-timed_2_17.c
|
||||||
|
create mode 100644 nptl_2_17/elision-trylock_2_17.c
|
||||||
|
create mode 100644 nptl_2_17/elision-unlock_2_17.c
|
||||||
|
create mode 100644 nptl_2_17/hle_2_17.h
|
||||||
|
|
||||||
|
diff --git a/nptl_2_17/lll_timedlock_wait_2_17.c b/nptl_2_17/lll_timedlock_wait_2_17.c
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..91bf9637
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/lll_timedlock_wait_2_17.c
|
||||||
|
@@ -0,0 +1,59 @@
|
||||||
|
+/* Timed low level locking for pthread library. Generic futex-using version.
|
||||||
|
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
|
||||||
|
+ This file is part of the GNU C Library.
|
||||||
|
+ Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
|
||||||
|
+
|
||||||
|
+ 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
|
||||||
|
+ <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+#include <atomic.h>
|
||||||
|
+#include <errno.h>
|
||||||
|
+#include <lowlevellock.h>
|
||||||
|
+#include <sys/time.h>
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+__lll_timedlock_wait (int *futex, const struct timespec *abstime, int private)
|
||||||
|
+{
|
||||||
|
+ /* Reject invalid timeouts. */
|
||||||
|
+ if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
|
||||||
|
+ return EINVAL;
|
||||||
|
+
|
||||||
|
+ /* Try locking. */
|
||||||
|
+ while (atomic_exchange_acq (futex, 2) != 0)
|
||||||
|
+ {
|
||||||
|
+ struct timeval tv;
|
||||||
|
+
|
||||||
|
+ /* Get the current time. */
|
||||||
|
+ (void) __gettimeofday (&tv, NULL);
|
||||||
|
+
|
||||||
|
+ /* Compute relative timeout. */
|
||||||
|
+ struct timespec rt;
|
||||||
|
+ rt.tv_sec = abstime->tv_sec - tv.tv_sec;
|
||||||
|
+ rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
|
||||||
|
+ if (rt.tv_nsec < 0)
|
||||||
|
+ {
|
||||||
|
+ rt.tv_nsec += 1000000000;
|
||||||
|
+ --rt.tv_sec;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (rt.tv_sec < 0)
|
||||||
|
+ return ETIMEDOUT;
|
||||||
|
+
|
||||||
|
+ /* If *futex == 2, wait until woken or timeout. */
|
||||||
|
+ lll_futex_timed_wait (futex, 2, &rt, private);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
diff --git a/nptl_2_17/elision-conf_2_17.c b/nptl_2_17/elision-conf_2_17.c
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..22af2944
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/elision-conf_2_17.c
|
||||||
|
@@ -0,0 +1,138 @@
|
||||||
|
+/* elision-conf.c: Lock elision tunable parameters.
|
||||||
|
+ Copyright (C) 2013-2018 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
|
||||||
|
+ <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+#include "config.h"
|
||||||
|
+#include <pthreadP.h>
|
||||||
|
+#include <init-arch.h>
|
||||||
|
+#include <elision-conf.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+
|
||||||
|
+#if HAVE_TUNABLES
|
||||||
|
+# define TUNABLE_NAMESPACE elision
|
||||||
|
+#endif
|
||||||
|
+#include <elf/dl-tunables.h>
|
||||||
|
+
|
||||||
|
+/* Reasonable initial tuning values, may be revised in the future.
|
||||||
|
+ This is a conservative initial value. */
|
||||||
|
+
|
||||||
|
+struct elision_config __elision_aconf =
|
||||||
|
+ {
|
||||||
|
+ /* How often to not attempt to use elision if a transaction aborted
|
||||||
|
+ because the lock is already acquired. Expressed in number of lock
|
||||||
|
+ acquisition attempts. */
|
||||||
|
+ .skip_lock_busy = 3,
|
||||||
|
+ /* How often to not attempt to use elision if a transaction aborted due
|
||||||
|
+ to reasons other than other threads' memory accesses. Expressed in
|
||||||
|
+ number of lock acquisition attempts. */
|
||||||
|
+ .skip_lock_internal_abort = 3,
|
||||||
|
+ /* How often we retry using elision if there is chance for the transaction
|
||||||
|
+ to finish execution (e.g., it wasn't aborted due to the lock being
|
||||||
|
+ already acquired. */
|
||||||
|
+ .retry_try_xbegin = 3,
|
||||||
|
+ /* Same as SKIP_LOCK_INTERNAL_ABORT but for trylock. */
|
||||||
|
+ .skip_trylock_internal_abort = 3,
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+/* Force elision for all new locks. This is used to decide whether existing
|
||||||
|
+ DEFAULT locks should be automatically upgraded to elision in
|
||||||
|
+ pthread_mutex_lock(). Disabled for suid programs. Only used when elision
|
||||||
|
+ is available. */
|
||||||
|
+
|
||||||
|
+int __pthread_force_elision attribute_hidden = 0;
|
||||||
|
+
|
||||||
|
+#if HAVE_TUNABLES
|
||||||
|
+static inline void
|
||||||
|
+__always_inline
|
||||||
|
+do_set_elision_enable (int32_t elision_enable)
|
||||||
|
+{
|
||||||
|
+ /* Enable elision if it's avaliable in hardware. It's not necessary to check
|
||||||
|
+ if __libc_enable_secure isn't enabled since elision_enable will be set
|
||||||
|
+ according to the default, which is disabled. */
|
||||||
|
+ if (elision_enable == 1)
|
||||||
|
+ __pthread_force_elision = HAS_CPU_FEATURE (RTM) ? 1 : 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* The pthread->elision_enable tunable is 0 or 1 indicating that elision
|
||||||
|
+ should be disabled or enabled respectively. The feature will only be used
|
||||||
|
+ if it's supported by the hardware. */
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+TUNABLE_CALLBACK (set_elision_enable) (tunable_val_t *valp)
|
||||||
|
+{
|
||||||
|
+ int32_t elision_enable = (int32_t) valp->numval;
|
||||||
|
+ do_set_elision_enable (elision_enable);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#define TUNABLE_CALLBACK_FNDECL(__name, __type) \
|
||||||
|
+static inline void \
|
||||||
|
+__always_inline \
|
||||||
|
+do_set_elision_ ## __name (__type value) \
|
||||||
|
+{ \
|
||||||
|
+ __elision_aconf.__name = value; \
|
||||||
|
+} \
|
||||||
|
+void \
|
||||||
|
+TUNABLE_CALLBACK (set_elision_ ## __name) (tunable_val_t *valp) \
|
||||||
|
+{ \
|
||||||
|
+ __type value = (__type) (valp)->numval; \
|
||||||
|
+ do_set_elision_ ## __name (value); \
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+TUNABLE_CALLBACK_FNDECL (skip_lock_busy, int32_t);
|
||||||
|
+TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
|
||||||
|
+TUNABLE_CALLBACK_FNDECL (retry_try_xbegin, int32_t);
|
||||||
|
+TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+/* Initialize elision. */
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+elision_init (int argc __attribute__ ((unused)),
|
||||||
|
+ char **argv __attribute__ ((unused)),
|
||||||
|
+ char **environ)
|
||||||
|
+{
|
||||||
|
+#if HAVE_TUNABLES
|
||||||
|
+ /* Elision depends on tunables and must be explicitly turned on by setting
|
||||||
|
+ the appropriate tunable on a supported platform. */
|
||||||
|
+
|
||||||
|
+ TUNABLE_GET (enable, int32_t,
|
||||||
|
+ TUNABLE_CALLBACK (set_elision_enable));
|
||||||
|
+ TUNABLE_GET (skip_lock_busy, int32_t,
|
||||||
|
+ TUNABLE_CALLBACK (set_elision_skip_lock_busy));
|
||||||
|
+ TUNABLE_GET (skip_lock_internal_abort, int32_t,
|
||||||
|
+ TUNABLE_CALLBACK (set_elision_skip_lock_internal_abort));
|
||||||
|
+ TUNABLE_GET (tries, int32_t,
|
||||||
|
+ TUNABLE_CALLBACK (set_elision_retry_try_xbegin));
|
||||||
|
+ TUNABLE_GET (skip_trylock_internal_abort, int32_t,
|
||||||
|
+ TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+ if (!__pthread_force_elision)
|
||||||
|
+ __elision_aconf.retry_try_xbegin = 0; /* Disable elision on rwlocks. */
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#ifdef SHARED
|
||||||
|
+# define INIT_SECTION ".init_array"
|
||||||
|
+#else
|
||||||
|
+# define INIT_SECTION ".preinit_array"
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+void (*const __pthread_init_array []) (int, char **, char **)
|
||||||
|
+ __attribute__ ((section (INIT_SECTION), aligned (sizeof (void *)))) =
|
||||||
|
+{
|
||||||
|
+ &elision_init
|
||||||
|
+};
|
||||||
|
diff --git a/nptl_2_17/elision-lock_2_17.c b/nptl_2_17/elision-lock_2_17.c
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..e6dbbc21
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/elision-lock_2_17.c
|
||||||
|
@@ -0,0 +1,107 @@
|
||||||
|
+/* elision-lock.c: Elided pthread mutex lock.
|
||||||
|
+ Copyright (C) 2011-2018 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
|
||||||
|
+ <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+#include <pthread_2_17.h>
|
||||||
|
+#include "pthreadP_2_17.h"
|
||||||
|
+#include "lowlevellock.h"
|
||||||
|
+#include "hle_2_17.h"
|
||||||
|
+#include <elision-conf.h>
|
||||||
|
+
|
||||||
|
+#if !defined(LLL_LOCK) && !defined(EXTRAARG)
|
||||||
|
+/* Make sure the configuration code is always linked in for static
|
||||||
|
+ libraries. */
|
||||||
|
+#include "elision-conf_2_17.c"
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#ifndef EXTRAARG
|
||||||
|
+#define EXTRAARG
|
||||||
|
+#endif
|
||||||
|
+#ifndef LLL_LOCK
|
||||||
|
+#define LLL_LOCK(a,b) lll_lock(a,b), 0
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#define aconf __elision_aconf
|
||||||
|
+
|
||||||
|
+/* Adaptive lock using transactions.
|
||||||
|
+ By default the lock region is run as a transaction, and when it
|
||||||
|
+ aborts or the lock is busy the lock adapts itself. */
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+__lll_lock_elision (int *futex, short *adapt_count, EXTRAARG int private)
|
||||||
|
+{
|
||||||
|
+ /* adapt_count can be accessed concurrently; these accesses can be both
|
||||||
|
+ inside of transactions (if critical sections are nested and the outer
|
||||||
|
+ critical section uses lock elision) and outside of transactions. Thus,
|
||||||
|
+ we need to use atomic accesses to avoid data races. However, the
|
||||||
|
+ value of adapt_count is just a hint, so relaxed MO accesses are
|
||||||
|
+ sufficient. */
|
||||||
|
+ if (atomic_load_relaxed (adapt_count) <= 0)
|
||||||
|
+ {
|
||||||
|
+ unsigned status;
|
||||||
|
+ int try_xbegin;
|
||||||
|
+
|
||||||
|
+ for (try_xbegin = aconf.retry_try_xbegin;
|
||||||
|
+ try_xbegin > 0;
|
||||||
|
+ try_xbegin--)
|
||||||
|
+ {
|
||||||
|
+ if ((status = _xbegin()) == _XBEGIN_STARTED)
|
||||||
|
+ {
|
||||||
|
+ if (*futex == 0)
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+ /* Lock was busy. Fall back to normal locking.
|
||||||
|
+ Could also _xend here but xabort with 0xff code
|
||||||
|
+ is more visible in the profiler. */
|
||||||
|
+ _xabort (_ABORT_LOCK_BUSY);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!(status & _XABORT_RETRY))
|
||||||
|
+ {
|
||||||
|
+ if ((status & _XABORT_EXPLICIT)
|
||||||
|
+ && _XABORT_CODE (status) == _ABORT_LOCK_BUSY)
|
||||||
|
+ {
|
||||||
|
+ /* Right now we skip here. Better would be to wait a bit
|
||||||
|
+ and retry. This likely needs some spinning. See
|
||||||
|
+ above for why relaxed MO is sufficient. */
|
||||||
|
+ if (atomic_load_relaxed (adapt_count)
|
||||||
|
+ != aconf.skip_lock_busy)
|
||||||
|
+ atomic_store_relaxed (adapt_count, aconf.skip_lock_busy);
|
||||||
|
+ }
|
||||||
|
+ /* Internal abort. There is no chance for retry.
|
||||||
|
+ Use the normal locking and next time use lock.
|
||||||
|
+ Be careful to avoid writing to the lock. See above for why
|
||||||
|
+ relaxed MO is sufficient. */
|
||||||
|
+ else if (atomic_load_relaxed (adapt_count)
|
||||||
|
+ != aconf.skip_lock_internal_abort)
|
||||||
|
+ atomic_store_relaxed (adapt_count,
|
||||||
|
+ aconf.skip_lock_internal_abort);
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ /* Use a normal lock until the threshold counter runs out.
|
||||||
|
+ Lost updates possible. */
|
||||||
|
+ atomic_store_relaxed (adapt_count,
|
||||||
|
+ atomic_load_relaxed (adapt_count) - 1);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* Use a normal lock here. */
|
||||||
|
+ return LLL_LOCK ((*futex), private);
|
||||||
|
+}
|
||||||
|
diff --git a/nptl_2_17/elision-timed_2_17.c b/nptl_2_17/elision-timed_2_17.c
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..5050f2d1
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/elision-timed_2_17.c
|
||||||
|
@@ -0,0 +1,27 @@
|
||||||
|
+/* elision-timed.c: Lock elision timed lock.
|
||||||
|
+ Copyright (C) 2013-2018 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
|
||||||
|
+ <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+#include <time.h>
|
||||||
|
+#include <elision-conf.h>
|
||||||
|
+#include "lowlevellock.h"
|
||||||
|
+#include <old_macros_2_17.h>
|
||||||
|
+#define __lll_lock_elision __lll_timedlock_elision
|
||||||
|
+#define EXTRAARG const struct timespec *t,
|
||||||
|
+#undef LLL_LOCK
|
||||||
|
+#define LLL_LOCK(a, b) lll_timedlock(a, t, b)
|
||||||
|
+#include "elision-lock_2_17.c"
|
||||||
|
diff --git a/nptl_2_17/elision-trylock_2_17.c b/nptl_2_17/elision-trylock_2_17.c
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..70d8f8b9
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/elision-trylock_2_17.c
|
||||||
|
@@ -0,0 +1,75 @@
|
||||||
|
+/* elision-trylock.c: Lock eliding trylock for pthreads.
|
||||||
|
+ Copyright (C) 2013-2018 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
|
||||||
|
+ <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+#include <pthread_2_17.h>
|
||||||
|
+
|
||||||
|
+#include <lowlevellock.h>
|
||||||
|
+#include "hle_2_17.h"
|
||||||
|
+#include <elision-conf.h>
|
||||||
|
+
|
||||||
|
+#define aconf __elision_aconf
|
||||||
|
+
|
||||||
|
+/* Try to elide a futex trylock. FUTEX is the futex variable. ADAPT_COUNT is
|
||||||
|
+ the adaptation counter in the mutex. */
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+__lll_trylock_elision (int *futex, short *adapt_count)
|
||||||
|
+{
|
||||||
|
+ /* Implement POSIX semantics by forbiding nesting
|
||||||
|
+ trylock. Sorry. After the abort the code is re-executed
|
||||||
|
+ non transactional and if the lock was already locked
|
||||||
|
+ return an error. */
|
||||||
|
+ _xabort (_ABORT_NESTED_TRYLOCK);
|
||||||
|
+
|
||||||
|
+ /* Only try a transaction if it's worth it. See __lll_lock_elision for
|
||||||
|
+ why we need atomic accesses. Relaxed MO is sufficient because this is
|
||||||
|
+ just a hint. */
|
||||||
|
+ if (atomic_load_relaxed (adapt_count) <= 0)
|
||||||
|
+ {
|
||||||
|
+ unsigned status;
|
||||||
|
+
|
||||||
|
+ if ((status = _xbegin()) == _XBEGIN_STARTED)
|
||||||
|
+ {
|
||||||
|
+ if (*futex == 0)
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+ /* Lock was busy. Fall back to normal locking.
|
||||||
|
+ Could also _xend here but xabort with 0xff code
|
||||||
|
+ is more visible in the profiler. */
|
||||||
|
+ _xabort (_ABORT_LOCK_BUSY);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!(status & _XABORT_RETRY))
|
||||||
|
+ {
|
||||||
|
+ /* Internal abort. No chance for retry. For future
|
||||||
|
+ locks don't try speculation for some time. See above for MO. */
|
||||||
|
+ if (atomic_load_relaxed (adapt_count)
|
||||||
|
+ != aconf.skip_lock_internal_abort)
|
||||||
|
+ atomic_store_relaxed (adapt_count, aconf.skip_lock_internal_abort);
|
||||||
|
+ }
|
||||||
|
+ /* Could do some retries here. */
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ /* Lost updates are possible but harmless (see above). */
|
||||||
|
+ atomic_store_relaxed (adapt_count,
|
||||||
|
+ atomic_load_relaxed (adapt_count) - 1);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return lll_trylock (*futex);
|
||||||
|
+}
|
||||||
|
diff --git a/nptl_2_17/elision-unlock_2_17.c b/nptl_2_17/elision-unlock_2_17.c
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..b5d38c5f
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/elision-unlock_2_17.c
|
||||||
|
@@ -0,0 +1,34 @@
|
||||||
|
+/* elision-unlock.c: Commit an elided pthread lock.
|
||||||
|
+ Copyright (C) 2013-2018 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
|
||||||
|
+ <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+#include "pthreadP_2_17.h"
|
||||||
|
+#include "lowlevellock.h"
|
||||||
|
+#include "hle_2_17.h"
|
||||||
|
+#include <old_macros_2_17.h>
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+__lll_unlock_elision(int *lock, int private)
|
||||||
|
+{
|
||||||
|
+ /* When the lock was free we're in a transaction.
|
||||||
|
+ When you crash here you unlocked a free lock. */
|
||||||
|
+ if (*lock == 0)
|
||||||
|
+ _xend();
|
||||||
|
+ else
|
||||||
|
+ lll_unlock ((*lock), private);
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
diff --git a/nptl_2_17/hle_2_17.h b/nptl_2_17/hle_2_17.h
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..4a7b9e3b
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/hle_2_17.h
|
||||||
|
@@ -0,0 +1,75 @@
|
||||||
|
+/* Shared RTM header. Emulate TSX intrinsics for compilers and assemblers
|
||||||
|
+ that do not support the intrinsics and instructions yet. */
|
||||||
|
+#ifndef _HLE_H
|
||||||
|
+#define _HLE_H 1
|
||||||
|
+
|
||||||
|
+#ifdef __ASSEMBLER__
|
||||||
|
+
|
||||||
|
+.macro XBEGIN target
|
||||||
|
+ .byte 0xc7,0xf8
|
||||||
|
+ .long \target-1f
|
||||||
|
+1:
|
||||||
|
+.endm
|
||||||
|
+
|
||||||
|
+.macro XEND
|
||||||
|
+ .byte 0x0f,0x01,0xd5
|
||||||
|
+.endm
|
||||||
|
+
|
||||||
|
+.macro XABORT code
|
||||||
|
+ .byte 0xc6,0xf8,\code
|
||||||
|
+.endm
|
||||||
|
+
|
||||||
|
+.macro XTEST
|
||||||
|
+ .byte 0x0f,0x01,0xd6
|
||||||
|
+.endm
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+/* Official RTM intrinsics interface matching gcc/icc, but works
|
||||||
|
+ on older gcc compatible compilers and binutils.
|
||||||
|
+ We should somehow detect if the compiler supports it, because
|
||||||
|
+ it may be able to generate slightly better code. */
|
||||||
|
+
|
||||||
|
+#define _XBEGIN_STARTED (~0u)
|
||||||
|
+#define _XABORT_EXPLICIT (1 << 0)
|
||||||
|
+#define _XABORT_RETRY (1 << 1)
|
||||||
|
+#define _XABORT_CONFLICT (1 << 2)
|
||||||
|
+#define _XABORT_CAPACITY (1 << 3)
|
||||||
|
+#define _XABORT_DEBUG (1 << 4)
|
||||||
|
+#define _XABORT_NESTED (1 << 5)
|
||||||
|
+#define _XABORT_CODE(x) (((x) >> 24) & 0xff)
|
||||||
|
+
|
||||||
|
+#define _ABORT_LOCK_BUSY 0xff
|
||||||
|
+#define _ABORT_LOCK_IS_LOCKED 0xfe
|
||||||
|
+#define _ABORT_NESTED_TRYLOCK 0xfd
|
||||||
|
+
|
||||||
|
+#ifndef __ASSEMBLER__
|
||||||
|
+
|
||||||
|
+#define __force_inline __attribute__((__always_inline__)) inline
|
||||||
|
+
|
||||||
|
+static __force_inline int _xbegin(void)
|
||||||
|
+{
|
||||||
|
+ int ret = _XBEGIN_STARTED;
|
||||||
|
+ asm volatile (".byte 0xc7,0xf8 ; .long 0" : "+a" (ret) :: "memory");
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static __force_inline void _xend(void)
|
||||||
|
+{
|
||||||
|
+ asm volatile (".byte 0x0f,0x01,0xd5" ::: "memory");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static __force_inline void _xabort(const unsigned int status)
|
||||||
|
+{
|
||||||
|
+ asm volatile (".byte 0xc6,0xf8,%P0" :: "i" (status) : "memory");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static __force_inline int _xtest(void)
|
||||||
|
+{
|
||||||
|
+ unsigned char out;
|
||||||
|
+ asm volatile (".byte 0x0f,0x01,0xd6 ; setnz %0" : "=r" (out) :: "memory");
|
||||||
|
+ return out;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
+#endif
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
68
0007-add-lowlevellock_2_17_c.patch
Normal file
68
0007-add-lowlevellock_2_17_c.patch
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
From 3df6f22e5fde470a6e0242e582e58919493bdd54 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Roland McGrath <roland@hack.frob.com>
|
||||||
|
Date: Tue, 15 Jul 2014 15:23:06 -0700
|
||||||
|
Subject: [PATCH 7/9] build extra lipthreadcond so
|
||||||
|
|
||||||
|
since 78fe624d44b8f6489b2d0de9bfdc09290a719a7, lowlevellock.c depends futex-internal.h which uses the private symbol __GI___libc_fatal of glibc.
|
||||||
|
We can't reference it in libpthread-2.17.so. Therefore, recompile in libphtread-2.17.so
|
||||||
|
|
||||||
|
---
|
||||||
|
nptl_2_17/lowlevellock_2_17.c | 46 ++++++++++++++++++++++
|
||||||
|
2 files changed, 46 insertions(+)
|
||||||
|
create mode 100644 nptl_2_17/lowlevellock_2_17.c
|
||||||
|
|
||||||
|
diff --git a/nptl_2_17/lowlevellock_2_17.c b/nptl_2_17/lowlevellock_2_17.c
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..bf1ca6b9
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/lowlevellock_2_17.c
|
||||||
|
@@ -0,0 +1,46 @@
|
||||||
|
+/* low level locking for pthread library. Generic futex-using version.
|
||||||
|
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
|
||||||
|
+ This file is part of the GNU C Library.
|
||||||
|
+ Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
|
||||||
|
+
|
||||||
|
+ 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
|
||||||
|
+ <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+#include <errno.h>
|
||||||
|
+#include <sysdep.h>
|
||||||
|
+#include <lowlevellock.h>
|
||||||
|
+#include <sys/time.h>
|
||||||
|
+#include <atomic.h>
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+__lll_lock_wait_private (int *futex)
|
||||||
|
+{
|
||||||
|
+ if (*futex == 2)
|
||||||
|
+ lll_futex_wait (futex, 2, LLL_PRIVATE); /* Wait if *futex == 2. */
|
||||||
|
+
|
||||||
|
+ while (atomic_exchange_acq (futex, 2) != 0)
|
||||||
|
+ lll_futex_wait (futex, 2, LLL_PRIVATE); /* Wait if *futex == 2. */
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+/* This function doesn't get included in libc. */
|
||||||
|
+void
|
||||||
|
+__lll_lock_wait (int *futex, int private)
|
||||||
|
+{
|
||||||
|
+ if (*futex == 2)
|
||||||
|
+ lll_futex_wait (futex, 2, private); /* Wait if *futex == 2. */
|
||||||
|
+
|
||||||
|
+ while (atomic_exchange_acq (futex, 2) != 0)
|
||||||
|
+ lll_futex_wait (futex, 2, private); /* Wait if *futex == 2. */
|
||||||
|
+}
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
56
0008-add-pause_nocancel_2_17.patch
Normal file
56
0008-add-pause_nocancel_2_17.patch
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
From 329ea513b451ae8322aa7a24ed84da13992af2dd Mon Sep 17 00:00:00 2001
|
||||||
|
From: Zack Weinberg <zackw@panix.com>
|
||||||
|
Date: Tue, 3 Apr 2018 18:26:44 -0400
|
||||||
|
Subject: [PATCH 8/9] build extra lipthreadcond so
|
||||||
|
|
||||||
|
since bb4a3143724ef3f044a4f05351fe041300ee382, Remove pause and nanosleep not cancel wrappers
|
||||||
|
To build libtphread-2.17.so, we added it back.
|
||||||
|
|
||||||
|
---
|
||||||
|
nptl_2_17/pause_nocancel_2_17.c | 34 +++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 34 insertions(+)
|
||||||
|
create mode 100644 nptl_2_17/pause_nocancel_2_17.c
|
||||||
|
|
||||||
|
diff --git a/nptl_2_17/pause_nocancel_2_17.c b/nptl_2_17/pause_nocancel_2_17.c
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..ab8e78d2
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/pause_nocancel_2_17.c
|
||||||
|
@@ -0,0 +1,34 @@
|
||||||
|
+/* Linux pause syscall implementation -- non-cancellable.
|
||||||
|
+ Copyright (C) 2018 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
|
||||||
|
+ <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+#include <compat_pthread_2_17.h>
|
||||||
|
+#include <signal.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#include <sysdep-cancel.h>
|
||||||
|
+#include <not-cancel.h>
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+__pause_nocancel (void)
|
||||||
|
+{
|
||||||
|
+#ifdef __NR_pause
|
||||||
|
+ return INLINE_SYSCALL_CALL (pause);
|
||||||
|
+#else
|
||||||
|
+ return INLINE_SYSCALL_CALL (ppoll, NULL, 0, NULL, NULL);
|
||||||
|
+#endif
|
||||||
|
+}
|
||||||
|
+hidden_def (__pause_nocancel)
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
161
0009-add-unwind-with-longjmp.patch
Normal file
161
0009-add-unwind-with-longjmp.patch
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
From 09d65ff393e9183eecba1e5cb877e95dbdd3d4a4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ulrich Drepper <drepper@redhat.com>
|
||||||
|
Date: Sat, 12 Apr 2003 00:58:26 +0000
|
||||||
|
Subject: [PATCH 9/9] build extra lipthreadcond so
|
||||||
|
|
||||||
|
since 6253bacdc00de132dec452ff7c6ce3ba7fa23d81, __libc_longjmp became a
|
||||||
|
private interface.We can't quote directly.
|
||||||
|
Change it to longjmp
|
||||||
|
|
||||||
|
---
|
||||||
|
nptl_2_17/unwind_2_17.c | 138 ++++++++++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 138 insertions(+)
|
||||||
|
create mode 100644 nptl_2_17/unwind_2_17.c
|
||||||
|
|
||||||
|
diff --git a/nptl_2_17/unwind_2_17.c b/nptl_2_17/unwind_2_17.c
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..ada8f74d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/nptl_2_17/unwind_2_17.c
|
||||||
|
@@ -0,0 +1,138 @@
|
||||||
|
+/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
||||||
|
+ This file is part of the GNU C Library.
|
||||||
|
+ Contributed by Ulrich Drepper <drepper@redhat.com>
|
||||||
|
+ and Richard Henderson <rth@redhat.com>, 2003.
|
||||||
|
+
|
||||||
|
+ 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
|
||||||
|
+ <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+#include "pthreadP_2_17.h"
|
||||||
|
+#include <setjmp.h>
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+#include <string.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#include <jmpbuf-unwind.h>
|
||||||
|
+
|
||||||
|
+#ifdef _STACK_GROWS_DOWN
|
||||||
|
+# define FRAME_LEFT(frame, other, adj) \
|
||||||
|
+ ((uintptr_t) frame - adj >= (uintptr_t) other - adj)
|
||||||
|
+#elif _STACK_GROWS_UP
|
||||||
|
+# define FRAME_LEFT(frame, other, adj) \
|
||||||
|
+ ((uintptr_t) frame - adj <= (uintptr_t) other - adj)
|
||||||
|
+#else
|
||||||
|
+# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+static _Unwind_Reason_Code
|
||||||
|
+unwind_stop (int version, _Unwind_Action actions,
|
||||||
|
+ _Unwind_Exception_Class exc_class,
|
||||||
|
+ struct _Unwind_Exception *exc_obj,
|
||||||
|
+ struct _Unwind_Context *context, void *stop_parameter)
|
||||||
|
+{
|
||||||
|
+ struct pthread_unwind_buf *buf = stop_parameter;
|
||||||
|
+ struct pthread *self = THREAD_SELF;
|
||||||
|
+ struct _pthread_cleanup_buffer *curp = THREAD_GETMEM (self, cleanup);
|
||||||
|
+ int do_longjump = 0;
|
||||||
|
+
|
||||||
|
+ /* Adjust all pointers used in comparisons, so that top of thread's
|
||||||
|
+ stack is at the top of address space. Without that, things break
|
||||||
|
+ if stack is allocated above the main stack. */
|
||||||
|
+ uintptr_t adj = (uintptr_t) self->stackblock + self->stackblock_size;
|
||||||
|
+
|
||||||
|
+ /* Do longjmp if we're at "end of stack", aka "end of unwind data".
|
||||||
|
+ We assume there are only C frame without unwind data in between
|
||||||
|
+ here and the jmp_buf target. Otherwise simply note that the CFA
|
||||||
|
+ of a function is NOT within it's stack frame; it's the SP of the
|
||||||
|
+ previous frame. */
|
||||||
|
+ if ((actions & _UA_END_OF_STACK)
|
||||||
|
+ || ! _JMPBUF_CFA_UNWINDS_ADJ (buf->cancel_jmp_buf[0].jmp_buf, context,
|
||||||
|
+ adj))
|
||||||
|
+ do_longjump = 1;
|
||||||
|
+
|
||||||
|
+ if (__glibc_unlikely (curp != NULL))
|
||||||
|
+ {
|
||||||
|
+ /* Handle the compatibility stuff. Execute all handlers
|
||||||
|
+ registered with the old method which would be unwound by this
|
||||||
|
+ step. */
|
||||||
|
+ struct _pthread_cleanup_buffer *oldp = buf->priv.data.cleanup;
|
||||||
|
+ void *cfa = (void *) (_Unwind_Ptr) _Unwind_GetCFA (context);
|
||||||
|
+
|
||||||
|
+ if (curp != oldp && (do_longjump || FRAME_LEFT (cfa, curp, adj)))
|
||||||
|
+ {
|
||||||
|
+ do
|
||||||
|
+ {
|
||||||
|
+ /* Pointer to the next element. */
|
||||||
|
+ struct _pthread_cleanup_buffer *nextp = curp->__prev;
|
||||||
|
+
|
||||||
|
+ /* Call the handler. */
|
||||||
|
+ curp->__routine (curp->__arg);
|
||||||
|
+
|
||||||
|
+ /* To the next. */
|
||||||
|
+ curp = nextp;
|
||||||
|
+ }
|
||||||
|
+ while (curp != oldp
|
||||||
|
+ && (do_longjump || FRAME_LEFT (cfa, curp, adj)));
|
||||||
|
+
|
||||||
|
+ /* Mark the current element as handled. */
|
||||||
|
+ THREAD_SETMEM (self, cleanup, curp);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (do_longjump)
|
||||||
|
+ longjmp ((struct __jmp_buf_tag *) buf->cancel_jmp_buf, 1);
|
||||||
|
+
|
||||||
|
+ return _URC_NO_REASON;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+unwind_cleanup (_Unwind_Reason_Code reason, struct _Unwind_Exception *exc)
|
||||||
|
+{
|
||||||
|
+ /* When we get here a C++ catch block didn't rethrow the object. We
|
||||||
|
+ cannot handle this case and therefore abort. */
|
||||||
|
+ __libc_fatal ("FATAL: exception not rethrown\n");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+__cleanup_fct_attribute __attribute ((noreturn))
|
||||||
|
+__pthread_unwind (__pthread_unwind_buf_t *buf)
|
||||||
|
+{
|
||||||
|
+ struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
|
||||||
|
+ struct pthread *self = THREAD_SELF;
|
||||||
|
+
|
||||||
|
+ /* This is not a catchable exception, so don't provide any details about
|
||||||
|
+ the exception type. We do need to initialize the field though. */
|
||||||
|
+ THREAD_SETMEM (self, exc.exception_class, 0);
|
||||||
|
+ THREAD_SETMEM (self, exc.exception_cleanup, &unwind_cleanup);
|
||||||
|
+
|
||||||
|
+ _Unwind_ForcedUnwind (&self->exc, unwind_stop, ibuf);
|
||||||
|
+ /* NOTREACHED */
|
||||||
|
+
|
||||||
|
+ /* We better do not get here. */
|
||||||
|
+ abort ();
|
||||||
|
+}
|
||||||
|
+hidden_def (__pthread_unwind)
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+__cleanup_fct_attribute __attribute ((noreturn))
|
||||||
|
+__pthread_unwind_next (__pthread_unwind_buf_t *buf)
|
||||||
|
+{
|
||||||
|
+ struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
|
||||||
|
+
|
||||||
|
+ __pthread_unwind ((__pthread_unwind_buf_t *) ibuf->priv.data.prev);
|
||||||
|
+}
|
||||||
|
+hidden_def (__pthread_unwind_next)
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
196
LanguageList
Normal file
196
LanguageList
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
glibc-langpack-aa
|
||||||
|
glibc-langpack-af
|
||||||
|
glibc-langpack-agr
|
||||||
|
glibc-langpack-ak
|
||||||
|
glibc-langpack-am
|
||||||
|
glibc-langpack-an
|
||||||
|
glibc-langpack-anp
|
||||||
|
glibc-langpack-ar
|
||||||
|
glibc-langpack-as
|
||||||
|
glibc-langpack-ast
|
||||||
|
glibc-langpack-ayc
|
||||||
|
glibc-langpack-az
|
||||||
|
glibc-langpack-be
|
||||||
|
glibc-langpack-bem
|
||||||
|
glibc-langpack-ber
|
||||||
|
glibc-langpack-bg
|
||||||
|
glibc-langpack-bhb
|
||||||
|
glibc-langpack-bho
|
||||||
|
glibc-langpack-bi
|
||||||
|
glibc-langpack-bn
|
||||||
|
glibc-langpack-bo
|
||||||
|
glibc-langpack-br
|
||||||
|
glibc-langpack-brx
|
||||||
|
glibc-langpack-bs
|
||||||
|
glibc-langpack-byn
|
||||||
|
glibc-langpack-ca
|
||||||
|
glibc-langpack-ce
|
||||||
|
glibc-langpack-chr
|
||||||
|
glibc-langpack-cmn
|
||||||
|
glibc-langpack-crh
|
||||||
|
glibc-langpack-cs
|
||||||
|
glibc-langpack-csb
|
||||||
|
glibc-langpack-cv
|
||||||
|
glibc-langpack-cy
|
||||||
|
glibc-langpack-da
|
||||||
|
glibc-langpack-de
|
||||||
|
glibc-langpack-doi
|
||||||
|
glibc-langpack-dsb
|
||||||
|
glibc-langpack-dv
|
||||||
|
glibc-langpack-dz
|
||||||
|
glibc-langpack-el
|
||||||
|
glibc-langpack-en
|
||||||
|
glibc-langpack-eo
|
||||||
|
glibc-langpack-es
|
||||||
|
glibc-langpack-et
|
||||||
|
glibc-langpack-eu
|
||||||
|
glibc-langpack-fa
|
||||||
|
glibc-langpack-ff
|
||||||
|
glibc-langpack-fi
|
||||||
|
glibc-langpack-fil
|
||||||
|
glibc-langpack-fo
|
||||||
|
glibc-langpack-fr
|
||||||
|
glibc-langpack-fur
|
||||||
|
glibc-langpack-fy
|
||||||
|
glibc-langpack-ga
|
||||||
|
glibc-langpack-gd
|
||||||
|
glibc-langpack-gez
|
||||||
|
glibc-langpack-gl
|
||||||
|
glibc-langpack-gu
|
||||||
|
glibc-langpack-gv
|
||||||
|
glibc-langpack-ha
|
||||||
|
glibc-langpack-hak
|
||||||
|
glibc-langpack-he
|
||||||
|
glibc-langpack-hi
|
||||||
|
glibc-langpack-hif
|
||||||
|
glibc-langpack-hne
|
||||||
|
glibc-langpack-hr
|
||||||
|
glibc-langpack-hsb
|
||||||
|
glibc-langpack-ht
|
||||||
|
glibc-langpack-hu
|
||||||
|
glibc-langpack-hy
|
||||||
|
glibc-langpack-ia
|
||||||
|
glibc-langpack-id
|
||||||
|
glibc-langpack-ig
|
||||||
|
glibc-langpack-ik
|
||||||
|
glibc-langpack-is
|
||||||
|
glibc-langpack-it
|
||||||
|
glibc-langpack-iu
|
||||||
|
glibc-langpack-ja
|
||||||
|
glibc-langpack-ka
|
||||||
|
glibc-langpack-kab
|
||||||
|
glibc-langpack-kk
|
||||||
|
glibc-langpack-kl
|
||||||
|
glibc-langpack-km
|
||||||
|
glibc-langpack-kn
|
||||||
|
glibc-langpack-ko
|
||||||
|
glibc-langpack-kok
|
||||||
|
glibc-langpack-ks
|
||||||
|
glibc-langpack-ku
|
||||||
|
glibc-langpack-kw
|
||||||
|
glibc-langpack-ky
|
||||||
|
glibc-langpack-lb
|
||||||
|
glibc-langpack-lg
|
||||||
|
glibc-langpack-li
|
||||||
|
glibc-langpack-lij
|
||||||
|
glibc-langpack-ln
|
||||||
|
glibc-langpack-lo
|
||||||
|
glibc-langpack-lt
|
||||||
|
glibc-langpack-lv
|
||||||
|
glibc-langpack-lzh
|
||||||
|
glibc-langpack-mag
|
||||||
|
glibc-langpack-mai
|
||||||
|
glibc-langpack-mfe
|
||||||
|
glibc-langpack-mg
|
||||||
|
glibc-langpack-mhr
|
||||||
|
glibc-langpack-mi
|
||||||
|
glibc-langpack-miq
|
||||||
|
glibc-langpack-mjw
|
||||||
|
glibc-langpack-mk
|
||||||
|
glibc-langpack-ml
|
||||||
|
glibc-langpack-mn
|
||||||
|
glibc-langpack-mni
|
||||||
|
glibc-langpack-mr
|
||||||
|
glibc-langpack-ms
|
||||||
|
glibc-langpack-mt
|
||||||
|
glibc-langpack-my
|
||||||
|
glibc-langpack-nan
|
||||||
|
glibc-langpack-nb
|
||||||
|
glibc-langpack-nds
|
||||||
|
glibc-langpack-ne
|
||||||
|
glibc-langpack-nhn
|
||||||
|
glibc-langpack-niu
|
||||||
|
glibc-langpack-nl
|
||||||
|
glibc-langpack-nn
|
||||||
|
glibc-langpack-nr
|
||||||
|
glibc-langpack-nso
|
||||||
|
glibc-langpack-oc
|
||||||
|
glibc-langpack-om
|
||||||
|
glibc-langpack-or
|
||||||
|
glibc-langpack-os
|
||||||
|
glibc-langpack-pa
|
||||||
|
glibc-langpack-pap
|
||||||
|
glibc-langpack-pl
|
||||||
|
glibc-langpack-ps
|
||||||
|
glibc-langpack-pt
|
||||||
|
glibc-langpack-quz
|
||||||
|
glibc-langpack-raj
|
||||||
|
glibc-langpack-ro
|
||||||
|
glibc-langpack-ru
|
||||||
|
glibc-langpack-rw
|
||||||
|
glibc-langpack-sa
|
||||||
|
glibc-langpack-sah
|
||||||
|
glibc-langpack-sat
|
||||||
|
glibc-langpack-sc
|
||||||
|
glibc-langpack-sd
|
||||||
|
glibc-langpack-se
|
||||||
|
glibc-langpack-sgs
|
||||||
|
glibc-langpack-shn
|
||||||
|
glibc-langpack-shs
|
||||||
|
glibc-langpack-si
|
||||||
|
glibc-langpack-sid
|
||||||
|
glibc-langpack-sk
|
||||||
|
glibc-langpack-sl
|
||||||
|
glibc-langpack-sm
|
||||||
|
glibc-langpack-so
|
||||||
|
glibc-langpack-sq
|
||||||
|
glibc-langpack-sr
|
||||||
|
glibc-langpack-ss
|
||||||
|
glibc-langpack-st
|
||||||
|
glibc-langpack-sv
|
||||||
|
glibc-langpack-sw
|
||||||
|
glibc-langpack-szl
|
||||||
|
glibc-langpack-ta
|
||||||
|
glibc-langpack-tcy
|
||||||
|
glibc-langpack-te
|
||||||
|
glibc-langpack-tg
|
||||||
|
glibc-langpack-th
|
||||||
|
glibc-langpack-the
|
||||||
|
glibc-langpack-ti
|
||||||
|
glibc-langpack-tig
|
||||||
|
glibc-langpack-tk
|
||||||
|
glibc-langpack-tl
|
||||||
|
glibc-langpack-tn
|
||||||
|
glibc-langpack-to
|
||||||
|
glibc-langpack-tpi
|
||||||
|
glibc-langpack-tr
|
||||||
|
glibc-langpack-ts
|
||||||
|
glibc-langpack-tt
|
||||||
|
glibc-langpack-ug
|
||||||
|
glibc-langpack-uk
|
||||||
|
glibc-langpack-unm
|
||||||
|
glibc-langpack-ur
|
||||||
|
glibc-langpack-uz
|
||||||
|
glibc-langpack-ve
|
||||||
|
glibc-langpack-vi
|
||||||
|
glibc-langpack-wa
|
||||||
|
glibc-langpack-wae
|
||||||
|
glibc-langpack-wal
|
||||||
|
glibc-langpack-wo
|
||||||
|
glibc-langpack-xh
|
||||||
|
glibc-langpack-yi
|
||||||
|
glibc-langpack-yo
|
||||||
|
glibc-langpack-yue
|
||||||
|
glibc-langpack-yuw
|
||||||
|
glibc-langpack-zh
|
||||||
|
glibc-langpack-zu
|
||||||
26
LicenseList
Normal file
26
LicenseList
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
In general, GPLv2+ is used by programs, LGPLv2+ is used for
|
||||||
|
libraries.
|
||||||
|
|
||||||
|
LGPLv2+ with exceptions is used for things that are linked directly
|
||||||
|
into dynamically linked programs and shared libraries (e.g. crt
|
||||||
|
files, lib*_nonshared.a). Historically, this exception also applies
|
||||||
|
to parts of libio.
|
||||||
|
|
||||||
|
GPLv2+ with exceptions is used for parts of the Arm unwinder.
|
||||||
|
|
||||||
|
GFDL is used for the documentation.
|
||||||
|
|
||||||
|
Some other licenses are used in various places (BSD, Inner-Net,
|
||||||
|
ISC, Public Domain).
|
||||||
|
|
||||||
|
HSRL and FSFAP are only used in test cases, which currently do not
|
||||||
|
ship in binary RPMs, so they are not listed here. MIT is used for
|
||||||
|
scripts/install-sh, which does not ship, either.
|
||||||
|
|
||||||
|
GPLv3+ is used by manual/texinfo.tex, which we do not use.
|
||||||
|
|
||||||
|
LGPLv3+ is used by some Hurd code, which we do not build.
|
||||||
|
|
||||||
|
LGPLv2 is used in one place (time/timespec_get.c, by mistake), but
|
||||||
|
it is not actually compiled, so it does not matter for libraries.
|
||||||
|
|
||||||
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
|
||||||
38
glibc-1070416.patch
Normal file
38
glibc-1070416.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
|
||||||
BIN
glibc-2.36.tar.xz
Normal file
BIN
glibc-2.36.tar.xz
Normal file
Binary file not shown.
153
glibc-bench-compare
Normal file
153
glibc-bench-compare
Normal 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
|
||||||
1615
glibc.spec
Normal file
1615
glibc.spec
Normal file
File diff suppressed because it is too large
Load Diff
4
glibc.yaml
Normal file
4
glibc.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version_control: git
|
||||||
|
src_repo: https://sourceware.org/git/glibc.git
|
||||||
|
tag_prefix: glibc-
|
||||||
|
seperator: "."
|
||||||
26
locale-delete-no-hard-link-to-avoid-all_language-pac.patch
Normal file
26
locale-delete-no-hard-link-to-avoid-all_language-pac.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
From 6b462949b0cb8265c44c2f9ddbc0758af2279345 Mon Sep 17 00:00:00 2001
|
||||||
|
From: liqingqing_1229 <liqingqing3@huawei.com>
|
||||||
|
Date: Tue, 2 Aug 2022 15:10:32 +0800
|
||||||
|
Subject: [PATCH] locale: delete --no-hard-link to avoid all_language packages
|
||||||
|
too large
|
||||||
|
|
||||||
|
---
|
||||||
|
localedata/Makefile | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/localedata/Makefile b/localedata/Makefile
|
||||||
|
index da92b67..eb4c3d8 100644
|
||||||
|
--- a/localedata/Makefile
|
||||||
|
+++ b/localedata/Makefile
|
||||||
|
@@ -476,7 +476,7 @@ $(INSTALL-SUPPORTED-LOCALE-ARCHIVE): install-locales-dir
|
||||||
|
$(build-one-locale)
|
||||||
|
|
||||||
|
$(INSTALL-SUPPORTED-LOCALE-FILES): install-locales-dir
|
||||||
|
- @flags="--no-archive --no-hard-links"; \
|
||||||
|
+ @flags="--no-archive"; \
|
||||||
|
$(build-one-locale)
|
||||||
|
|
||||||
|
tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
25
malloc-use-__get_nprocs-replace-__get_nprocs_sched.patch
Normal file
25
malloc-use-__get_nprocs-replace-__get_nprocs_sched.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From f5545d74d6dc4d5036bee6a91cda14a51e2a0676 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Yang Yanchao <yangyanchao6@huawei.com>
|
||||||
|
Date: Sat, 12 Mar 2022 15:30:17 +0800
|
||||||
|
Subject: [PATCH] malloc: use __get_nprocs replace __get_nprocs_sched.
|
||||||
|
|
||||||
|
---
|
||||||
|
malloc/arena.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/malloc/arena.c b/malloc/arena.c
|
||||||
|
index f1f0af86..66748463 100644
|
||||||
|
--- a/malloc/arena.c
|
||||||
|
+++ b/malloc/arena.c
|
||||||
|
@@ -879,7 +879,7 @@ arena_get2 (size_t size, mstate avoid_arena)
|
||||||
|
narenas_limit = mp_.arena_max;
|
||||||
|
else if (narenas > mp_.arena_test)
|
||||||
|
{
|
||||||
|
- int n = __get_nprocs_sched ();
|
||||||
|
+ int n = __get_nprocs ();
|
||||||
|
|
||||||
|
if (n >= 1)
|
||||||
|
narenas_limit = NARENAS_FROM_NCORES (n);
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
56
nsswitch.conf
Normal file
56
nsswitch.conf
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
#
|
||||||
|
# /etc/nsswitch.conf
|
||||||
|
#
|
||||||
|
# An example Name Service Switch config file. This file should be
|
||||||
|
# sorted with the most-used services at the beginning.
|
||||||
|
#
|
||||||
|
# The entry '[NOTFOUND=return]' means that the search for an
|
||||||
|
# entry should stop if the search in the previous entry turned
|
||||||
|
# up nothing. Note that if the search failed due to some other reason
|
||||||
|
# (like no NIS server responding) then the search continues with the
|
||||||
|
# next entry.
|
||||||
|
#
|
||||||
|
# Valid entries include:
|
||||||
|
#
|
||||||
|
# nisplus Use NIS+ (NIS version 3)
|
||||||
|
# nis Use NIS (NIS version 2), also called YP
|
||||||
|
# dns Use DNS (Domain Name Service)
|
||||||
|
# files Use the local files in /etc
|
||||||
|
# db Use the pre-processed /var/db files
|
||||||
|
# compat Use /etc files plus *_compat pseudo-databases
|
||||||
|
# hesiod Use Hesiod (DNS) for user lookups
|
||||||
|
# sss Use sssd (System Security Services Daemon)
|
||||||
|
# [NOTFOUND=return] Stop searching if not found so far
|
||||||
|
#
|
||||||
|
# 'sssd' performs its own 'files'-based caching, so it should
|
||||||
|
# generally come before 'files'.
|
||||||
|
|
||||||
|
# To use 'db', install the nss_db package, and put the 'db' in front
|
||||||
|
# of 'files' for entries you want to be looked up first in the
|
||||||
|
# databases, like this:
|
||||||
|
#
|
||||||
|
# passwd: db files
|
||||||
|
# shadow: db files
|
||||||
|
# group: db files
|
||||||
|
|
||||||
|
passwd: sss files
|
||||||
|
shadow: files sss
|
||||||
|
group: sss files
|
||||||
|
|
||||||
|
hosts: files dns myhostname
|
||||||
|
|
||||||
|
bootparams: files
|
||||||
|
|
||||||
|
ethers: files
|
||||||
|
netmasks: files
|
||||||
|
networks: files
|
||||||
|
protocols: files
|
||||||
|
rpc: files
|
||||||
|
services: files sss
|
||||||
|
|
||||||
|
netgroup: sss
|
||||||
|
|
||||||
|
publickey: files
|
||||||
|
|
||||||
|
automount: files sss
|
||||||
|
aliases: files
|
||||||
98
replace_same_file_to_hard_link.py
Normal file
98
replace_same_file_to_hard_link.py
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
function: This script resolves locales's BEP inconsistence,
|
||||||
|
it scans a specific path and replaces the same file
|
||||||
|
in that path with a hard link.Avoid different language
|
||||||
|
packs each time due to concurrent compilation.
|
||||||
|
"""
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
|
||||||
|
all_file = {}
|
||||||
|
|
||||||
|
def cmp_file(f1, f2):
|
||||||
|
"""compare two files in bytes"""
|
||||||
|
st1 = os.stat(f1)
|
||||||
|
st2 = os.stat(f2)
|
||||||
|
|
||||||
|
bufsize = 8 * 1024
|
||||||
|
with open(f1, 'rb') as fp1, open(f2, 'rb') as fp2:
|
||||||
|
while True:
|
||||||
|
b1 = fp1.read(bufsize)
|
||||||
|
b2 = fp2.read(bufsize)
|
||||||
|
if b1 != b2:
|
||||||
|
return False
|
||||||
|
if not b1:
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def search_all_inode(dir_path):
|
||||||
|
"""recursively traverse the directory to group all"""
|
||||||
|
files = os.listdir(dir_path)
|
||||||
|
|
||||||
|
for fi in files:
|
||||||
|
fi_d = os.path.join(dir_path, fi)
|
||||||
|
if os.path.isdir(fi_d):
|
||||||
|
search_all_inode(fi_d)
|
||||||
|
else:
|
||||||
|
size = os.stat(fi_d).st_size
|
||||||
|
if size in all_file:
|
||||||
|
all_file[size].append(fi_d)
|
||||||
|
else:
|
||||||
|
all_file[size] = [fi_d]
|
||||||
|
|
||||||
|
|
||||||
|
def deal_one(file_paths):
|
||||||
|
"""traverse the file array, delete the same file and create a hard link"""
|
||||||
|
file_count = len(file_paths)
|
||||||
|
inode_files = {}
|
||||||
|
|
||||||
|
for i in range(0, file_count):
|
||||||
|
for j in range(i + 1, file_count):
|
||||||
|
file1 = file_paths[i]
|
||||||
|
file2 = file_paths[j]
|
||||||
|
|
||||||
|
file1_inode = os.stat(file1).st_ino
|
||||||
|
file2_inode = os.stat(file2).st_ino
|
||||||
|
|
||||||
|
if file1_inode not in inode_files:
|
||||||
|
inode_files[file1_inode] = file1
|
||||||
|
|
||||||
|
if file1_inode == file2_inode:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if cmp_file(file1, file2):
|
||||||
|
print('deal same file:', file1, '==', file2)
|
||||||
|
os.remove(file2)
|
||||||
|
os.link(file1, file2)
|
||||||
|
else:
|
||||||
|
if file2_inode not in inode_files:
|
||||||
|
inode_files[file2_inode] = file2
|
||||||
|
|
||||||
|
|
||||||
|
def deal_files():
|
||||||
|
"""get file array and processed one by one"""
|
||||||
|
for size in all_file:
|
||||||
|
file_paths = all_file[size]
|
||||||
|
if len(file_paths) > 1:
|
||||||
|
deal_one(file_paths)
|
||||||
|
|
||||||
|
|
||||||
|
def usage():
|
||||||
|
"""print usage"""
|
||||||
|
print("""
|
||||||
|
rm_same_file: Replace the same file with a hard link.
|
||||||
|
|
||||||
|
rm_same_file.py [target path]
|
||||||
|
|
||||||
|
""")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if len(sys.argv) == 2:
|
||||||
|
search_all_inode(sys.argv[1])
|
||||||
|
deal_files()
|
||||||
|
else:
|
||||||
|
usage()
|
||||||
|
sys.exit()
|
||||||
111
testsuite_whitelist.aarch64
Normal file
111
testsuite_whitelist.aarch64
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
# These test cases failed due to gcc_secure
|
||||||
|
conform/ISO/setjmp.h/conform
|
||||||
|
conform/ISO/stdlib.h/conform
|
||||||
|
conform/ISO/stdlib.h/linknamespace
|
||||||
|
conform/ISO/string.h/conform
|
||||||
|
conform/ISO11/setjmp.h/conform
|
||||||
|
conform/ISO11/stdio.h/conform
|
||||||
|
conform/ISO11/stdlib.h/conform
|
||||||
|
conform/ISO11/stdlib.h/linknamespace
|
||||||
|
conform/ISO11/string.h/conform
|
||||||
|
conform/ISO11/wchar.h/conform
|
||||||
|
conform/ISO99/setjmp.h/conform
|
||||||
|
conform/ISO99/stdio.h/conform
|
||||||
|
conform/ISO99/stdlib.h/conform
|
||||||
|
conform/ISO99/stdlib.h/linknamespace
|
||||||
|
conform/ISO99/string.h/conform
|
||||||
|
conform/ISO99/wchar.h/conform
|
||||||
|
conform/POSIX/stdlib.h/conform
|
||||||
|
conform/POSIX/stdlib.h/linknamespace
|
||||||
|
conform/POSIX/string.h/conform
|
||||||
|
conform/POSIX2008/fcntl.h/conform
|
||||||
|
conform/POSIX2008/mqueue.h/conform
|
||||||
|
conform/POSIX2008/stdio.h/conform
|
||||||
|
conform/POSIX2008/stdlib.h/conform
|
||||||
|
conform/POSIX2008/stdlib.h/linknamespace
|
||||||
|
conform/POSIX2008/wchar.h/conform
|
||||||
|
conform/UNIX98/stdlib.h/conform
|
||||||
|
conform/UNIX98/string.h/conform
|
||||||
|
conform/UNIX98/unistd.h/conform
|
||||||
|
conform/UNIX98/unistd.h/linknamespace
|
||||||
|
conform/UNIX98/wchar.h/conform
|
||||||
|
conform/XOPEN2K/fcntl.h/conform
|
||||||
|
conform/XOPEN2K/mqueue.h/conform
|
||||||
|
conform/XOPEN2K/stdio.h/conform
|
||||||
|
conform/XOPEN2K/stdlib.h/conform
|
||||||
|
conform/XOPEN2K/string.h/conform
|
||||||
|
conform/XOPEN2K/syslog.h/conform
|
||||||
|
conform/XOPEN2K/unistd.h/conform
|
||||||
|
conform/XOPEN2K/unistd.h/linknamespace
|
||||||
|
conform/XOPEN2K/wchar.h/conform
|
||||||
|
conform/XOPEN2K8/fcntl.h/conform
|
||||||
|
conform/XOPEN2K8/mqueue.h/conform
|
||||||
|
conform/XOPEN2K8/stdio.h/conform
|
||||||
|
conform/XOPEN2K8/stdlib.h/conform
|
||||||
|
conform/XOPEN2K8/syslog.h/conform
|
||||||
|
conform/XOPEN2K8/unistd.h/conform
|
||||||
|
conform/XOPEN2K8/unistd.h/linknamespace
|
||||||
|
conform/XOPEN2K8/wchar.h/conform
|
||||||
|
conform/XPG4/stdlib.h/conform
|
||||||
|
conform/XPG4/stdlib.h/linknamespace
|
||||||
|
conform/XPG4/string.h/conform
|
||||||
|
conform/XPG4/unistd.h/conform
|
||||||
|
conform/XPG42/stdlib.h/conform
|
||||||
|
conform/XPG42/string.h/conform
|
||||||
|
conform/XPG42/unistd.h/conform
|
||||||
|
elf/circleload1
|
||||||
|
elf/constload1
|
||||||
|
elf/dblload
|
||||||
|
elf/dblunload
|
||||||
|
elf/lateglobal
|
||||||
|
elf/reldep6
|
||||||
|
elf/resolvfail
|
||||||
|
elf/tst-global1
|
||||||
|
elf/tst-tls20
|
||||||
|
nptl/tst-execstack
|
||||||
|
|
||||||
|
# GCC no longer implements <varargs.h>
|
||||||
|
conform/UNIX98/varargs.h/conform
|
||||||
|
conform/UNIX98/varargs.h/linknamespace
|
||||||
|
conform/XPG4/varargs.h/conform
|
||||||
|
conform/XPG4/varargs.h/linknamespace
|
||||||
|
conform/XPG42/varargs.h/conform
|
||||||
|
conform/XPG42/varargs.h/linknamespace
|
||||||
|
|
||||||
|
# These cases depend on gdbm-devel
|
||||||
|
conform/UNIX98/ndbm.h/conform
|
||||||
|
conform/UNIX98/ndbm.h/linknamespace
|
||||||
|
conform/XOPEN2K/ndbm.h/conform
|
||||||
|
conform/XOPEN2K/ndbm.h/linknamespace
|
||||||
|
conform/XOPEN2K8/ndbm.h/conform
|
||||||
|
conform/XOPEN2K8/ndbm.h/linknamespace
|
||||||
|
conform/XPG42/ndbm.h/conform
|
||||||
|
conform/XPG42/ndbm.h/linknamespace
|
||||||
|
|
||||||
|
# Test whether the date/time is correct under different
|
||||||
|
# language libraries, use case problems, and see that
|
||||||
|
# the compiled language library itself has no errors
|
||||||
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=23164
|
||||||
|
localedata/tst-langinfo-newlocale-static
|
||||||
|
|
||||||
|
# The use case itself passed but because
|
||||||
|
# test-xfail-tst-protected1a/test-xfail-tst-protected1b was added
|
||||||
|
elf/tst-protected1a
|
||||||
|
elf/tst-protected1b
|
||||||
|
|
||||||
|
# the test case is due to check whether a macro is defined
|
||||||
|
# in the header files. As GLIBC evolves, the position of the
|
||||||
|
# macro changes, causing the use case to fail
|
||||||
|
posix/annexc
|
||||||
|
|
||||||
|
# Check whether sys/mman.h is consistent with linux/mman.h.
|
||||||
|
# kernel has a self-developed macro that does not require glibc adaptation
|
||||||
|
# https://gitee.com/src-openeuler/kernel/issues/I4BZ9T?from=project-issue
|
||||||
|
misc/tst-mman-consts
|
||||||
|
|
||||||
|
# Add the tst-nss-files-hosts-long.root/etc/hosts of glibc to
|
||||||
|
# the /etc/hosts directory of the system, and then run sucess
|
||||||
|
nss/tst-nss-files-hosts-long
|
||||||
|
|
||||||
|
# The test case fails due to OBS machine restrictions which can be passed locally.
|
||||||
|
elf/tst-debug1
|
||||||
112
testsuite_whitelist.x86_64
Normal file
112
testsuite_whitelist.x86_64
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
# These test cases failed due to gcc_secure
|
||||||
|
conform/ISO/setjmp.h/conform
|
||||||
|
conform/ISO/stdlib.h/conform
|
||||||
|
conform/ISO/stdlib.h/linknamespace
|
||||||
|
conform/ISO/string.h/conform
|
||||||
|
conform/ISO11/setjmp.h/conform
|
||||||
|
conform/ISO11/stdio.h/conform
|
||||||
|
conform/ISO11/stdlib.h/conform
|
||||||
|
conform/ISO11/stdlib.h/linknamespace
|
||||||
|
conform/ISO11/string.h/conform
|
||||||
|
conform/ISO11/wchar.h/conform
|
||||||
|
conform/ISO99/setjmp.h/conform
|
||||||
|
conform/ISO99/stdio.h/conform
|
||||||
|
conform/ISO99/stdlib.h/conform
|
||||||
|
conform/ISO99/stdlib.h/linknamespace
|
||||||
|
conform/ISO99/string.h/conform
|
||||||
|
conform/ISO99/wchar.h/conform
|
||||||
|
conform/POSIX/stdlib.h/conform
|
||||||
|
conform/POSIX/stdlib.h/linknamespace
|
||||||
|
conform/POSIX/string.h/conform
|
||||||
|
conform/POSIX2008/fcntl.h/conform
|
||||||
|
conform/POSIX2008/mqueue.h/conform
|
||||||
|
conform/POSIX2008/stdio.h/conform
|
||||||
|
conform/POSIX2008/stdlib.h/conform
|
||||||
|
conform/POSIX2008/stdlib.h/linknamespace
|
||||||
|
conform/POSIX2008/wchar.h/conform
|
||||||
|
conform/UNIX98/stdlib.h/conform
|
||||||
|
conform/UNIX98/string.h/conform
|
||||||
|
conform/UNIX98/unistd.h/conform
|
||||||
|
conform/UNIX98/unistd.h/linknamespace
|
||||||
|
conform/UNIX98/wchar.h/conform
|
||||||
|
conform/XOPEN2K/fcntl.h/conform
|
||||||
|
conform/XOPEN2K/mqueue.h/conform
|
||||||
|
conform/XOPEN2K/stdio.h/conform
|
||||||
|
conform/XOPEN2K/stdlib.h/conform
|
||||||
|
conform/XOPEN2K/string.h/conform
|
||||||
|
conform/XOPEN2K/syslog.h/conform
|
||||||
|
conform/XOPEN2K/unistd.h/conform
|
||||||
|
conform/XOPEN2K/unistd.h/linknamespace
|
||||||
|
conform/XOPEN2K/wchar.h/conform
|
||||||
|
conform/XOPEN2K8/fcntl.h/conform
|
||||||
|
conform/XOPEN2K8/mqueue.h/conform
|
||||||
|
conform/XOPEN2K8/stdio.h/conform
|
||||||
|
conform/XOPEN2K8/stdlib.h/conform
|
||||||
|
conform/XOPEN2K8/syslog.h/conform
|
||||||
|
conform/XOPEN2K8/unistd.h/conform
|
||||||
|
conform/XOPEN2K8/unistd.h/linknamespace
|
||||||
|
conform/XOPEN2K8/wchar.h/conform
|
||||||
|
conform/XPG4/stdlib.h/conform
|
||||||
|
conform/XPG4/stdlib.h/linknamespace
|
||||||
|
conform/XPG4/string.h/conform
|
||||||
|
conform/XPG4/unistd.h/conform
|
||||||
|
conform/XPG42/stdlib.h/conform
|
||||||
|
conform/XPG42/string.h/conform
|
||||||
|
conform/XPG42/unistd.h/conform
|
||||||
|
elf/circleload1
|
||||||
|
elf/constload1
|
||||||
|
elf/dblload
|
||||||
|
elf/dblunload
|
||||||
|
elf/ifuncmain6pie
|
||||||
|
elf/lateglobal
|
||||||
|
elf/reldep6
|
||||||
|
elf/resolvfail
|
||||||
|
elf/tst-global1
|
||||||
|
elf/tst-tls20
|
||||||
|
nptl/tst-execstack
|
||||||
|
|
||||||
|
# GCC no longer implements <varargs.h>
|
||||||
|
conform/UNIX98/varargs.h/conform
|
||||||
|
conform/UNIX98/varargs.h/linknamespace
|
||||||
|
conform/XPG4/varargs.h/conform
|
||||||
|
conform/XPG4/varargs.h/linknamespace
|
||||||
|
conform/XPG42/varargs.h/conform
|
||||||
|
conform/XPG42/varargs.h/linknamespace
|
||||||
|
|
||||||
|
# These cases depend on gdbm-devel
|
||||||
|
conform/UNIX98/ndbm.h/conform
|
||||||
|
conform/UNIX98/ndbm.h/linknamespace
|
||||||
|
conform/XOPEN2K/ndbm.h/conform
|
||||||
|
conform/XOPEN2K/ndbm.h/linknamespace
|
||||||
|
conform/XOPEN2K8/ndbm.h/conform
|
||||||
|
conform/XOPEN2K8/ndbm.h/linknamespace
|
||||||
|
conform/XPG42/ndbm.h/conform
|
||||||
|
conform/XPG42/ndbm.h/linknamespace
|
||||||
|
|
||||||
|
# Test whether the date/time is correct under different
|
||||||
|
# language libraries, use case problems, and see that
|
||||||
|
# the compiled language library itself has no errors
|
||||||
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=23164
|
||||||
|
localedata/tst-langinfo-newlocale-static
|
||||||
|
|
||||||
|
# The use case itself passed but because
|
||||||
|
# test-xfail-tst-protected1a/test-xfail-tst-protected1b was added
|
||||||
|
elf/tst-protected1a
|
||||||
|
elf/tst-protected1b
|
||||||
|
|
||||||
|
# the test case is due to check whether a macro is defined
|
||||||
|
# in the header files. As GLIBC evolves, the position of the
|
||||||
|
# macro changes, causing the use case to fail
|
||||||
|
posix/annexc
|
||||||
|
|
||||||
|
# Check whether sys/mman.h is consistent with linux/mman.h.
|
||||||
|
# kernel has a self-developed macro that does not require glibc adaptation
|
||||||
|
# https://gitee.com/src-openeuler/kernel/issues/I4BZ9T?from=project-issue
|
||||||
|
misc/tst-mman-consts
|
||||||
|
|
||||||
|
# It need to build GliBC on a platform that supports CET
|
||||||
|
elf/check-cet
|
||||||
|
|
||||||
|
# Add the tst-nss-files-hosts-long.root/etc/hosts of glibc to
|
||||||
|
# the /etc/hosts directory of the system, and then run sucess
|
||||||
|
nss/tst-nss-files-hosts-long
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
From 4dee2794b8c78ccd540e3f72bc07585828e0143b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Yang Yanchao <yangyanchao6@huawei.com>
|
||||||
|
Date: Thu, 2 Dec 2021 19:56:20 +0800
|
||||||
|
Subject: [PATCH] turn the default value of x86_rep_stosb_threshold from 2k to 1M
|
||||||
|
|
||||||
|
x86_rep_stosb_threshold is designed to choose vec mov or stosb.
|
||||||
|
For the libMicro, after set this x86_rep_stosb_threshold to 1 MB.
|
||||||
|
The performance of memset_256_u, memset_4k_uc, and memset_1m is improved.
|
||||||
|
The performance deteriorates in the memset_4k and memset_10k scenarios.
|
||||||
|
---
|
||||||
|
sysdeps/x86/dl-tunables.list | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/sysdeps/x86/dl-tunables.list b/sysdeps/x86/dl-tunables.list
|
||||||
|
index dd6e1d65..a4c3af69 100644
|
||||||
|
--- a/sysdeps/x86/dl-tunables.list
|
||||||
|
+++ b/sysdeps/x86/dl-tunables.list
|
||||||
|
@@ -54,7 +54,7 @@ glibc {
|
||||||
|
# stored value is fixed, larger register size has minimal impact
|
||||||
|
# on threshold.
|
||||||
|
minval: 1
|
||||||
|
- default: 2048
|
||||||
|
+ default: 1048576
|
||||||
|
}
|
||||||
|
x86_data_cache_size {
|
||||||
|
type: SIZE_T
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
152
use-region-to-instead-of-country-for-extract-timezon.patch
Normal file
152
use-region-to-instead-of-country-for-extract-timezon.patch
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
From 1c20cf491471a4a70f103a9d052fcca993eaa341 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Qingqing Li <liqingqing3@huawei.com>
|
||||||
|
Date: Tue, 22 Feb 2022 15:00:55 +0800
|
||||||
|
Subject: [PATCH] use region to instead of country for extract timezone
|
||||||
|
selection.
|
||||||
|
Co-authored-by: liusirui <liusirui@huawei.com>
|
||||||
|
---
|
||||||
|
timezone/tzselect.ksh | 97 +++++++++----------------------------------
|
||||||
|
1 file changed, 20 insertions(+), 77 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh
|
||||||
|
index 18fce27e..414bfa2a 100755
|
||||||
|
--- a/timezone/tzselect.ksh
|
||||||
|
+++ b/timezone/tzselect.ksh
|
||||||
|
@@ -51,7 +51,7 @@ say() {
|
||||||
|
|
||||||
|
coord=
|
||||||
|
location_limit=10
|
||||||
|
-zonetabtype=zone1970
|
||||||
|
+zonetabtype=zone
|
||||||
|
|
||||||
|
usage="Usage: tzselect [--version] [--help] [-c COORD] [-n LIMIT]
|
||||||
|
Select a timezone interactively.
|
||||||
|
@@ -398,94 +398,38 @@ while
|
||||||
|
'`
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
- # Get list of names of countries in the continent or ocean.
|
||||||
|
- countries=`$AWK \
|
||||||
|
+ # Get list of regions in the continent or ocean.
|
||||||
|
+ timezones=`$AWK \
|
||||||
|
-v continent="$continent" \
|
||||||
|
-v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \
|
||||||
|
'
|
||||||
|
BEGIN { FS = "\t" }
|
||||||
|
/^#/ { next }
|
||||||
|
$3 ~ ("^" continent "/") {
|
||||||
|
- ncc = split($1, cc, /,/)
|
||||||
|
+ ncc = split($3, cc, /,/)
|
||||||
|
for (i = 1; i <= ncc; i++)
|
||||||
|
if (!cc_seen[cc[i]]++) cc_list[++ccs] = cc[i]
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
- while (getline <TZ_COUNTRY_TABLE) {
|
||||||
|
- if ($0 !~ /^#/) cc_name[$1] = $2
|
||||||
|
- }
|
||||||
|
for (i = 1; i <= ccs; i++) {
|
||||||
|
- country = cc_list[i]
|
||||||
|
- if (cc_name[country]) {
|
||||||
|
- country = cc_name[country]
|
||||||
|
- }
|
||||||
|
- print country
|
||||||
|
+ print cc_list[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
' <"$TZ_ZONE_TABLE" | sort -f`
|
||||||
|
|
||||||
|
-
|
||||||
|
- # If there's more than one country, ask the user which one.
|
||||||
|
- case $countries in
|
||||||
|
- *"$newline"*)
|
||||||
|
- echo >&2 'Please select a country' \
|
||||||
|
- 'whose clocks agree with yours.'
|
||||||
|
- doselect $countries
|
||||||
|
- country=$select_result;;
|
||||||
|
- *)
|
||||||
|
- country=$countries
|
||||||
|
- esac
|
||||||
|
-
|
||||||
|
-
|
||||||
|
- # Get list of timezones in the country.
|
||||||
|
- regions=`$AWK \
|
||||||
|
- -v country="$country" \
|
||||||
|
- -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \
|
||||||
|
- '
|
||||||
|
- BEGIN {
|
||||||
|
- FS = "\t"
|
||||||
|
- cc = country
|
||||||
|
- while (getline <TZ_COUNTRY_TABLE) {
|
||||||
|
- if ($0 !~ /^#/ && country == $2) {
|
||||||
|
- cc = $1
|
||||||
|
- break
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- /^#/ { next }
|
||||||
|
- $1 ~ cc { print $4 }
|
||||||
|
- ' <"$TZ_ZONE_TABLE"`
|
||||||
|
-
|
||||||
|
-
|
||||||
|
- # If there's more than one region, ask the user which one.
|
||||||
|
- case $regions in
|
||||||
|
- *"$newline"*)
|
||||||
|
- echo >&2 'Please select one of the following timezones.'
|
||||||
|
- doselect $regions
|
||||||
|
- region=$select_result;;
|
||||||
|
- *)
|
||||||
|
- region=$regions
|
||||||
|
- esac
|
||||||
|
+ regions=[]
|
||||||
|
+ index=0
|
||||||
|
+ for item in $timezones; do
|
||||||
|
+ regions[$index]=`echo $item | awk -F '/' '{print $2}'`
|
||||||
|
+ index=$(($index+1))
|
||||||
|
+ done
|
||||||
|
+ echo >&2 'Please select a timezone' \
|
||||||
|
+ 'whose clocks agree with yours.'
|
||||||
|
+ doselect ${regions[@]}
|
||||||
|
+ region=$select_result
|
||||||
|
|
||||||
|
# Determine TZ from country and region.
|
||||||
|
- TZ=`$AWK \
|
||||||
|
- -v country="$country" \
|
||||||
|
- -v region="$region" \
|
||||||
|
- -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \
|
||||||
|
- '
|
||||||
|
- BEGIN {
|
||||||
|
- FS = "\t"
|
||||||
|
- cc = country
|
||||||
|
- while (getline <TZ_COUNTRY_TABLE) {
|
||||||
|
- if ($0 !~ /^#/ && country == $2) {
|
||||||
|
- cc = $1
|
||||||
|
- break
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- /^#/ { next }
|
||||||
|
- $1 ~ cc && $4 == region { print $3 }
|
||||||
|
- ' <"$TZ_ZONE_TABLE"`
|
||||||
|
+ TZ=$continent/$region
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Make sure the corresponding zoneinfo file exists.
|
||||||
|
@@ -523,11 +467,10 @@ Universal Time is now: $UTdate."
|
||||||
|
echo >&2 ""
|
||||||
|
echo >&2 "The following information has been given:"
|
||||||
|
echo >&2 ""
|
||||||
|
- case $country%$region%$coord in
|
||||||
|
- ?*%?*%) say >&2 " $country$newline $region";;
|
||||||
|
- ?*%%) say >&2 " $country";;
|
||||||
|
- %?*%?*) say >&2 " coord $coord$newline $region";;
|
||||||
|
- %%?*) say >&2 " coord $coord";;
|
||||||
|
+ case $region%$coord in
|
||||||
|
+ ?*%) say >&2 " $region";;
|
||||||
|
+ ?*%?*) say >&2 " coord $coord$newline $region";;
|
||||||
|
+ %?*) say >&2 " coord $coord";;
|
||||||
|
*) say >&2 " TZ='$TZ'"
|
||||||
|
esac
|
||||||
|
say >&2 ""
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
74
x86-use-total-l3cache-for-non_temporal_threshold.patch
Normal file
74
x86-use-total-l3cache-for-non_temporal_threshold.patch
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
From af0606f5d626b92d6e59da3a797548e9daab5580 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Qingqing Li <liqingqing3@huawei.com>
|
||||||
|
Date: Sat, 25 Jun 2022 15:36:44 +0800
|
||||||
|
Subject: [PATCH] x86: use total l3cache for non_temporal_threshold
|
||||||
|
|
||||||
|
Below glibc upstream patch modified the default behavoir for large size of memcpy,
|
||||||
|
such as 1M~10M. revert it and use GLIBC_TUNABLES="glibc.cpu.x86_non_temporal_threshold=xxx"
|
||||||
|
to tune the application when needed.
|
||||||
|
|
||||||
|
d3c57027470b78dba79c6d931e4e409b1fecfc80
|
||||||
|
Author: Patrick McGehearty <patrick.mcgehearty@oracle.com>
|
||||||
|
Date: Mon Sep 28 20:11:28 2020 +0000
|
||||||
|
|
||||||
|
Reversing calculation of __x86_shared_non_temporal_threshold
|
||||||
|
|
||||||
|
The __x86_shared_non_temporal_threshold determines when memcpy on x86
|
||||||
|
uses non_temporal stores to avoid pushing other data out of the last
|
||||||
|
level cache.
|
||||||
|
uses non_temporal stores to avoid pushing other data out of the last
|
||||||
|
level cache.
|
||||||
|
|
||||||
|
This patch proposes to revert the calculation change made by H.J. Lu's
|
||||||
|
patch of June 2, 2017.
|
||||||
|
|
||||||
|
H.J. Lu's patch selected a threshold suitable for a single thread
|
||||||
|
getting maximum performance. It was tuned using the single threaded
|
||||||
|
large memcpy micro benchmark on an 8 core processor. The last change
|
||||||
|
changes the threshold from using 3/4 of one thread's share of the
|
||||||
|
cache to using 3/4 of the entire cache of a multi-threaded system
|
||||||
|
before switching to non-temporal stores. Multi-threaded systems with
|
||||||
|
more than a few threads are server-class and typically have many
|
||||||
|
active threads. If one thread consumes 3/4 of the available cache for
|
||||||
|
all threads, it will cause other active threads to have data removed
|
||||||
|
from the cache. Two examples show the range of the effect. John
|
||||||
|
McCalpin's widely parallel Stream benchmark, which runs in parallel
|
||||||
|
and fetches data sequentially, saw a 20% slowdown with this patch on
|
||||||
|
an internal system test of 128 threads. This regression was discovered
|
||||||
|
when comparing OL8 performance to OL7. An example that compares
|
||||||
|
normal stores to non-temporal stores may be found at
|
||||||
|
https://vgatherps.github.io/2018-09-02-nontemporal/. A simple test
|
||||||
|
shows performance loss of 400 to 500% due to a failure to use
|
||||||
|
nontemporal stores. These performance losses are most likely to occur
|
||||||
|
when the system load is heaviest and good performance is critical.
|
||||||
|
|
||||||
|
The tunable x86_non_temporal_threshold can be used to override the
|
||||||
|
default for the knowledgable user who really wants maximum cache
|
||||||
|
allocation to a single thread in a multi-threaded system.
|
||||||
|
The manual entry for the tunable has been expanded to provide
|
||||||
|
more information about its purpose.
|
||||||
|
|
||||||
|
modified: sysdeps/x86/cacheinfo.c
|
||||||
|
modified: manual/tunables.texi
|
||||||
|
---
|
||||||
|
sysdeps/x86/dl-cacheinfo.h | 4 ++++++
|
||||||
|
1 file changed, 4 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h
|
||||||
|
index e6c94dfd..c5e8deb3 100644
|
||||||
|
--- a/sysdeps/x86/dl-cacheinfo.h
|
||||||
|
+++ b/sysdeps/x86/dl-cacheinfo.h
|
||||||
|
@@ -926,6 +926,10 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
|
||||||
|
if (tunable_size != 0)
|
||||||
|
shared = tunable_size;
|
||||||
|
|
||||||
|
+ /* keep x86 to use the same non_temporal_threshold like glibc2.28 */
|
||||||
|
+ if (threads != 0)
|
||||||
|
+ non_temporal_threshold *= threads;
|
||||||
|
+
|
||||||
|
tunable_size = TUNABLE_GET (x86_non_temporal_threshold, long int, NULL);
|
||||||
|
/* NB: Ignore the default value 0. */
|
||||||
|
if (tunable_size != 0)
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user