summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSasi Kumar Maddineni <quic_sasikuma@quicinc.com>2025-10-29 11:11:19 +0530
committerKhem Raj <raj.khem@gmail.com>2025-10-29 21:02:20 -0700
commitaa430364a26e2f763644648675d45d62b678cccb (patch)
tree62fd5ab5ca58fc74c6a58f05378d6fb6a1a07672
parent838dbfc496a2940b060c19f7bfc8e080f7b68e40 (diff)
downloadmeta-openembedded-aa430364a26e2f763644648675d45d62b678cccb.tar.gz
libunwind: guard unreachable() macro to avoid redefinition with stddef.h
The build fails due to a macro redefinition conflict for `unreachable()`. GCC 15.2.0 defines `unreachable()` in `stddef.h`, and `libunwind_i.h` also defines it based on the presence of `HAVE__BUILTIN_UNREACHABLE`. This causes a redefinition error when building with `-Werror`. Added a guard around the `unreachable()` macro definition in `libunwind_i.h` to ensure it is only defined if not already present. Signed-off-by: Sasi Kumar Maddineni <quic_sasikuma@quicinc.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/debian/external/libunwind/libunwind-guard-unreachable-macro-to-avoid-redefinit.patch42
-rw-r--r--meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools_29.0.6.r14.bb1
2 files changed, 43 insertions, 0 deletions
diff --git a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/debian/external/libunwind/libunwind-guard-unreachable-macro-to-avoid-redefinit.patch b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/debian/external/libunwind/libunwind-guard-unreachable-macro-to-avoid-redefinit.patch
new file mode 100644
index 0000000000..1e0f15ddf0
--- /dev/null
+++ b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/debian/external/libunwind/libunwind-guard-unreachable-macro-to-avoid-redefinit.patch
@@ -0,0 +1,42 @@
1From e64495a109eefaf87235729f4dd79fc9121c16a6 Mon Sep 17 00:00:00 2001
2From: Sasi Kumar Maddineni <quic_sasikuma@quicinc.com>
3Date: Mon, 27 Oct 2025 19:39:05 +0530
4Subject: [PATCH] libunwind: guard unreachable() macro to avoid redefinition
5 with stddef.h
6
7The build fails due to a macro redefinition conflict for `unreachable()`.
8GCC 15.2.0 defines `unreachable()` in `stddef.h`, and `libunwind_i.h` also
9defines it based on the presence of `HAVE__BUILTIN_UNREACHABLE`. This causes
10a redefinition error when building with `-Werror`.
11
12Added a guard around the `unreachable()` macro definition in `libunwind_i.h`
13to ensure it is only defined if not already present.
14
15Upstream-Status: Pending
16
17Signed-off-by: Sasi Kumar Maddineni <quic_sasikuma@quicinc.com>
18---
19 external/libunwind/include/libunwind_i.h | 2 ++
20 1 file changed, 2 insertions(+)
21
22diff --git a/external/libunwind/include/libunwind_i.h b/external/libunwind/include/libunwind_i.h
23index c06912a6..59a462df 100644
24--- a/external/libunwind/include/libunwind_i.h
25+++ b/external/libunwind/include/libunwind_i.h
26@@ -88,11 +88,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
27 # endif
28 #endif
29
30+#if !defined(unreachable)
31 #if defined(HAVE__BUILTIN_UNREACHABLE)
32 # define unreachable() __builtin_unreachable()
33 #else
34 # define unreachable() do { } while (1)
35 #endif
36+#endif
37
38 #ifdef DEBUG
39 # define UNW_DEBUG 1
40--
412.34.1
42
diff --git a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools_29.0.6.r14.bb b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools_29.0.6.r14.bb
index 0e25c39bc2..47c8e08b62 100644
--- a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools_29.0.6.r14.bb
+++ b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools_29.0.6.r14.bb
@@ -21,6 +21,7 @@ SRC_URI += " \
21 file://debian/external/libunwind/user_pt_regs.patch \ 21 file://debian/external/libunwind/user_pt_regs.patch \
22 file://debian/external/libunwind/legacy_built-in_sync_functions.patch \ 22 file://debian/external/libunwind/legacy_built-in_sync_functions.patch \
23 file://debian/external/libunwind/20150704-CVE-2015-3239_dwarf_i.h.patch \ 23 file://debian/external/libunwind/20150704-CVE-2015-3239_dwarf_i.h.patch \
24 file://debian/external/libunwind/libunwind-guard-unreachable-macro-to-avoid-redefinit.patch \
24 \ 25 \
25 file://debian/system/core/move-log-file-to-proper-dir.patch \ 26 file://debian/system/core/move-log-file-to-proper-dir.patch \
26 file://debian/system/core/Added-missing-headers.patch \ 27 file://debian/system/core/Added-missing-headers.patch \