diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-02-13 09:00:52 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-14 13:53:36 +0000 |
commit | b080cecd056770c703c5297fbcd0af38768fe47c (patch) | |
tree | 9617bfcd4a5997eb330c7eaafa635f27c1a7a88c /meta/recipes-core/glibc | |
parent | 5007bd98ceed3133255b21b1a007b1011f68cbb4 (diff) | |
download | poky-b080cecd056770c703c5297fbcd0af38768fe47c.tar.gz |
glibc: Update to bring mips32/clone3 fix
This patch is the only change applied with this update
* 312e159626 mips: FIx clone3 implementation (BZ 31325)
(From OE-Core rev: c100c709e746e7b7301c5e01cbf43572a225f00e)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glibc')
-rw-r--r-- | meta/recipes-core/glibc/glibc-version.inc | 2 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc/0024-mips-FIx-clone3-implementation-BZ-31325.patch | 83 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc_2.39.bb | 1 |
3 files changed, 1 insertions, 85 deletions
diff --git a/meta/recipes-core/glibc/glibc-version.inc b/meta/recipes-core/glibc/glibc-version.inc index 0d86917f45..5b0705f696 100644 --- a/meta/recipes-core/glibc/glibc-version.inc +++ b/meta/recipes-core/glibc/glibc-version.inc | |||
@@ -1,6 +1,6 @@ | |||
1 | SRCBRANCH ?= "release/2.39/master" | 1 | SRCBRANCH ?= "release/2.39/master" |
2 | PV = "2.39+git" | 2 | PV = "2.39+git" |
3 | SRCREV_glibc ?= "63295e4fda1f6dab4bf7442706fe303bf283036c" | 3 | SRCREV_glibc ?= "312e159626b67fe11f39e83e222cf4348a3962f3" |
4 | SRCREV_localedef ?= "fab74f31b3811df543e24b6de47efdf45b538abc" | 4 | SRCREV_localedef ?= "fab74f31b3811df543e24b6de47efdf45b538abc" |
5 | 5 | ||
6 | GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git;protocol=https" | 6 | GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git;protocol=https" |
diff --git a/meta/recipes-core/glibc/glibc/0024-mips-FIx-clone3-implementation-BZ-31325.patch b/meta/recipes-core/glibc/glibc/0024-mips-FIx-clone3-implementation-BZ-31325.patch deleted file mode 100644 index b391c60958..0000000000 --- a/meta/recipes-core/glibc/glibc/0024-mips-FIx-clone3-implementation-BZ-31325.patch +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | From b471cadd57e3fc1fce74b33fcf75c6844cfd68b3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Adhemerval Zanella <adhemerval.zanella@linaro.org> | ||
3 | Date: Thu, 1 Feb 2024 14:41:03 -0300 | ||
4 | Subject: [PATCH] mips: FIx clone3 implementation (BZ 31325) | ||
5 | |||
6 | For o32 we need to setup a minimal stack frame to allow cprestore | ||
7 | on __thread_start_clone3 (which instruct the linker to save the | ||
8 | gp for PIC). Also, there is no guarantee by kABI that $8 will be | ||
9 | preserved after syscall execution, so we need to save it on the | ||
10 | provided stack. | ||
11 | |||
12 | Checked on mipsel-linux-gnu. | ||
13 | |||
14 | Upstream-Status: Submitted [https://patchwork.sourceware.org/project/glibc/patch/20240201174103.798138-1-adhemerval.zanella@linaro.org/] | ||
15 | Reported-by: Khem Raj <raj.khem@gmail.com> | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | sysdeps/unix/sysv/linux/mips/clone3.S | 32 ++++++++++++++++++++++----- | ||
19 | 1 file changed, 27 insertions(+), 5 deletions(-) | ||
20 | |||
21 | diff --git a/sysdeps/unix/sysv/linux/mips/clone3.S b/sysdeps/unix/sysv/linux/mips/clone3.S | ||
22 | index e9fec2fa47..481b8ae963 100644 | ||
23 | --- a/sysdeps/unix/sysv/linux/mips/clone3.S | ||
24 | +++ b/sysdeps/unix/sysv/linux/mips/clone3.S | ||
25 | @@ -37,11 +37,6 @@ | ||
26 | |||
27 | .text | ||
28 | .set nomips16 | ||
29 | -#if _MIPS_SIM == _ABIO32 | ||
30 | -# define EXTRA_LOCALS 1 | ||
31 | -#else | ||
32 | -# define EXTRA_LOCALS 0 | ||
33 | -#endif | ||
34 | #define FRAMESZ ((NARGSAVE*SZREG)+ALSZ)&ALMASK | ||
35 | GPOFF= FRAMESZ-(1*SZREG) | ||
36 | NESTED(__clone3, SZREG, sp) | ||
37 | @@ -68,8 +63,31 @@ NESTED(__clone3, SZREG, sp) | ||
38 | beqz a0, L(error) /* No NULL cl_args pointer. */ | ||
39 | beqz a2, L(error) /* No NULL function pointer. */ | ||
40 | |||
41 | +#if _MIPS_SIM == _ABIO32 | ||
42 | + /* Both stack and stack_size on clone_args are defined as uint64_t, and | ||
43 | + there is no need to handle values larger than to 32 bits for o32. */ | ||
44 | +# if __BYTE_ORDER == __BIG_ENDIAN | ||
45 | +# define CL_STACKPOINTER_OFFSET 44 | ||
46 | +# define CL_STACKSIZE_OFFSET 52 | ||
47 | +# else | ||
48 | +# define CL_STACKPOINTER_OFFSET 40 | ||
49 | +# define CL_STACKSIZE_OFFSET 48 | ||
50 | +# endif | ||
51 | + | ||
52 | + /* For o32 we need to setup a minimal stack frame to allow cprestore | ||
53 | + on __thread_start_clone3. Also there is no guarantee by kABI that | ||
54 | + $8 will be preserved after syscall execution (so we need to save it | ||
55 | + on the provided stack). */ | ||
56 | + lw t0, CL_STACKPOINTER_OFFSET(a0) /* Load the stack pointer. */ | ||
57 | + lw t1, CL_STACKSIZE_OFFSET(a0) /* Load the stack_size. */ | ||
58 | + addiu t1, -32 /* Update the stack size. */ | ||
59 | + addu t2, t1, t0 /* Calculate the thread stack. */ | ||
60 | + sw a3, 0(t2) /* Save argument pointer. */ | ||
61 | + sw t1, CL_STACKSIZE_OFFSET(a0) /* Save the new stack size. */ | ||
62 | +#else | ||
63 | move $8, a3 /* a3 is set to 0/1 for syscall success/error | ||
64 | while a4/$8 is returned unmodified. */ | ||
65 | +#endif | ||
66 | |||
67 | /* Do the system call, the kernel expects: | ||
68 | v0: system call number | ||
69 | @@ -125,7 +143,11 @@ L(thread_start_clone3): | ||
70 | |||
71 | /* Restore the arg for user's function. */ | ||
72 | move t9, a2 /* Function pointer. */ | ||
73 | +#if _MIPS_SIM == _ABIO32 | ||
74 | + PTR_L a0, 0(sp) | ||
75 | +#else | ||
76 | move a0, $8 /* Argument pointer. */ | ||
77 | +#endif | ||
78 | |||
79 | /* Call the user's function. */ | ||
80 | jal t9 | ||
81 | -- | ||
82 | 2.43.0 | ||
83 | |||
diff --git a/meta/recipes-core/glibc/glibc_2.39.bb b/meta/recipes-core/glibc/glibc_2.39.bb index 577ff1ad2c..b203060064 100644 --- a/meta/recipes-core/glibc/glibc_2.39.bb +++ b/meta/recipes-core/glibc/glibc_2.39.bb | |||
@@ -49,7 +49,6 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ | |||
49 | file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ | 49 | file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ |
50 | file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \ | 50 | file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \ |
51 | file://0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch \ | 51 | file://0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch \ |
52 | file://0024-mips-FIx-clone3-implementation-BZ-31325.patch \ | ||
53 | " | 52 | " |
54 | S = "${WORKDIR}/git" | 53 | S = "${WORKDIR}/git" |
55 | B = "${WORKDIR}/build-${TARGET_SYS}" | 54 | B = "${WORKDIR}/build-${TARGET_SYS}" |