diff options
| author | Wang Mingyu <wangmy@fujitsu.com> | 2025-06-04 16:45:04 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-06-05 11:02:23 +0100 |
| commit | 1f51eca39c30dec253f7a5e26626dc8560852f9b (patch) | |
| tree | 61f1e4cfe9556c0679f3639bffc6c6eb98cff22f /meta/recipes-support/libunwind | |
| parent | 4d4c7852d010bbefccf67a402f7e43fdcf64e9e0 (diff) | |
| download | poky-1f51eca39c30dec253f7a5e26626dc8560852f9b.tar.gz | |
libunwind: upgrade 1.8.1 -> 1.8.2
0003-Fixed-miscompilation-of-unw_getcontext-on-ARM.patch
0004-Rework-inline-aarch64-as-for-setcontext.patch
removed since they're included in 1.8.2
libatomic.patch
malloc.patch
refreshed for 1.8.2
(From OE-Core rev: 02c3d8de66fa1342d729a17654b0ac14e07b8860)
Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/libunwind')
| -rw-r--r-- | meta/recipes-support/libunwind/libunwind/0003-Fixed-miscompilation-of-unw_getcontext-on-ARM.patch | 27 | ||||
| -rw-r--r-- | meta/recipes-support/libunwind/libunwind/0004-Rework-inline-aarch64-as-for-setcontext.patch | 163 | ||||
| -rw-r--r-- | meta/recipes-support/libunwind/libunwind/libatomic.patch | 6 | ||||
| -rw-r--r-- | meta/recipes-support/libunwind/libunwind/malloc.patch | 10 | ||||
| -rw-r--r-- | meta/recipes-support/libunwind/libunwind_1.8.2.bb (renamed from meta/recipes-support/libunwind/libunwind_1.8.1.bb) | 4 |
5 files changed, 9 insertions, 201 deletions
diff --git a/meta/recipes-support/libunwind/libunwind/0003-Fixed-miscompilation-of-unw_getcontext-on-ARM.patch b/meta/recipes-support/libunwind/libunwind/0003-Fixed-miscompilation-of-unw_getcontext-on-ARM.patch deleted file mode 100644 index 19bdd858f7..0000000000 --- a/meta/recipes-support/libunwind/libunwind/0003-Fixed-miscompilation-of-unw_getcontext-on-ARM.patch +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | From e5216c3fb1fa8d60a18c68e4749a3ff902f6678b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ian Zborovsky <ian@veego.io> | ||
| 3 | Date: Mon, 6 May 2024 02:01:19 +0300 | ||
| 4 | Subject: [PATCH 3/4] Fixed miscompilation of unw_getcontext() on ARM | ||
| 5 | |||
| 6 | Upstream-Status: Backport | ||
| 7 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 8 | --- | ||
| 9 | include/libunwind-arm.h | 2 +- | ||
| 10 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 11 | |||
| 12 | diff --git a/include/libunwind-arm.h b/include/libunwind-arm.h | ||
| 13 | index 6cfa577d..6643a185 100644 | ||
| 14 | --- a/include/libunwind-arm.h | ||
| 15 | +++ b/include/libunwind-arm.h | ||
| 16 | @@ -288,7 +288,7 @@ unw_tdep_context_t; | ||
| 17 | "mov r0, #0\n\t" \ | ||
| 18 | "stmia %[base]!, {r0-r15}\n\t" \ | ||
| 19 | VSTMIA \ | ||
| 20 | - : [r0] "=r" (r0) : [base] "r" (unw_base) : "memory"); \ | ||
| 21 | + : [r0] "=r" (r0), [base] "+r" (unw_base) : : "memory"); \ | ||
| 22 | (int)r0; }) | ||
| 23 | #else /* __thumb__ */ | ||
| 24 | #define unw_tdep_getcontext(uc) ({ \ | ||
| 25 | -- | ||
| 26 | 2.34.1 | ||
| 27 | |||
diff --git a/meta/recipes-support/libunwind/libunwind/0004-Rework-inline-aarch64-as-for-setcontext.patch b/meta/recipes-support/libunwind/libunwind/0004-Rework-inline-aarch64-as-for-setcontext.patch deleted file mode 100644 index 005a077028..0000000000 --- a/meta/recipes-support/libunwind/libunwind/0004-Rework-inline-aarch64-as-for-setcontext.patch +++ /dev/null | |||
| @@ -1,163 +0,0 @@ | |||
| 1 | From a832070f3665d29a8a06652c15f94d144c24ac69 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Stephen Webb <swebb@blackberry.com> | ||
| 3 | Date: Mon, 22 Apr 2024 15:56:54 -0400 | ||
| 4 | Subject: [PATCH 4/5] Rework inline aarch64 as for setcontext | ||
| 5 | |||
| 6 | Modern GC and clang were barfing on the inline asm constraints for the | ||
| 7 | aarch64-linux setcontext() replacement. Reformulated the asm code to | ||
| 8 | reduce the required constraints. | ||
| 9 | |||
| 10 | Upstream-Status: Backport | ||
| 11 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 12 | --- | ||
| 13 | src/aarch64/Gos-linux.c | 115 +++++++++++++++++++++------------------- | ||
| 14 | 1 file changed, 61 insertions(+), 54 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/src/aarch64/Gos-linux.c b/src/aarch64/Gos-linux.c | ||
| 17 | index 7cd8c879..1e494962 100644 | ||
| 18 | --- a/src/aarch64/Gos-linux.c | ||
| 19 | +++ b/src/aarch64/Gos-linux.c | ||
| 20 | @@ -2,6 +2,7 @@ | ||
| 21 | Copyright (C) 2008 CodeSourcery | ||
| 22 | Copyright (C) 2011-2013 Linaro Limited | ||
| 23 | Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com> | ||
| 24 | + Copyright 2024 Stephen M. Webb <swebb@blackberry.com> | ||
| 25 | |||
| 26 | This file is part of libunwind. | ||
| 27 | |||
| 28 | @@ -28,6 +29,28 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ | ||
| 29 | |||
| 30 | #ifndef UNW_REMOTE_ONLY | ||
| 31 | |||
| 32 | +/* Magic constants generated from gen-offsets.c */ | ||
| 33 | +#define SC_R0_OFF "8" | ||
| 34 | +#define SC_R2_OFF "24" | ||
| 35 | +#define SC_R18_OFF "152" | ||
| 36 | +#define SC_R20_OFF "168" | ||
| 37 | +#define SC_R22_OFF "184" | ||
| 38 | +#define SC_R24_OFF "200" | ||
| 39 | +#define SC_R26_OFF "216" | ||
| 40 | +#define SC_R28_OFF "232" | ||
| 41 | +#define SC_R30_OFF "248" | ||
| 42 | + | ||
| 43 | +#define FP_R08_OFF "80" | ||
| 44 | +#define FP_R09_OFF "88" | ||
| 45 | +#define FP_R10_OFF "96" | ||
| 46 | +#define FP_R11_OFF "104" | ||
| 47 | +#define FP_R12_OFF "112" | ||
| 48 | +#define FP_R13_OFF "120" | ||
| 49 | +#define FP_R14_OFF "128" | ||
| 50 | +#define FP_R15_OFF "136" | ||
| 51 | + | ||
| 52 | +#define SC_SP_OFF "0x100" | ||
| 53 | + | ||
| 54 | HIDDEN int | ||
| 55 | aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) | ||
| 56 | { | ||
| 57 | @@ -36,65 +59,49 @@ aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) | ||
| 58 | |||
| 59 | if (c->sigcontext_format == AARCH64_SCF_NONE) | ||
| 60 | { | ||
| 61 | + | ||
| 62 | + /* | ||
| 63 | + * This is effectively the old POSIX setcontext(). | ||
| 64 | + * | ||
| 65 | + * This inline asm is broken up to use local scratch registers for the | ||
| 66 | + * uc_mcontext.regs and FPCTX base addresses because newer versions of GCC | ||
| 67 | + * and clang barf on too many constraints (gh-702) when the C array | ||
| 68 | + * elements are used directly. | ||
| 69 | + * | ||
| 70 | + * Clobbers aren't required for the inline asm because they just convince | ||
| 71 | + * the compiler to save those registers and they never get restored | ||
| 72 | + * becauise the asm ends with a plain ol' ret. | ||
| 73 | + */ | ||
| 74 | + register void* uc_mcontext __asm__ ("x5") = (void*) &uc->uc_mcontext; | ||
| 75 | + register void* fpctx __asm__ ("x4") = (void*) GET_FPCTX(uc); | ||
| 76 | + | ||
| 77 | /* Since there are no signals involved here we restore EH and non scratch | ||
| 78 | registers only. */ | ||
| 79 | __asm__ __volatile__ ( | ||
| 80 | - "ldr x0, %[x0]\n\t" | ||
| 81 | - "ldr x1, %[x1]\n\t" | ||
| 82 | - "ldr x2, %[x2]\n\t" | ||
| 83 | - "ldr x3, %[x3]\n\t" | ||
| 84 | - "ldr x19, %[x19]\n\t" | ||
| 85 | - "ldr x20, %[x20]\n\t" | ||
| 86 | - "ldr x21, %[x21]\n\t" | ||
| 87 | - "ldr x22, %[x22]\n\t" | ||
| 88 | - "ldr x23, %[x23]\n\t" | ||
| 89 | - "ldr x24, %[x24]\n\t" | ||
| 90 | - "ldr x25, %[x25]\n\t" | ||
| 91 | - "ldr x26, %[x26]\n\t" | ||
| 92 | - "ldr x27, %[x27]\n\t" | ||
| 93 | - "ldr x28, %[x28]\n\t" | ||
| 94 | - "ldr x29, %[x29]\n\t" | ||
| 95 | - "ldr x30, %[x30]\n\t" | ||
| 96 | - "ldr d8, %[d8]\n\t" | ||
| 97 | - "ldr d9, %[d9]\n\t" | ||
| 98 | - "ldr d10, %[d10]\n\t" | ||
| 99 | - "ldr d11, %[d11]\n\t" | ||
| 100 | - "ldr d12, %[d12]\n\t" | ||
| 101 | - "ldr d13, %[d13]\n\t" | ||
| 102 | - "ldr d14, %[d14]\n\t" | ||
| 103 | - "ldr d15, %[d15]\n\t" | ||
| 104 | - "ldr x5, %[sp]\n\t" | ||
| 105 | + "ldp x0, x1, [x5, " SC_R0_OFF "]\n\t" | ||
| 106 | + "ldp x2, x3, [x5, " SC_R2_OFF "]\n\t" | ||
| 107 | + "ldp x18, x19, [x5, " SC_R18_OFF "]\n\t" | ||
| 108 | + "ldp x20, x21, [x5, " SC_R20_OFF "]\n\t" | ||
| 109 | + "ldp x22, x23, [x5, " SC_R22_OFF "]\n\t" | ||
| 110 | + "ldp x24, x25, [x5, " SC_R24_OFF "]\n\t" | ||
| 111 | + "ldp x26, x27, [x5, " SC_R26_OFF "]\n\t" | ||
| 112 | + "ldp x28, x29, [x5, " SC_R28_OFF "]\n\t" | ||
| 113 | + "ldr x30, [x5, " SC_R30_OFF "]\n\t" | ||
| 114 | + "ldr d8, [x4, " FP_R08_OFF "]\n\t" | ||
| 115 | + "ldr d9, [x4, " FP_R09_OFF "]\n\t" | ||
| 116 | + "ldr d10, [x4, " FP_R10_OFF "]\n\t" | ||
| 117 | + "ldr d11, [x4, " FP_R11_OFF "]\n\t" | ||
| 118 | + "ldr d12, [x4, " FP_R12_OFF "]\n\t" | ||
| 119 | + "ldr d13, [x4, " FP_R13_OFF "]\n\t" | ||
| 120 | + "ldr d14, [x4, " FP_R14_OFF "]\n\t" | ||
| 121 | + "ldr d15, [x4, " FP_R15_OFF "]\n\t" | ||
| 122 | + "ldr x5, [x5, " SC_SP_OFF "]\n\t" | ||
| 123 | "mov sp, x5\n\t" | ||
| 124 | "ret\n" | ||
| 125 | - : | ||
| 126 | - : [x0] "m"(uc->uc_mcontext.regs[0]), | ||
| 127 | - [x1] "m"(uc->uc_mcontext.regs[1]), | ||
| 128 | - [x2] "m"(uc->uc_mcontext.regs[2]), | ||
| 129 | - [x3] "m"(uc->uc_mcontext.regs[3]), | ||
| 130 | - [x19] "m"(uc->uc_mcontext.regs[19]), | ||
| 131 | - [x20] "m"(uc->uc_mcontext.regs[20]), | ||
| 132 | - [x21] "m"(uc->uc_mcontext.regs[21]), | ||
| 133 | - [x22] "m"(uc->uc_mcontext.regs[22]), | ||
| 134 | - [x23] "m"(uc->uc_mcontext.regs[23]), | ||
| 135 | - [x24] "m"(uc->uc_mcontext.regs[24]), | ||
| 136 | - [x25] "m"(uc->uc_mcontext.regs[25]), | ||
| 137 | - [x26] "m"(uc->uc_mcontext.regs[26]), | ||
| 138 | - [x27] "m"(uc->uc_mcontext.regs[27]), | ||
| 139 | - [x28] "m"(uc->uc_mcontext.regs[28]), | ||
| 140 | - [x29] "m"(uc->uc_mcontext.regs[29]), /* FP */ | ||
| 141 | - [x30] "m"(uc->uc_mcontext.regs[30]), /* LR */ | ||
| 142 | - [d8] "m"(GET_FPCTX(uc)->vregs[8]), | ||
| 143 | - [d9] "m"(GET_FPCTX(uc)->vregs[9]), | ||
| 144 | - [d10] "m"(GET_FPCTX(uc)->vregs[10]), | ||
| 145 | - [d11] "m"(GET_FPCTX(uc)->vregs[11]), | ||
| 146 | - [d12] "m"(GET_FPCTX(uc)->vregs[12]), | ||
| 147 | - [d13] "m"(GET_FPCTX(uc)->vregs[13]), | ||
| 148 | - [d14] "m"(GET_FPCTX(uc)->vregs[14]), | ||
| 149 | - [d15] "m"(GET_FPCTX(uc)->vregs[15]), | ||
| 150 | - [sp] "m"(uc->uc_mcontext.sp) | ||
| 151 | - : "x0", "x1", "x2", "x3", "x19", "x20", "x21", "x22", "x23", "x24", | ||
| 152 | - "x25", "x26", "x27", "x28", "x29", "x30" | ||
| 153 | - ); | ||
| 154 | + : | ||
| 155 | + : [uc_mcontext] "r"(uc_mcontext), | ||
| 156 | + [fpctx] "r"(fpctx) | ||
| 157 | + ); | ||
| 158 | } | ||
| 159 | else | ||
| 160 | { | ||
| 161 | -- | ||
| 162 | 2.34.1 | ||
| 163 | |||
diff --git a/meta/recipes-support/libunwind/libunwind/libatomic.patch b/meta/recipes-support/libunwind/libunwind/libatomic.patch index f39e92f2ee..e783128e2c 100644 --- a/meta/recipes-support/libunwind/libunwind/libatomic.patch +++ b/meta/recipes-support/libunwind/libunwind/libatomic.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From d6a0d8ce07c761e51b9dc7c5d16a9b06c3e93560 Mon Sep 17 00:00:00 2001 | 1 | From a331e3a63981427724d2d9cfdcb4a456153299b5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Stephen Webb <swebb@blackberry.com> | 2 | From: Stephen Webb <swebb@blackberry.com> |
| 3 | Date: Mon, 18 Mar 2024 10:22:26 -0400 | 3 | Date: Mon, 18 Mar 2024 10:22:26 -0400 |
| 4 | Subject: [PATCH] configure.ac: detect if -latomic is required | 4 | Subject: [PATCH] configure.ac: detect if -latomic is required |
| @@ -14,10 +14,10 @@ Signed-off-by: Ross Burton <ross.burton@arm.com> | |||
| 14 | 1 file changed, 12 insertions(+) | 14 | 1 file changed, 12 insertions(+) |
| 15 | 15 | ||
| 16 | diff --git a/configure.ac b/configure.ac | 16 | diff --git a/configure.ac b/configure.ac |
| 17 | index 758a27d19..d0ef5f3d9 100644 | 17 | index eaa0ddc..d5f1d4a 100644 |
| 18 | --- a/configure.ac | 18 | --- a/configure.ac |
| 19 | +++ b/configure.ac | 19 | +++ b/configure.ac |
| 20 | @@ -94,6 +94,18 @@ dnl Checks for library functions. | 20 | @@ -93,6 +93,18 @@ dnl Checks for library functions. |
| 21 | AC_CHECK_FUNCS(dl_iterate_phdr dl_phdr_removals_counter dlmodinfo getunwind \ | 21 | AC_CHECK_FUNCS(dl_iterate_phdr dl_phdr_removals_counter dlmodinfo getunwind \ |
| 22 | ttrace mincore pipe2 sigaltstack execvpe) | 22 | ttrace mincore pipe2 sigaltstack execvpe) |
| 23 | 23 | ||
diff --git a/meta/recipes-support/libunwind/libunwind/malloc.patch b/meta/recipes-support/libunwind/libunwind/malloc.patch index 026a56f155..cfcef1ccdc 100644 --- a/meta/recipes-support/libunwind/libunwind/malloc.patch +++ b/meta/recipes-support/libunwind/libunwind/malloc.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From b67d508a93bf1ba231c18dce3894cfee25c16e0d Mon Sep 17 00:00:00 2001 | 1 | From 8fd3e0c24fdfed64e0642ec0334548f16a2a9390 Mon Sep 17 00:00:00 2001 |
| 2 | From: Stephen Webb <swebb@blackberry.com> | 2 | From: Stephen Webb <swebb@blackberry.com> |
| 3 | Date: Wed, 12 Feb 2025 12:08:07 -0500 | 3 | Date: Wed, 12 Feb 2025 12:08:07 -0500 |
| 4 | Subject: [PATCH] Fix bad prototype for malloc() in test | 4 | Subject: [PATCH] Fix bad prototype for malloc() in test |
| @@ -23,7 +23,7 @@ Signed-off-by: Ross Burton <ross.burton@arm.com> | |||
| 23 | create mode 100644 tests/unw_test.h | 23 | create mode 100644 tests/unw_test.h |
| 24 | 24 | ||
| 25 | diff --git a/tests/Gtest-nomalloc.c b/tests/Gtest-nomalloc.c | 25 | diff --git a/tests/Gtest-nomalloc.c b/tests/Gtest-nomalloc.c |
| 26 | index 5b97fc709..e770ff614 100644 | 26 | index 5b97fc7..e770ff6 100644 |
| 27 | --- a/tests/Gtest-nomalloc.c | 27 | --- a/tests/Gtest-nomalloc.c |
| 28 | +++ b/tests/Gtest-nomalloc.c | 28 | +++ b/tests/Gtest-nomalloc.c |
| 29 | @@ -1,78 +1,92 @@ | 29 | @@ -1,78 +1,92 @@ |
| @@ -188,10 +188,10 @@ index 5b97fc709..e770ff614 100644 | |||
| 188 | + exit (UNW_TEST_EXIT_PASS); | 188 | + exit (UNW_TEST_EXIT_PASS); |
| 189 | } | 189 | } |
| 190 | diff --git a/tests/Makefile.am b/tests/Makefile.am | 190 | diff --git a/tests/Makefile.am b/tests/Makefile.am |
| 191 | index adc34ac63..60f3f3adc 100644 | 191 | index e2b07bc..844105a 100644 |
| 192 | --- a/tests/Makefile.am | 192 | --- a/tests/Makefile.am |
| 193 | +++ b/tests/Makefile.am | 193 | +++ b/tests/Makefile.am |
| 194 | @@ -214,7 +214,7 @@ endif | 194 | @@ -200,7 +200,7 @@ endif |
| 195 | 195 | ||
| 196 | noinst_PROGRAMS = $(noinst_PROGRAMS_common) $(noinst_PROGRAMS_cdep) \ | 196 | noinst_PROGRAMS = $(noinst_PROGRAMS_common) $(noinst_PROGRAMS_cdep) \ |
| 197 | $(noinst_PROGRAMS_arch) | 197 | $(noinst_PROGRAMS_arch) |
| @@ -202,7 +202,7 @@ index adc34ac63..60f3f3adc 100644 | |||
| 202 | -e 's,[@]XFAIL_TESTS[@],$(XFAIL_TESTS),g' \ | 202 | -e 's,[@]XFAIL_TESTS[@],$(XFAIL_TESTS),g' \ |
| 203 | diff --git a/tests/unw_test.h b/tests/unw_test.h | 203 | diff --git a/tests/unw_test.h b/tests/unw_test.h |
| 204 | new file mode 100644 | 204 | new file mode 100644 |
| 205 | index 000000000..9ae86dce1 | 205 | index 0000000..9ae86dc |
| 206 | --- /dev/null | 206 | --- /dev/null |
| 207 | +++ b/tests/unw_test.h | 207 | +++ b/tests/unw_test.h |
| 208 | @@ -0,0 +1,47 @@ | 208 | @@ -0,0 +1,47 @@ |
diff --git a/meta/recipes-support/libunwind/libunwind_1.8.1.bb b/meta/recipes-support/libunwind/libunwind_1.8.2.bb index 10714ea247..6f7168b5df 100644 --- a/meta/recipes-support/libunwind/libunwind_1.8.1.bb +++ b/meta/recipes-support/libunwind/libunwind_1.8.2.bb | |||
| @@ -10,14 +10,12 @@ SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${BP}.tar.gz \ | |||
| 10 | file://mips-byte-order.patch \ | 10 | file://mips-byte-order.patch \ |
| 11 | file://0001-tests-Garm64-test-sve-signal-check-that-SVE-is-prese.patch \ | 11 | file://0001-tests-Garm64-test-sve-signal-check-that-SVE-is-prese.patch \ |
| 12 | file://0002-coredump-use-glibc-or-musl-register-names-as-appropr.patch \ | 12 | file://0002-coredump-use-glibc-or-musl-register-names-as-appropr.patch \ |
| 13 | file://0003-Fixed-miscompilation-of-unw_getcontext-on-ARM.patch \ | ||
| 14 | file://0004-Rework-inline-aarch64-as-for-setcontext.patch \ | ||
| 15 | file://0005-Handle-musl-on-PPC32.patch \ | 13 | file://0005-Handle-musl-on-PPC32.patch \ |
| 16 | file://libatomic.patch \ | 14 | file://libatomic.patch \ |
| 17 | file://malloc.patch \ | 15 | file://malloc.patch \ |
| 18 | " | 16 | " |
| 19 | 17 | ||
| 20 | SRC_URI[sha256sum] = "ddf0e32dd5fafe5283198d37e4bf9decf7ba1770b6e7e006c33e6df79e6a6157" | 18 | SRC_URI[sha256sum] = "7f262f1a1224f437ede0f96a6932b582c8f5421ff207c04e3d9504dfa04c8b82" |
| 21 | 19 | ||
| 22 | inherit autotools multilib_header github-releases | 20 | inherit autotools multilib_header github-releases |
| 23 | 21 | ||
