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/glibc.spec b/glibc.spec index d3e44a1bf8e863b56fbf9d8b4d4c040da05cc9dd..b2a11b1a477b4bbd46868f4ff6ba50472dc8c627 100644 --- a/glibc.spec +++ b/glibc.spec @@ -86,7 +86,7 @@ end} Summary: The GNU libc libraries Name: glibc Version: 2.38 -Release: 36%{?dist} +Release: 37%{?dist} License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL URL: http://www.gnu.org/software/glibc/ @@ -200,6 +200,10 @@ Patch3060: 0027-x86-Use-Avoid_Non_Temporal_Memset-to-control-non-tem.patch Patch3061: 0028-x86-Add-Avoid_STOSB-tunable-to-allow-NT-memset-witho.patch Patch3062: 0029-x86-Enable-non-temporal-memset-for-Hygon-processors.patch Patch3063: 0030-x86-Only-align-destination-to-1x-VEC_SIZE-in-memset-.patch +Patch3064: 0001-LoongArch-Update-ulps.patch +Patch3065: 0002-Add-HWCAP_LOONGARCH_LSPW-from-Linux-6.12-to-bits-hwc.patch +Patch3066: 0003-loongarch-Provide-stpcpy-in-stpcpy-aligned.S-for-rtl.patch +Patch3067: 0004-loongarch-Drop-__GI_XXX-for-strcpy-stpcpy-IFUNC-impl.patch Patch5000: 5000-one-china-principle.patch @@ -1050,6 +1054,10 @@ update_gconv_modules_cache () %endif %changelog +* Mon Aug 25 2025 Peng Fan - 2.38-37 +- [Type] sync +- [DESC] LoongArch: Sync from glibc upstream + * Wed Jul 30 2025 Shuo Wang - 2.38-36 - backport patch to fix - sysdeps: sem_open: Clear O_CREAT when semaphore file is expected to exist [BZ #30789]