-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3910 from arnaldo2792/update-glibc
glibc: update with latest 2.38 patches
- Loading branch information
Showing
27 changed files
with
3,890 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
packages/glibc/0045-x86_64-Optimize-ffsll-function-code-size.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
From 30e546d76e756fe4d2d20a8b2286de4fbf30ceb5 Mon Sep 17 00:00:00 2001 | ||
From: Sunil K Pandey <[email protected]> | ||
Date: Wed, 26 Jul 2023 08:34:05 -0700 | ||
Subject: [PATCH] x86_64: Optimize ffsll function code size. | ||
|
||
Ffsll function randomly regress by ~20%, depending on how code gets | ||
aligned in memory. Ffsll function code size is 17 bytes. Since default | ||
function alignment is 16 bytes, it can load on 16, 32, 48 or 64 bytes | ||
aligned memory. When ffsll function load at 16, 32 or 64 bytes aligned | ||
memory, entire code fits in single 64 bytes cache line. When ffsll | ||
function load at 48 bytes aligned memory, it splits in two cache line, | ||
hence random regression. | ||
|
||
Ffsll function size reduction from 17 bytes to 12 bytes ensures that it | ||
will always fit in single 64 bytes cache line. | ||
|
||
This patch fixes ffsll function random performance regression. | ||
|
||
Reviewed-by: Carlos O'Donell <[email protected]> | ||
(cherry picked from commit 9d94997b5f9445afd4f2bccc5fa60ff7c4361ec1) | ||
--- | ||
sysdeps/x86_64/ffsll.c | 10 +++++----- | ||
1 file changed, 5 insertions(+), 5 deletions(-) | ||
|
||
diff --git a/sysdeps/x86_64/ffsll.c b/sysdeps/x86_64/ffsll.c | ||
index a1c13d4906..0c6680735c 100644 | ||
--- a/sysdeps/x86_64/ffsll.c | ||
+++ b/sysdeps/x86_64/ffsll.c | ||
@@ -26,13 +26,13 @@ int | ||
ffsll (long long int x) | ||
{ | ||
long long int cnt; | ||
- long long int tmp; | ||
|
||
- asm ("bsfq %2,%0\n" /* Count low bits in X and store in %1. */ | ||
- "cmoveq %1,%0\n" /* If number was zero, use -1 as result. */ | ||
- : "=&r" (cnt), "=r" (tmp) : "rm" (x), "1" (-1)); | ||
+ asm ("mov $-1,%k0\n" /* Initialize cnt to -1. */ | ||
+ "bsf %1,%0\n" /* Count low bits in x and store in cnt. */ | ||
+ "inc %k0\n" /* Increment cnt by 1. */ | ||
+ : "=&r" (cnt) : "r" (x)); | ||
|
||
- return cnt + 1; | ||
+ return cnt; | ||
} | ||
|
||
#ifndef __ILP32__ | ||
-- | ||
2.44.0 | ||
|
66 changes: 66 additions & 0 deletions
66
packages/glibc/0046-S390-Fix-building-with-disable-mutli-arch-BZ-31196.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
From 18876c9ff52c3d9aefe2c663b1a287589bebedc0 Mon Sep 17 00:00:00 2001 | ||
From: Stefan Liebler <[email protected]> | ||
Date: Tue, 30 Jan 2024 09:34:32 +0100 | ||
Subject: [PATCH] S390: Fix building with --disable-mutli-arch [BZ #31196] | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
Starting with commits | ||
- 7ea510127e2067efa07865158ac92c330c379950 | ||
string: Add libc_hidden_proto for strchrnul | ||
- 22999b2f0fb62eed1af4095d062bd1272d6afeb1 | ||
string: Add libc_hidden_proto for memrchr | ||
|
||
building glibc on s390x with --disable-multi-arch fails if only | ||
the C-variant of strchrnul / memrchr is used. This is the case | ||
if gcc uses -march < z13. | ||
|
||
The build fails with: | ||
../sysdeps/s390/strchrnul-c.c:28:49: error: ‘__strchrnul_c’ undeclared here (not in a function); did you mean ‘__strchrnul’? | ||
28 | __hidden_ver1 (__strchrnul_c, __GI___strchrnul, __strchrnul_c); | ||
|
||
With --disable-multi-arch, __strchrnul_c is not available as string/strchrnul.c | ||
is just included without defining STRCHRNUL and thus we also don't have to create | ||
the internal hidden symbol. | ||
|
||
Tested-by: Andreas K. Hüttel <[email protected]> | ||
(cherry picked from commit cc1b91eabd806057aa7e3058a84bf129ed36e157) | ||
--- | ||
sysdeps/s390/memrchr-c.c | 4 +++- | ||
sysdeps/s390/strchrnul-c.c | 4 +++- | ||
2 files changed, 6 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/sysdeps/s390/memrchr-c.c b/sysdeps/s390/memrchr-c.c | ||
index bdf3c7bbe0..fadd63087a 100644 | ||
--- a/sysdeps/s390/memrchr-c.c | ||
+++ b/sysdeps/s390/memrchr-c.c | ||
@@ -25,7 +25,9 @@ | ||
|
||
# include <string/memrchr.c> | ||
|
||
-# if defined SHARED && IS_IN (libc) | ||
+# if HAVE_MEMRCHR_IFUNC | ||
+# if defined SHARED && IS_IN (libc) | ||
__hidden_ver1 (__memrchr_c, __GI___memrchr, __memrchr_c); | ||
+# endif | ||
# endif | ||
#endif | ||
diff --git a/sysdeps/s390/strchrnul-c.c b/sysdeps/s390/strchrnul-c.c | ||
index f6f5bae311..97fbc16edb 100644 | ||
--- a/sysdeps/s390/strchrnul-c.c | ||
+++ b/sysdeps/s390/strchrnul-c.c | ||
@@ -24,7 +24,9 @@ | ||
# endif | ||
|
||
# include <string/strchrnul.c> | ||
-# if defined SHARED && IS_IN (libc) | ||
+# if HAVE_STRCHRNUL_IFUNC | ||
+# if defined SHARED && IS_IN (libc) | ||
__hidden_ver1 (__strchrnul_c, __GI___strchrnul, __strchrnul_c); | ||
+# endif | ||
# endif | ||
#endif | ||
-- | ||
2.44.0 | ||
|
43 changes: 43 additions & 0 deletions
43
packages/glibc/0047-sparc-Fix-broken-memset-for-sparc32-BZ-31068.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
From 6f68075869f6034f5fde3823741623d34164dc7d Mon Sep 17 00:00:00 2001 | ||
From: Andreas Larsson <[email protected]> | ||
Date: Wed, 15 Nov 2023 13:29:43 +0100 | ||
Subject: [PATCH] sparc: Fix broken memset for sparc32 [BZ #31068] | ||
|
||
Fixes commit a61933fe27df ("sparc: Remove bzero optimization") that | ||
after moving code jumped to the wrong label 4. | ||
|
||
Verfied by successfully running string/test-memset on sparc32. | ||
|
||
Signed-off-by: Andreas Larsson <[email protected]> | ||
Signed-off-by: Ludwig Rydberg <[email protected]> | ||
Reviewed-by: Adhemerval Zanella <[email protected]> | ||
(cherry picked from commit 578190b7e43305141512dee777e4a3b3e8159393) | ||
--- | ||
sysdeps/sparc/sparc32/memset.S | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/sysdeps/sparc/sparc32/memset.S b/sysdeps/sparc/sparc32/memset.S | ||
index ca29ff5685..1dc3a640e8 100644 | ||
--- a/sysdeps/sparc/sparc32/memset.S | ||
+++ b/sysdeps/sparc/sparc32/memset.S | ||
@@ -55,7 +55,7 @@ ENTRY(memset) | ||
|
||
andcc %o0, 3, %o2 | ||
bne 3f | ||
-4: andcc %o0, 4, %g0 | ||
+5: andcc %o0, 4, %g0 | ||
|
||
be 2f | ||
mov %g3, %g2 | ||
@@ -139,7 +139,7 @@ ENTRY(memset) | ||
stb %g3, [%o0 + 0x02] | ||
2: sub %o2, 4, %o2 | ||
add %o1, %o2, %o1 | ||
- b 4b | ||
+ b 5b | ||
sub %o0, %o2, %o0 | ||
END(memset) | ||
libc_hidden_builtin_def (memset) | ||
-- | ||
2.44.0 | ||
|
42 changes: 42 additions & 0 deletions
42
packages/glibc/0048-sparc64-Remove-unwind-information-from-signal-return.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
From 0e383d2d4e7c08b36ad3edb30c072a3dc4d26ed8 Mon Sep 17 00:00:00 2001 | ||
From: Adhemerval Zanella <[email protected]> | ||
Date: Wed, 17 Jan 2024 10:38:09 -0300 | ||
Subject: [PATCH] sparc64: Remove unwind information from signal return stubs | ||
[BZ#31244] | ||
|
||
Similar to sparc32 fix, remove the unwind information on the signal | ||
return stubs. This fixes the regressions: | ||
|
||
FAIL: nptl/tst-cancel24-static | ||
FAIL: nptl/tst-cond8-static | ||
FAIL: nptl/tst-mutex8-static | ||
FAIL: nptl/tst-mutexpi8-static | ||
FAIL: nptl/tst-mutexpi9 | ||
|
||
On sparc64-linux-gnu. | ||
|
||
(cherry picked from commit 369efd817780276dbe0ecf8be6e1f354bdbc9857) | ||
--- | ||
sysdeps/unix/sysv/linux/sparc/sparc64/sigreturn_stub.S | 7 +++++-- | ||
1 file changed, 5 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigreturn_stub.S b/sysdeps/unix/sysv/linux/sparc/sparc64/sigreturn_stub.S | ||
index 7fac04f657..f089bcaf68 100644 | ||
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigreturn_stub.S | ||
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sigreturn_stub.S | ||
@@ -23,7 +23,10 @@ | ||
|
||
[1] https://lkml.org/lkml/2016/5/27/465 */ | ||
|
||
-ENTRY (__rt_sigreturn_stub) | ||
+ nop | ||
+ nop | ||
+ | ||
+ENTRY_NOCFI (__rt_sigreturn_stub) | ||
mov __NR_rt_sigreturn, %g1 | ||
ta 0x6d | ||
-END (__rt_sigreturn_stub) | ||
+END_NOCFI (__rt_sigreturn_stub) | ||
-- | ||
2.44.0 | ||
|
32 changes: 32 additions & 0 deletions
32
packages/glibc/0049-sparc-Fix-sparc64-memmove-length-comparison-BZ-31266.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From aac57faf5425b472a72132b09f4b3a2aa1f77a63 Mon Sep 17 00:00:00 2001 | ||
From: Adhemerval Zanella <[email protected]> | ||
Date: Thu, 18 Jan 2024 10:52:18 -0300 | ||
Subject: [PATCH] sparc: Fix sparc64 memmove length comparison (BZ 31266) | ||
|
||
The small counts copy bytes comparsion should be unsigned (as the | ||
memmove size argument). It fixes string/tst-memmove-overflow on | ||
sparcv9, where the input size triggers an invalid code path. | ||
|
||
Checked on sparc64-linux-gnu and sparcv9-linux-gnu. | ||
|
||
(cherry picked from commit 926a4bdbb5fc8955570208b5571b2d04c6ffbd1d) | ||
--- | ||
sysdeps/sparc/sparc64/memmove.S | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/sysdeps/sparc/sparc64/memmove.S b/sysdeps/sparc/sparc64/memmove.S | ||
index db6f4f0e84..62b19ebc1b 100644 | ||
--- a/sysdeps/sparc/sparc64/memmove.S | ||
+++ b/sysdeps/sparc/sparc64/memmove.S | ||
@@ -38,7 +38,7 @@ ENTRY(memmove) | ||
/* | ||
* normal, copy forwards | ||
*/ | ||
-2: ble %XCC, .Ldbytecp | ||
+2: bleu %XCC, .Ldbytecp | ||
andcc %o1, 3, %o5 /* is src word aligned */ | ||
bz,pn %icc, .Laldst | ||
cmp %o5, 2 /* is src half-word aligned */ | ||
-- | ||
2.44.0 | ||
|
74 changes: 74 additions & 0 deletions
74
packages/glibc/0050-sparc-Remove-unwind-information-from-signal-return-s.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
From 0c5e5bace57578ed3e28eb89ee2d2b31b74c4ecc Mon Sep 17 00:00:00 2001 | ||
From: Daniel Cederman <[email protected]> | ||
Date: Tue, 16 Jan 2024 09:31:41 +0100 | ||
Subject: [PATCH] sparc: Remove unwind information from signal return stubs [BZ | ||
#31244] | ||
|
||
The functions were previously written in C, but were not compiled | ||
with unwind information. The ENTRY/END macros includes .cfi_startproc | ||
and .cfi_endproc which adds unwind information. This caused the | ||
tests cleanup-8 and cleanup-10 in the GCC testsuite to fail. | ||
This patch adds a version of the ENTRY/END macros without the | ||
CFI instructions that can be used instead. | ||
|
||
sigaction registers a restorer address that is located two instructions | ||
before the stub function. This patch adds a two instruction padding to | ||
avoid that the unwinder accesses the unwind information from the function | ||
that the linker has placed right before it in memory. This fixes an issue | ||
with pthread_cancel that caused tst-mutex8-static (and other tests) to fail. | ||
|
||
Signed-off-by: Daniel Cederman <[email protected]> | ||
Reviewed-by: Adhemerval Zanella <[email protected]> | ||
(cherry picked from commit 7bd06985c0a143cdcba2762bfe020e53514a53de) | ||
--- | ||
sysdeps/sparc/sysdep.h | 9 +++++++++ | ||
.../unix/sysv/linux/sparc/sparc32/sigreturn_stub.S | 11 +++++++---- | ||
2 files changed, 16 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/sysdeps/sparc/sysdep.h b/sysdeps/sparc/sysdep.h | ||
index 687e626182..151baa5e10 100644 | ||
--- a/sysdeps/sparc/sysdep.h | ||
+++ b/sysdeps/sparc/sysdep.h | ||
@@ -76,6 +76,15 @@ C_LABEL(name) \ | ||
cfi_endproc; \ | ||
.size name, . - name | ||
|
||
+#define ENTRY_NOCFI(name) \ | ||
+ .align 4; \ | ||
+ .global C_SYMBOL_NAME(name); \ | ||
+ .type name, @function; \ | ||
+C_LABEL(name) | ||
+ | ||
+#define END_NOCFI(name) \ | ||
+ .size name, . - name | ||
+ | ||
#undef LOC | ||
#define LOC(name) .L##name | ||
|
||
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sigreturn_stub.S b/sysdeps/unix/sysv/linux/sparc/sparc32/sigreturn_stub.S | ||
index cf509c8d5c..1962f9053c 100644 | ||
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sigreturn_stub.S | ||
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sigreturn_stub.S | ||
@@ -23,12 +23,15 @@ | ||
|
||
[1] https://lkml.org/lkml/2016/5/27/465 */ | ||
|
||
-ENTRY (__rt_sigreturn_stub) | ||
+ nop | ||
+ nop | ||
+ | ||
+ENTRY_NOCFI (__rt_sigreturn_stub) | ||
mov __NR_rt_sigreturn, %g1 | ||
ta 0x10 | ||
-END (__rt_sigreturn_stub) | ||
+END_NOCFI (__rt_sigreturn_stub) | ||
|
||
-ENTRY (__sigreturn_stub) | ||
+ENTRY_NOCFI (__sigreturn_stub) | ||
mov __NR_sigreturn, %g1 | ||
ta 0x10 | ||
-END (__sigreturn_stub) | ||
+END_NOCFI (__sigreturn_stub) | ||
-- | ||
2.44.0 | ||
|
40 changes: 40 additions & 0 deletions
40
packages/glibc/0051-arm-Remove-wrong-ldr-from-_dl_start_user-BZ-31339.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From b09073e63138ce409bf6426cf820eeaa0d28ca74 Mon Sep 17 00:00:00 2001 | ||
From: Adhemerval Zanella <[email protected]> | ||
Date: Mon, 5 Feb 2024 16:10:24 +0000 | ||
Subject: [PATCH] arm: Remove wrong ldr from _dl_start_user (BZ 31339) | ||
|
||
The commit 49d877a80b29d3002887b084eec6676d9f5fec18 (arm: Remove | ||
_dl_skip_args usage) removed the _SKIP_ARGS literal, which was | ||
previously loader to r4 on loader _start. However, the cleanup did not | ||
remove the following 'ldr r4, [sl, r4]' on _dl_start_user, used to check | ||
to skip the arguments after ld self-relocations. | ||
|
||
In my testing, the kernel initially set r4 to 0, which makes the | ||
ldr instruction just read the _GLOBAL_OFFSET_TABLE_. However, since r4 | ||
is a callee-saved register; a different runtime might not zero | ||
initialize it and thus trigger an invalid memory access. | ||
|
||
Checked on arm-linux-gnu. | ||
|
||
Reported-by: Adrian Ratiu <[email protected]> | ||
Reviewed-by: Szabolcs Nagy <[email protected]> | ||
(cherry picked from commit 1e25112dc0cb2515d27d8d178b1ecce778a9d37a) | ||
--- | ||
sysdeps/arm/dl-machine.h | 1 - | ||
1 file changed, 1 deletion(-) | ||
|
||
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h | ||
index d720c02c96..77dc7415e9 100644 | ||
--- a/sysdeps/arm/dl-machine.h | ||
+++ b/sysdeps/arm/dl-machine.h | ||
@@ -137,7 +137,6 @@ _start:\n\ | ||
_dl_start_user:\n\ | ||
adr r6, .L_GET_GOT\n\ | ||
add sl, sl, r6\n\ | ||
- ldr r4, [sl, r4]\n\ | ||
@ save the entry point in another register\n\ | ||
mov r6, r0\n\ | ||
@ get the original arg count\n\ | ||
-- | ||
2.44.0 | ||
|
Oops, something went wrong.