!529 [sync] PR-528: LoongArch Port

From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
This commit is contained in:
openeuler-ci-bot 2022-12-21 09:50:03 +00:00 committed by Gitee
commit f147708dc8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 11609 additions and 2 deletions

11476
LoongArch-Port.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -66,7 +66,7 @@
############################################################################## ##############################################################################
Name: glibc Name: glibc
Version: 2.34 Version: 2.34
Release: 104 Release: 105
Summary: The GNU libc libraries Summary: The GNU libc libraries
License: %{all_license} License: %{all_license}
URL: http://www.gnu.org/software/glibc/ URL: http://www.gnu.org/software/glibc/
@ -268,6 +268,11 @@ Patch9018: 0002-elf-ld.so-add-testcase-for-ld.so-load-shared-object-.patch
Patch9019: 0003-elf-ld.so-use-special-mmap-for-hugepage-to-get-symbo.patch Patch9019: 0003-elf-ld.so-use-special-mmap-for-hugepage-to-get-symbo.patch
Patch9020: malloc-use-__get_nprocs-replace-__get_nprocs_sched.patch Patch9020: malloc-use-__get_nprocs-replace-__get_nprocs_sched.patch
Patch9021: x86-use-total-l3cache-for-non_temporal_threshold.patch Patch9021: x86-use-total-l3cache-for-non_temporal_threshold.patch
%ifarch loongarch64
Patch9022: login-Add-back-libutil-as-an-empty-library.patch
Patch9023: malloc-Fix-malloc-debug-for-2.35-onwards.patch
Patch9024: LoongArch-Port.patch
%endif
Provides: ldconfig rtld(GNU_HASH) bundled(gnulib) Provides: ldconfig rtld(GNU_HASH) bundled(gnulib)
@ -838,7 +843,9 @@ touch devel.filelist
touch nscd.filelist touch nscd.filelist
touch nss_modules.filelist touch nss_modules.filelist
touch nss-devel.filelist touch nss-devel.filelist
%ifnarch loongarch64
touch libnsl.filelist touch libnsl.filelist
%endif
touch debugutils.filelist touch debugutils.filelist
touch benchtests.filelist touch benchtests.filelist
touch help.filelist touch help.filelist
@ -898,7 +905,9 @@ cat master.filelist \
-e '%{_prefix}/share' \ -e '%{_prefix}/share' \
-e '/var/db/Makefile' \ -e '/var/db/Makefile' \
-e '/libnss_.*\.so[0-9.]*$' \ -e '/libnss_.*\.so[0-9.]*$' \
%ifnarch loongarch64
-e '/libnsl' \ -e '/libnsl' \
%endif
-e 'glibc-benchtests' \ -e 'glibc-benchtests' \
-e 'aux-cache' \ -e 'aux-cache' \
> glibc.filelist > glibc.filelist
@ -970,9 +979,10 @@ grep '/libnss_[a-z]*\.so$' master.filelist > nss-devel.filelist
############################################################################## ##############################################################################
# libnsl subpackage # libnsl subpackage
############################################################################## ##############################################################################
%ifnarch loongarch64
grep -E '/libnsl\.so\.[0-9]+$' master.filelist > libnsl.filelist grep -E '/libnsl\.so\.[0-9]+$' master.filelist > libnsl.filelist
test $(wc -l < libnsl.filelist) -eq 1 test $(wc -l < libnsl.filelist) -eq 1
%endif
############################################################################## ##############################################################################
# glibc debugutils sub-package # glibc debugutils sub-package
############################################################################## ##############################################################################
@ -1403,8 +1413,10 @@ fi
%files -f nss-devel.filelist nss-devel %files -f nss-devel.filelist nss-devel
%ifnarch loongarch64
%files -f libnsl.filelist -n libnsl %files -f libnsl.filelist -n libnsl
/%{_lib}/libnsl.so.1 /%{_lib}/libnsl.so.1
%endif
%files -f debugutils.filelist debugutils %files -f debugutils.filelist debugutils
@ -1426,6 +1438,15 @@ fi
%endif %endif
%changelog %changelog
* Wed Dec 21 2022 wanghongliang <wanghongliang@loongson.cn> - 2.34-105
- LoongArch Port
- Add login-Add-back-libutil-as-an-empty-library.patch from upstream
to fix libutil build error.
- Add malloc-Fix-malloc-debug-for-2.35-onwards.patch from upstream
to fix memory bug
- After glibc 2.28,removed libnsl.LoongArch Port in glibc 2.34,not support libnsl.
- Left some test fails in testsuite_whitelist.
* Fri Dec 16 2022 lijianglin <lijianglin2@huawei.com> - 2.34-104 * Fri Dec 16 2022 lijianglin <lijianglin2@huawei.com> - 2.34-104
- x86: Fix wcsnlen-avx2 page cross length comparison(BZ #29591) - x86: Fix wcsnlen-avx2 page cross length comparison(BZ #29591)

View File

@ -0,0 +1,42 @@
From b3cf94ef15f0bb6ff336907e31ab0064a0381916 Mon Sep 17 00:00:00 2001
From: Stafford Horne <shorne@gmail.com>
Date: Wed, 13 Oct 2021 21:43:50 +0900
Subject: [PATCH] login: Add back libutil as an empty library
There are several packages like sysvinit and buildroot that expect
-lutil to work. Rather than impacting them with having to change
the linker flags provide an empty libutil.a.
Signed-off-by: wanghongliang <wanghongliang@loongson.cn>
---
login/Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/login/Makefile b/login/Makefile
index 4e6b97734d..e2bdcb1b0d 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -46,10 +46,10 @@ vpath %.c programs
tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin tst-updwtmpx \
tst-pututxline-lockfail tst-pututxline-cache
-ifeq ($(have-GLIBC_2.33),yes)
# Empty compatibility library for old binaries.
extra-libs := libutil
extra-libs-others := $(extra-libs)
+ifeq ($(have-GLIBC_2.33),yes)
libutil-routines := libutil-compat
libutil-shared-only-routines := libutil-compat
@@ -57,6 +57,8 @@ libutil-shared-only-routines := libutil-compat
# link is not installed.
install-lib-ldscripts = libutil.so
$(inst_libdir)/libutil.so:
+else # not $(have-GLIBC_2.33)
+libutil-inhibit-o = $(filter-out .o,$(object-suffixes))
endif # $(have-GLIBC_2.33)
include ../Rules
--
2.31.1

View File

@ -0,0 +1,57 @@
From f1bcfde3a7b1b2606ff9f267e1e4a9cd7c65497a Mon Sep 17 00:00:00 2001
From: Stafford Horne <shorne@gmail.com>
Date: Wed, 13 Oct 2021 19:43:30 +0900
Subject: [PATCH] malloc: Fix malloc debug for 2.35 onwards
The change 1e5a5866cb ("Remove malloc hooks [BZ #23328]") has broken
ports that are using GLIBC_2_35, like the new OpenRISC port I am working
on.
The libc_malloc_debug.so library used to bring in the debug
infrastructure is currently essentially empty for GLIBC_2_35 ports like
mine causing mtrace tests to fail:
cat sysdeps/unix/sysv/linux/or1k/shlib-versions
DEFAULT GLIBC_2.35
ld=ld-linux-or1k.so.1
FAIL: posix/bug-glob2-mem
FAIL: posix/bug-regex14-mem
FAIL: posix/bug-regex2-mem
FAIL: posix/bug-regex21-mem
FAIL: posix/bug-regex31-mem
FAIL: posix/bug-regex36-mem
FAIL: malloc/tst-mtrace.
The issue seems to be with the ifdefs in malloc/malloc-debug.c. The
ifdefs are currently essentially exluding all symbols for ports > 2.35.
Removing the top level SHLIB_COMPAT ifdef allows things to just work.
Fixes: 1e5a5866cb ("Remove malloc hooks [BZ #23328]")
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Signed-off-by: wanghongliang <wanghongliang@loongson.cn>
---
malloc/malloc-debug.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/malloc/malloc-debug.c b/malloc/malloc-debug.c
index 3d7e6d44fd..99aa95b145 100644
--- a/malloc/malloc-debug.c
+++ b/malloc/malloc-debug.c
@@ -24,7 +24,6 @@
#include <unistd.h>
#include <sys/param.h>
-#if SHLIB_COMPAT (libc_malloc_debug, GLIBC_2_0, GLIBC_2_34)
/* Support only the glibc allocators. */
extern void *__libc_malloc (size_t);
extern void __libc_free (void *);
@@ -669,4 +668,3 @@ compat_symbol (libc_malloc_debug, __free_hook, __free_hook, GLIBC_2_0);
compat_symbol (libc_malloc_debug, __malloc_hook, __malloc_hook, GLIBC_2_0);
compat_symbol (libc_malloc_debug, __realloc_hook, __realloc_hook, GLIBC_2_0);
compat_symbol (libc_malloc_debug, __memalign_hook, __memalign_hook, GLIBC_2_0);
-#endif
--
2.31.1

View File

@ -127,3 +127,14 @@ rt/tst-cpuclock2
# These testcase fails because rseq is disabled by default # These testcase fails because rseq is disabled by default
misc/tst-rseq-nptl misc/tst-rseq-nptl
misc/tst-rseq misc/tst-rseq
# These testcase fails as left problems.
FAIL: elf/tst-ifunc-fault-bindnow:LoongArch64
FAIL: elf/tst-ifunc-fault-lazy:LoongArch64
FAIL: math/test-double-acos:LoongArch64
FAIL: math/test-double-asin:LoongArch64
FAIL: math/test-float32x-acos:LoongArch64
FAIL: math/test-float32x-asin:LoongArch64
FAIL: math/test-float64-acos:LoongArch64
FAIL: math/test-float64-asin:LoongArch64
FAIL: locale/tst-localedef-path-norm:LoongArch64