diff options
Diffstat (limited to 'meta/recipes-devtools/clang/clang/0036-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch')
-rw-r--r-- | meta/recipes-devtools/clang/clang/0036-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-devtools/clang/clang/0036-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch b/meta/recipes-devtools/clang/clang/0036-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch new file mode 100644 index 0000000000..fe2bd77b33 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0036-libunwind-Use-gcs-instead-of-gcs-target-attribute.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From 8c839483915183a9c1ca4f74646ca4f478900e77 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 30 Apr 2025 19:51:19 -0700 | ||
4 | Subject: [PATCH] libunwind: Use +gcs instead of gcs target attribute | ||
5 | |||
6 | __attribute__((target("gcs"))) does not work with gcc | ||
7 | |||
8 | GCC-15 has added gcs intrinsics [1] but the syntax for enabling it is | ||
9 | slightly different. This syntax works with clang too. | ||
10 | |||
11 | With gcc15 compiler libunwind's check for this macros is succeeding and it | ||
12 | ends up enabling 'gcs' by using function attribute, this works with clang | ||
13 | but not with gcc but '+gcs' works with both | ||
14 | |||
15 | We can see this in rust compiler bootstrap for aarch64/musl when system | ||
16 | uses gcc15, it ends up with these errors | ||
17 | |||
18 | Building libunwind.a for aarch64-poky-linux-musl | ||
19 | cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:191:1: error: arch extension 'gcs' should be prefixed by '+' | ||
20 | cargo:warning= 191 | unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) { | ||
21 | cargo:warning= | ^~~~~~~~~~~~~ | ||
22 | cargo:warning=/mnt/b/yoe/master/sources/poky/build/tmp/work/cortexa57-poky-linux-musl/rust/1.85.1/rustc-1.85.1-src/src/llvm-project/libunwind/src/UnwindLevel1.c:337:22: error: arch extension 'gcs' should be prefixed by '+' | ||
23 | cargo:warning= 337 | _Unwind_Stop_Fn stop, void *stop_parameter) { | ||
24 | cargo:warning= | ^~~~~~~~~~~~~~~ | ||
25 | |||
26 | [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5a6af707f0af | ||
27 | |||
28 | Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/138077] | ||
29 | |||
30 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
31 | --- | ||
32 | libunwind/src/UnwindLevel1.c | 4 ++-- | ||
33 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
34 | |||
35 | diff --git a/libunwind/src/UnwindLevel1.c b/libunwind/src/UnwindLevel1.c | ||
36 | index 7e785f4d31e7..ed2c8239824c 100644 | ||
37 | --- a/libunwind/src/UnwindLevel1.c | ||
38 | +++ b/libunwind/src/UnwindLevel1.c | ||
39 | @@ -185,7 +185,7 @@ extern int __unw_step_stage2(unw_cursor_t *); | ||
40 | |||
41 | #if defined(_LIBUNWIND_USE_GCS) | ||
42 | // Enable the GCS target feature to permit gcspop instructions to be used. | ||
43 | -__attribute__((target("gcs"))) | ||
44 | +__attribute__((target("+gcs"))) | ||
45 | #endif | ||
46 | static _Unwind_Reason_Code | ||
47 | unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) { | ||
48 | @@ -329,7 +329,7 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except | ||
49 | |||
50 | #if defined(_LIBUNWIND_USE_GCS) | ||
51 | // Enable the GCS target feature to permit gcspop instructions to be used. | ||
52 | -__attribute__((target("gcs"))) | ||
53 | +__attribute__((target("+gcs"))) | ||
54 | #endif | ||
55 | static _Unwind_Reason_Code | ||
56 | unwind_phase2_forced(unw_context_t *uc, unw_cursor_t *cursor, | ||