toolchain/glibc: sync upstream (#8866)

* glibc: update to latest 2.33 HEAD (bug 28011)

b5711025bc x86_64: Remove unneeded static PIE check for undefined weak diagnostic
edfd11197e wordexp: handle overflow in positional parameter number (bug 28011)

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>

* glibc: update to latest 2.33 HEAD (bug 28213)

9b01145592 MIPS: Setup errno for {f,l,}xstat
9c676ef514 RISC-V: Update rv64 ULPs
c6cadbf83a linux: Remove shmmax check from tst-sysvshm-linux
22d37364ae librt: add test (bug 28213)
27a78fd712 librt: fix NULL pointer dereference (bug 28213)

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>

* toolchain: glibc: Update to version 2.34

glibc version 2.34 does not provide versioned shared libraries any more,
it only provides shared libraries using the ABI version. Do not try to
copy them any more.

The functions from libpthread and librt were integrated into the main
binary, the libpthread.so and librt.so are only used for backwards
compatibility any more.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

* toolchain: glibc: Increase minimum kernel version to 5.4

Increase the minimum kernel version needed by the glibc compiled for
OpenWrt to version 5.4. With this setting the glibc build will remove
all code needed to support older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

* toolchain: glibc: Enable --enable-bind-now

Enable --enable-bind-now when CONFIG_PKG_RELRO_FULL is set. This option
is activated by default. This will enable full RELRO protection.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

* glibc: update to 2.34 HEAD

72123e1b56 NEWS: Add a bug entry for BZ #28755
08beb3a3f4 x86: Fix __wcsncmp_evex in strcmp-evex.S [BZ# 28755]
b50d5b746c x86: Fix __wcsncmp_avx2 in strcmp-avx2.S [BZ# 28755]
1b9cd6a721 NEWS: add bug entry for BZ #28769 and BZ #28770
3438bbca90 Linux: Detect user namespace support in io/tst-getcwd-smallbuff
d084965adc realpath: Avoid overwriting preexisting error (CVE-2021-3998)
472e799a5f getcwd: Set errno to ERANGE for size == 1 (CVE-2021-3999)
8c8a71c85f tst-realpath-toolong: Fix hurd build
f7a79879c0 realpath: Set errno to ENAMETOOLONG for result larger than PATH_MAX [BZ #28770]
73c362840c stdlib: Fix formatting of tests list in Makefile
269eb9d930 stdlib: Sort tests in Makefile
062ff490c1 support: Add helpers to create paths longer than PATH_MAX
82b1acd9de powerpc: Fix unrecognized instruction errors with recent binutils
1d401d1fcc x86: use default cache size if it cannot be determined [BZ #28784]
6890b8a3ae CVE-2022-23218: Buffer overflow in sunrpc svcunix_create (bug 28768)
1081f1d3dd sunrpc: Test case for clnt_create "unix" buffer overflow (bug 22542)
7b5d433fd0 CVE-2022-23219: Buffer overflow in sunrpc clnt_create for "unix" (bug 22542)
5575daae50 socket: Add the __sockaddr_un_set function
03e6e02e6a Disable debuginfod in printer tests [BZ #28757]
705f1e4606 Update syscall lists for Linux 5.16
2fe2af88ab i386: Remove broken CAN_USE_REGISTER_ASM_EBP (bug 28771)
73558ffe84 Update syscall lists for Linux 5.15
e64235ff42 powerpc: Fix unrecognized instruction errors with recent GCC

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>

* toolchain: glibc: Remove patch for ARC700

The ARC700 target was renoved, this patch is not needed any more.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

Co-authored-by: Hans Dedecker <dedeckeh@gmail.com>
Co-authored-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
aakkll 2022-02-12 12:41:46 +08:00 committed by GitHub
parent f814c21b11
commit adab80e656
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 68 deletions

View File

@ -519,10 +519,9 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
$(INSTALL_DIR) $(1)/lib
$(CP) \
$(TOOLCHAIN_DIR)/lib/ld*.so.* \
$(TOOLCHAIN_DIR)/lib/ld-$(LIBC_SO_VERSION).so \
$(1)/lib/
for file in libanl libc libcidn libcrypt libdl libm libnsl libnss_dns libnss_files libresolv libutil; do \
for file in $(TOOLCHAIN_DIR)/lib/$$$$file.so.* $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so; do \
for file in $(TOOLCHAIN_DIR)/lib/$$$$file.so.*; do \
if [ -e "$$$$file" ]; then \
$(CP) $$$$file $(1)/lib/; \
fi; \
@ -561,7 +560,6 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
ifneq ($(CONFIG_USE_MUSL),y)
$(CP) \
$(TOOLCHAIN_DIR)/lib/libpthread.so.* \
$(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so \
$(1)/lib/
endif
endef
@ -581,7 +579,6 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
ifneq ($(CONFIG_USE_MUSL),y)
$(CP) \
$(TOOLCHAIN_DIR)/lib/librt.so.* \
$(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so \
$(1)/lib/
endif
endef

View File

@ -7,13 +7,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=glibc
PKG_VERSION:=2.33
PKG_RELEASE:=2
PKG_VERSION:=2.34
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=58b90461ae100c95e0bc53d29d2187bad290ecaf
PKG_MIRROR_HASH:=33fc6ec88cbf9235b151bea67db8922ef6f42dd5c1f4ff462077224fa3916be4
PKG_SOURCE_VERSION:=72123e1b56f53f9205bb105f8a62d0869b837b22
PKG_MIRROR_HASH:=934ec7067d41da0b76b8f29a1cd03b10ba9d98c2f761f7b32f8595e59ac2b428
PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
@ -63,7 +63,8 @@ GLIBC_CONFIGURE:= \
--$(if $(CONFIG_SOFT_FLOAT),without,with)-fp \
$(if $(CONFIG_PKG_CC_STACKPROTECTOR_REGULAR),--enable-stack-protector=yes) \
$(if $(CONFIG_PKG_CC_STACKPROTECTOR_STRONG),--enable-stack-protector=strong) \
--enable-kernel=4.14.0
$(if $(CONFIG_PKG_RELRO_FULL),--enable-bind-now) \
--enable-kernel=5.4.0
export libc_cv_ssp=no
export libc_cv_ssp_strong=no

View File

@ -469,7 +469,7 @@ provides them.
* Encode Binary Data:: Encoding and Decoding of Binary Data.
* Argz and Envz Vectors:: Null-separated string vectors.
@end menu
@@ -2426,73 +2426,73 @@ functionality under a different name, su
@@ -2423,73 +2423,73 @@ functionality under a different name, su
systems it may be in @file{strings.h} instead.
@end deftypefun
@ -596,7 +596,7 @@ provides them.
/* The enhanced internationalization capabilities according to XPG4.2
are present. */
#define _XOPEN_ENH_I18N 1
@@ -1129,17 +1132,25 @@ ssize_t copy_file_range (int __infd, __o
@@ -1146,17 +1149,25 @@ ssize_t copy_file_range (int __infd, __o
extern int fdatasync (int __fildes);
#endif /* Use POSIX199309 */
@ -627,7 +627,7 @@ provides them.
range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -962,6 +962,12 @@ extern int getsubopt (char **__restrict
@@ -968,6 +968,12 @@ extern int getsubopt (char **__restrict
#endif

View File

@ -2,7 +2,7 @@ add /usr/lib to default search path for the dynamic linker
--- a/Makeconfig
+++ b/Makeconfig
@@ -601,6 +601,9 @@ else
@@ -610,6 +610,9 @@ else
default-rpath = $(libdir)
endif

View File

@ -1,55 +0,0 @@
--- a/sysdeps/arc/atomic-machine.h
+++ b/sysdeps/arc/atomic-machine.h
@@ -64,6 +64,10 @@ typedef uintmax_t uatomic_max_t;
__atomic_val_bysize (__arch_compare_and_exchange_val, int, \
mem, new, old, __ATOMIC_ACQUIRE)
+#ifdef __ARC700__
+#define atomic_full_barrier() ({ asm volatile ("sync":::"memory"); })
+#else
#define atomic_full_barrier() ({ asm volatile ("dmb 3":::"memory"); })
+#endif
#endif /* _ARC_BITS_ATOMIC_H */
--- a/sysdeps/unix/sysv/linux/arc/syscall.S
+++ b/sysdeps/unix/sysv/linux/arc/syscall.S
@@ -24,8 +24,13 @@ ENTRY (syscall)
mov_s r1, r2
mov_s r2, r3
mov_s r3, r4
+#ifdef __ARC700__
+ mov r4, r5
+ mov r5, r6
+#else
mov_s r4, r5
mov_s r5, r6
+#endif
ARC_TRAP_INSN
brhi r0, -4096, L (call_syscall_err)
--- a/sysdeps/unix/sysv/linux/arc/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arc/sysdep.h
@@ -128,7 +128,11 @@ L (call_syscall_err): ASM_LINE_SEP \
mov r8, __NR_##syscall_name ASM_LINE_SEP \
ARC_TRAP_INSN ASM_LINE_SEP
+# ifdef __ARC700__
+# define ARC_TRAP_INSN trap0
+# else
# define ARC_TRAP_INSN trap_s 0
+# endif
#else /* !__ASSEMBLER__ */
@@ -139,7 +143,11 @@ extern long int __syscall_error (long in
hidden_proto (__syscall_error)
# endif
+# ifdef __ARC700__
+# define ARC_TRAP_INSN "trap0 \n\t"
+# else
# define ARC_TRAP_INSN "trap_s 0 \n\t"
+#endif
# undef INTERNAL_SYSCALL_NCS
# define INTERNAL_SYSCALL_NCS(number, nr_args, args...) \