diff --git a/0001-LoongArch-Update-ulps.patch b/0001-LoongArch-Update-ulps.patch new file mode 100644 index 0000000000000000000000000000000000000000..7c27ebdc8051e060587e78e22619a388305d5cc4 --- /dev/null +++ b/0001-LoongArch-Update-ulps.patch @@ -0,0 +1,38 @@ +From c988fdee39681d2fc118126fe6ecc9704c1d704c Mon Sep 17 00:00:00 2001 +From: caiyinyu +Date: Mon, 11 Nov 2024 09:56:05 +0800 +Subject: [PATCH 1/4] LoongArch: Update ulps + +Needed for test-float-cacosh, test-float-csin, test-float32-cacosh and +test-float32-csin. + +Signed-off-by: caiyinyu +Reviewed-by: Florian Weimer +--- + sysdeps/loongarch/lp64/libm-test-ulps | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/sysdeps/loongarch/lp64/libm-test-ulps b/sysdeps/loongarch/lp64/libm-test-ulps +index 770bf36b..4ecc0e65 100644 +--- a/sysdeps/loongarch/lp64/libm-test-ulps ++++ b/sysdeps/loongarch/lp64/libm-test-ulps +@@ -228,7 +228,7 @@ ldouble: 3 + + Function: Real part of "cacosh_upward": + double: 4 +-float: 3 ++float: 4 + ldouble: 6 + + Function: Imaginary part of "cacosh_upward": +@@ -720,6 +720,7 @@ float: 1 + ldouble: 1 + + Function: Imaginary part of "csin": ++float: 1 + ldouble: 1 + + Function: Real part of "csin_downward": +-- +2.47.3 + diff --git a/0002-Add-HWCAP_LOONGARCH_LSPW-from-Linux-6.12-to-bits-hwc.patch b/0002-Add-HWCAP_LOONGARCH_LSPW-from-Linux-6.12-to-bits-hwc.patch new file mode 100644 index 0000000000000000000000000000000000000000..97144fede1866b59f0a24439fe9f75be487f33b1 --- /dev/null +++ b/0002-Add-HWCAP_LOONGARCH_LSPW-from-Linux-6.12-to-bits-hwc.patch @@ -0,0 +1,25 @@ +From f8661bbdd3abe67c08d40ba88c6a9e02c0a51f25 Mon Sep 17 00:00:00 2001 +From: Joseph Myers +Date: Fri, 20 Dec 2024 11:47:03 +0000 +Subject: [PATCH 2/4] Add HWCAP_LOONGARCH_LSPW from Linux 6.12 to bits/hwcap.h + +Add the new Linux 6.12 HWCAP_LOONGARCH_LSPW to the corresponding +bits/hwcap.h. + +Tested with build-many-glibcs.py for loongarch64-linux-gnu-lp64d. +--- + sysdeps/unix/sysv/linux/loongarch/bits/hwcap.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sysdeps/unix/sysv/linux/loongarch/bits/hwcap.h b/sysdeps/unix/sysv/linux/loongarch/bits/hwcap.h +index 7acec23d..fa9f4bd7 100644 +--- a/sysdeps/unix/sysv/linux/loongarch/bits/hwcap.h ++++ b/sysdeps/unix/sysv/linux/loongarch/bits/hwcap.h +@@ -36,3 +36,4 @@ + #define HWCAP_LOONGARCH_LBT_ARM (1 << 11) + #define HWCAP_LOONGARCH_LBT_MIPS (1 << 12) + #define HWCAP_LOONGARCH_PTW (1 << 13) ++#define HWCAP_LOONGARCH_LSPW (1 << 14) +-- +2.47.3 + diff --git a/0003-loongarch-Provide-stpcpy-in-stpcpy-aligned.S-for-rtl.patch b/0003-loongarch-Provide-stpcpy-in-stpcpy-aligned.S-for-rtl.patch new file mode 100644 index 0000000000000000000000000000000000000000..d837523e6aabbb7af60bf20bd5ce6505bea6780b --- /dev/null +++ b/0003-loongarch-Provide-stpcpy-in-stpcpy-aligned.S-for-rtl.patch @@ -0,0 +1,29 @@ +From d505aa00528b702c9fb451ada22055598d8c76c8 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Sat, 4 Jan 2025 05:43:21 +0800 +Subject: [PATCH 3/4] loongarch: Provide stpcpy in stpcpy-aligned.S for rtld + [BZ #32512] + +When stpcpy-aligned.S is used in rtld, provide stpcpy as a weak alias of +__stpcpy. This fixes BZ #32512. + +Signed-off-by: H.J. Lu +--- + sysdeps/loongarch/lp64/multiarch/stpcpy-aligned.S | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sysdeps/loongarch/lp64/multiarch/stpcpy-aligned.S b/sysdeps/loongarch/lp64/multiarch/stpcpy-aligned.S +index 1f763db6..99f2c270 100644 +--- a/sysdeps/loongarch/lp64/multiarch/stpcpy-aligned.S ++++ b/sysdeps/loongarch/lp64/multiarch/stpcpy-aligned.S +@@ -20,6 +20,7 @@ + # define STPCPY __stpcpy_aligned + #else + # define STPCPY __stpcpy ++weak_alias (__stpcpy, stpcpy) + #endif + + #define USE_AS_STPCPY +-- +2.47.3 + diff --git a/0004-loongarch-Drop-__GI_XXX-for-strcpy-stpcpy-IFUNC-impl.patch b/0004-loongarch-Drop-__GI_XXX-for-strcpy-stpcpy-IFUNC-impl.patch new file mode 100644 index 0000000000000000000000000000000000000000..63b8e1055ef8312921f6ef2b1376ac94928f5adb --- /dev/null +++ b/0004-loongarch-Drop-__GI_XXX-for-strcpy-stpcpy-IFUNC-impl.patch @@ -0,0 +1,61 @@ +From fb7ee7cf7743ec8358678516e3e73471491a995f Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Sat, 4 Jan 2025 05:53:19 +0800 +Subject: [PATCH 4/4] loongarch: Drop __GI_XXX for strcpy/stpcpy IFUNC + implementations + +There is no need for __GI_XXX symbols, like __GI___strcpy_aligned since +__strcpy_aligned is used directly. + +Signed-off-by: H.J. Lu +Reviewed-by: Sam James +--- + sysdeps/loongarch/lp64/multiarch/strcpy-aligned.S | 2 -- + sysdeps/loongarch/lp64/multiarch/strcpy-lasx.S | 1 - + sysdeps/loongarch/lp64/multiarch/strcpy-lsx.S | 1 - + sysdeps/loongarch/lp64/multiarch/strcpy-unaligned.S | 1 - + 4 files changed, 5 deletions(-) + +diff --git a/sysdeps/loongarch/lp64/multiarch/strcpy-aligned.S b/sysdeps/loongarch/lp64/multiarch/strcpy-aligned.S +index 4ed539fd..1913fa63 100644 +--- a/sysdeps/loongarch/lp64/multiarch/strcpy-aligned.S ++++ b/sysdeps/loongarch/lp64/multiarch/strcpy-aligned.S +@@ -198,5 +198,3 @@ L(un_out): + #endif + jr ra + END(STRCPY) +- +-libc_hidden_builtin_def (STRCPY) +diff --git a/sysdeps/loongarch/lp64/multiarch/strcpy-lasx.S b/sysdeps/loongarch/lp64/multiarch/strcpy-lasx.S +index c2825612..3f20d359 100644 +--- a/sysdeps/loongarch/lp64/multiarch/strcpy-lasx.S ++++ b/sysdeps/loongarch/lp64/multiarch/strcpy-lasx.S +@@ -211,5 +211,4 @@ L(zero_byte): + jr ra + END(STRCPY) + +-libc_hidden_builtin_def (STRCPY) + #endif +diff --git a/sysdeps/loongarch/lp64/multiarch/strcpy-lsx.S b/sysdeps/loongarch/lp64/multiarch/strcpy-lsx.S +index fc2498f7..b3e7ec89 100644 +--- a/sysdeps/loongarch/lp64/multiarch/strcpy-lsx.S ++++ b/sysdeps/loongarch/lp64/multiarch/strcpy-lsx.S +@@ -208,5 +208,4 @@ L(INDEX): + .dword 0x0706050403020100 + .dword 0x0f0e0d0c0b0a0908 + +-libc_hidden_builtin_def (STRCPY) + #endif +diff --git a/sysdeps/loongarch/lp64/multiarch/strcpy-unaligned.S b/sysdeps/loongarch/lp64/multiarch/strcpy-unaligned.S +index 9e31883b..fee2a7c4 100644 +--- a/sysdeps/loongarch/lp64/multiarch/strcpy-unaligned.S ++++ b/sysdeps/loongarch/lp64/multiarch/strcpy-unaligned.S +@@ -134,5 +134,4 @@ L(page_cross): + b L(end) + END(STRCPY) + +-libc_hidden_builtin_def (STRCPY) + #endif +-- +2.47.3 + diff --git a/1111-LoongArch-common-sync-from-upstream.patch b/1111-LoongArch-common-sync-from-upstream.patch new file mode 100644 index 0000000000000000000000000000000000000000..9ff7901e84655393c6bf27d8505440d061978d92 --- /dev/null +++ b/1111-LoongArch-common-sync-from-upstream.patch @@ -0,0 +1,230 @@ +From 9c1d39e69c8324cd00c62933b09835e49cb87eca Mon Sep 17 00:00:00 2001 +From: Peng Fan +Date: Mon, 4 Aug 2025 15:14:36 +0800 +Subject: [PATCH] LoongArch: common sync from upstream + +Signed-off-by: Peng Fan +--- + 0001-LoongArch-Update-ulps.patch | 38 ++++++++++++ + ...RCH_LSPW-from-Linux-6.12-to-bits-hwc.patch | 25 ++++++++ + ...e-stpcpy-in-stpcpy-aligned.S-for-rtl.patch | 29 +++++++++ + ..._GI_XXX-for-strcpy-stpcpy-IFUNC-impl.patch | 61 +++++++++++++++++++ + glibc.spec | 10 ++- + 5 files changed, 162 insertions(+), 1 deletion(-) + create mode 100644 0001-LoongArch-Update-ulps.patch + create mode 100644 0002-Add-HWCAP_LOONGARCH_LSPW-from-Linux-6.12-to-bits-hwc.patch + create mode 100644 0003-loongarch-Provide-stpcpy-in-stpcpy-aligned.S-for-rtl.patch + create mode 100644 0004-loongarch-Drop-__GI_XXX-for-strcpy-stpcpy-IFUNC-impl.patch + +diff --git a/0001-LoongArch-Update-ulps.patch b/0001-LoongArch-Update-ulps.patch +new file mode 100644 +index 0000000..7c27ebd +--- /dev/null ++++ b/0001-LoongArch-Update-ulps.patch +@@ -0,0 +1,38 @@ ++From c988fdee39681d2fc118126fe6ecc9704c1d704c Mon Sep 17 00:00:00 2001 ++From: caiyinyu ++Date: Mon, 11 Nov 2024 09:56:05 +0800 ++Subject: [PATCH 1/4] LoongArch: Update ulps ++ ++Needed for test-float-cacosh, test-float-csin, test-float32-cacosh and ++test-float32-csin. ++ ++Signed-off-by: caiyinyu ++Reviewed-by: Florian Weimer ++--- ++ sysdeps/loongarch/lp64/libm-test-ulps | 3 ++- ++ 1 file changed, 2 insertions(+), 1 deletion(-) ++ ++diff --git a/sysdeps/loongarch/lp64/libm-test-ulps b/sysdeps/loongarch/lp64/libm-test-ulps ++index 770bf36b..4ecc0e65 100644 ++--- a/sysdeps/loongarch/lp64/libm-test-ulps +++++ b/sysdeps/loongarch/lp64/libm-test-ulps ++@@ -228,7 +228,7 @@ ldouble: 3 ++ ++ Function: Real part of "cacosh_upward": ++ double: 4 ++-float: 3 +++float: 4 ++ ldouble: 6 ++ ++ Function: Imaginary part of "cacosh_upward": ++@@ -720,6 +720,7 @@ float: 1 ++ ldouble: 1 ++ ++ Function: Imaginary part of "csin": +++float: 1 ++ ldouble: 1 ++ ++ Function: Real part of "csin_downward": ++-- ++2.47.3 ++ +diff --git a/0002-Add-HWCAP_LOONGARCH_LSPW-from-Linux-6.12-to-bits-hwc.patch b/0002-Add-HWCAP_LOONGARCH_LSPW-from-Linux-6.12-to-bits-hwc.patch +new file mode 100644 +index 0000000..97144fe +--- /dev/null ++++ b/0002-Add-HWCAP_LOONGARCH_LSPW-from-Linux-6.12-to-bits-hwc.patch +@@ -0,0 +1,25 @@ ++From f8661bbdd3abe67c08d40ba88c6a9e02c0a51f25 Mon Sep 17 00:00:00 2001 ++From: Joseph Myers ++Date: Fri, 20 Dec 2024 11:47:03 +0000 ++Subject: [PATCH 2/4] Add HWCAP_LOONGARCH_LSPW from Linux 6.12 to bits/hwcap.h ++ ++Add the new Linux 6.12 HWCAP_LOONGARCH_LSPW to the corresponding ++bits/hwcap.h. ++ ++Tested with build-many-glibcs.py for loongarch64-linux-gnu-lp64d. ++--- ++ sysdeps/unix/sysv/linux/loongarch/bits/hwcap.h | 1 + ++ 1 file changed, 1 insertion(+) ++ ++diff --git a/sysdeps/unix/sysv/linux/loongarch/bits/hwcap.h b/sysdeps/unix/sysv/linux/loongarch/bits/hwcap.h ++index 7acec23d..fa9f4bd7 100644 ++--- a/sysdeps/unix/sysv/linux/loongarch/bits/hwcap.h +++++ b/sysdeps/unix/sysv/linux/loongarch/bits/hwcap.h ++@@ -36,3 +36,4 @@ ++ #define HWCAP_LOONGARCH_LBT_ARM (1 << 11) ++ #define HWCAP_LOONGARCH_LBT_MIPS (1 << 12) ++ #define HWCAP_LOONGARCH_PTW (1 << 13) +++#define HWCAP_LOONGARCH_LSPW (1 << 14) ++-- ++2.47.3 ++ +diff --git a/0003-loongarch-Provide-stpcpy-in-stpcpy-aligned.S-for-rtl.patch b/0003-loongarch-Provide-stpcpy-in-stpcpy-aligned.S-for-rtl.patch +new file mode 100644 +index 0000000..d837523 +--- /dev/null ++++ b/0003-loongarch-Provide-stpcpy-in-stpcpy-aligned.S-for-rtl.patch +@@ -0,0 +1,29 @@ ++From d505aa00528b702c9fb451ada22055598d8c76c8 Mon Sep 17 00:00:00 2001 ++From: "H.J. Lu" ++Date: Sat, 4 Jan 2025 05:43:21 +0800 ++Subject: [PATCH 3/4] loongarch: Provide stpcpy in stpcpy-aligned.S for rtld ++ [BZ #32512] ++ ++When stpcpy-aligned.S is used in rtld, provide stpcpy as a weak alias of ++__stpcpy. This fixes BZ #32512. ++ ++Signed-off-by: H.J. Lu ++--- ++ sysdeps/loongarch/lp64/multiarch/stpcpy-aligned.S | 1 + ++ 1 file changed, 1 insertion(+) ++ ++diff --git a/sysdeps/loongarch/lp64/multiarch/stpcpy-aligned.S b/sysdeps/loongarch/lp64/multiarch/stpcpy-aligned.S ++index 1f763db6..99f2c270 100644 ++--- a/sysdeps/loongarch/lp64/multiarch/stpcpy-aligned.S +++++ b/sysdeps/loongarch/lp64/multiarch/stpcpy-aligned.S ++@@ -20,6 +20,7 @@ ++ # define STPCPY __stpcpy_aligned ++ #else ++ # define STPCPY __stpcpy +++weak_alias (__stpcpy, stpcpy) ++ #endif ++ ++ #define USE_AS_STPCPY ++-- ++2.47.3 ++ +diff --git a/0004-loongarch-Drop-__GI_XXX-for-strcpy-stpcpy-IFUNC-impl.patch b/0004-loongarch-Drop-__GI_XXX-for-strcpy-stpcpy-IFUNC-impl.patch +new file mode 100644 +index 0000000..63b8e10 +--- /dev/null ++++ b/0004-loongarch-Drop-__GI_XXX-for-strcpy-stpcpy-IFUNC-impl.patch +@@ -0,0 +1,61 @@ ++From fb7ee7cf7743ec8358678516e3e73471491a995f Mon Sep 17 00:00:00 2001 ++From: "H.J. Lu" ++Date: Sat, 4 Jan 2025 05:53:19 +0800 ++Subject: [PATCH 4/4] loongarch: Drop __GI_XXX for strcpy/stpcpy IFUNC ++ implementations ++ ++There is no need for __GI_XXX symbols, like __GI___strcpy_aligned since ++__strcpy_aligned is used directly. ++ ++Signed-off-by: H.J. Lu ++Reviewed-by: Sam James ++--- ++ sysdeps/loongarch/lp64/multiarch/strcpy-aligned.S | 2 -- ++ sysdeps/loongarch/lp64/multiarch/strcpy-lasx.S | 1 - ++ sysdeps/loongarch/lp64/multiarch/strcpy-lsx.S | 1 - ++ sysdeps/loongarch/lp64/multiarch/strcpy-unaligned.S | 1 - ++ 4 files changed, 5 deletions(-) ++ ++diff --git a/sysdeps/loongarch/lp64/multiarch/strcpy-aligned.S b/sysdeps/loongarch/lp64/multiarch/strcpy-aligned.S ++index 4ed539fd..1913fa63 100644 ++--- a/sysdeps/loongarch/lp64/multiarch/strcpy-aligned.S +++++ b/sysdeps/loongarch/lp64/multiarch/strcpy-aligned.S ++@@ -198,5 +198,3 @@ L(un_out): ++ #endif ++ jr ra ++ END(STRCPY) ++- ++-libc_hidden_builtin_def (STRCPY) ++diff --git a/sysdeps/loongarch/lp64/multiarch/strcpy-lasx.S b/sysdeps/loongarch/lp64/multiarch/strcpy-lasx.S ++index c2825612..3f20d359 100644 ++--- a/sysdeps/loongarch/lp64/multiarch/strcpy-lasx.S +++++ b/sysdeps/loongarch/lp64/multiarch/strcpy-lasx.S ++@@ -211,5 +211,4 @@ L(zero_byte): ++ jr ra ++ END(STRCPY) ++ ++-libc_hidden_builtin_def (STRCPY) ++ #endif ++diff --git a/sysdeps/loongarch/lp64/multiarch/strcpy-lsx.S b/sysdeps/loongarch/lp64/multiarch/strcpy-lsx.S ++index fc2498f7..b3e7ec89 100644 ++--- a/sysdeps/loongarch/lp64/multiarch/strcpy-lsx.S +++++ b/sysdeps/loongarch/lp64/multiarch/strcpy-lsx.S ++@@ -208,5 +208,4 @@ L(INDEX): ++ .dword 0x0706050403020100 ++ .dword 0x0f0e0d0c0b0a0908 ++ ++-libc_hidden_builtin_def (STRCPY) ++ #endif ++diff --git a/sysdeps/loongarch/lp64/multiarch/strcpy-unaligned.S b/sysdeps/loongarch/lp64/multiarch/strcpy-unaligned.S ++index 9e31883b..fee2a7c4 100644 ++--- a/sysdeps/loongarch/lp64/multiarch/strcpy-unaligned.S +++++ b/sysdeps/loongarch/lp64/multiarch/strcpy-unaligned.S ++@@ -134,5 +134,4 @@ L(page_cross): ++ b L(end) ++ END(STRCPY) ++ ++-libc_hidden_builtin_def (STRCPY) ++ #endif ++-- ++2.47.3 ++ +diff --git a/glibc.spec b/glibc.spec +index cfe4699..5714bd6 100644 +--- a/glibc.spec ++++ b/glibc.spec +@@ -1,4 +1,4 @@ +-%define anolis_release 11 ++%define anolis_release 12 + + %bcond_without testsuite + %bcond_without benchtests +@@ -177,6 +177,11 @@ Patch3059: 0009-x86-Add-Avoid_STOSB-tunable-to-allow-NT-memset-witho.patch + Patch3060: 0010-x86-Enable-non-temporal-memset-for-Hygon-processors.patch + Patch3061: 0011-x86-Improve-large-memset-perf-with-non-temporal-stor.patch + ++Patch3062: 0001-LoongArch-Update-ulps.patch ++Patch3063: 0002-Add-HWCAP_LOONGARCH_LSPW-from-Linux-6.12-to-bits-hwc.patch ++Patch3064: 0003-loongarch-Provide-stpcpy-in-stpcpy-aligned.S-for-rtl.patch ++Patch3065: 0004-loongarch-Drop-__GI_XXX-for-strcpy-stpcpy-IFUNC-impl.patch ++ + BuildRequires: audit-libs-devel >= 1.1.3 libcap-devel systemtap-sdt-devel + BuildRequires: procps-ng util-linux gawk sed >= 3.95 gettext + BuildRequires: python3 python3-devel +@@ -1139,6 +1144,9 @@ update_gconv_modules_cache () + %{_libdir}/libpthread_nonshared.a + + %changelog ++* Mon Aug 4 2025 Peng Fan - 2.38-12 ++- Sync from glibc upstream ++ + * Wed Jun 18 2025 xiajiamei - 2.38-11 + - Add patches to support Hygon + +-- +2.33.0 + diff --git a/glibc.spec b/glibc.spec index 61d2d628eba317237fc93965c84908d8f98427ee..829e83ad4e8ae59c2fcba4acb672b4b413372be0 100644 --- a/glibc.spec +++ b/glibc.spec @@ -67,7 +67,7 @@ ############################################################################## Name: glibc Version: 2.38 -Release: 65 +Release: 66 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -308,6 +308,10 @@ Patch218: malloc-add-indirection-for-malloc-like-functions-in-.patch Patch219: malloc-obscure-calloc-use-in-tst-calloc.patch Patch220: malloc-cleanup-casts-in-tst-calloc.patch Patch221: posix-Fix-double-free-after-allocation-failure-in-re.patch +Patch222: 0001-LoongArch-Update-ulps.patch +Patch223: 0002-Add-HWCAP_LOONGARCH_LSPW-from-Linux-6.12-to-bits-hwc.patch +Patch224: 0003-loongarch-Provide-stpcpy-in-stpcpy-aligned.S-for-rtl.patch +Patch225: 0004-loongarch-Drop-__GI_XXX-for-strcpy-stpcpy-IFUNC-impl.patch #openEuler patch list Patch9000: turn-default-value-of-x86_rep_stosb_threshold_form_2K_to_1M.patch @@ -1535,6 +1539,9 @@ fi %endif %changelog +* Mon Aug 25 2025 Peng Fan - 2.38-66 +- LoongArch: Sync from glibc upstream + * Thu Jul 24 2025 Qingqing Li - 2.38-65 - posix: Fix double-free after allocation failure in regcomp (bug 33185 CVE-2025-8058)