diff --git a/meta-networking/recipes-connectivity/openthread/ot-br-posix/0001-posix-backtrace-Reference-sCrashCallback-on-non-gli.patch b/meta-networking/recipes-connectivity/openthread/ot-br-posix/0001-posix-backtrace-Reference-sCrashCallback-on-non-gli.patch new file mode 100644 index 0000000000..88c3b67314 --- /dev/null +++ b/meta-networking/recipes-connectivity/openthread/ot-br-posix/0001-posix-backtrace-Reference-sCrashCallback-on-non-gli.patch @@ -0,0 +1,34 @@ +From: Khem Raj +Date: Tue, 29 Sep 2026 01:57:51 +0000 +Subject: [PATCH] posix/backtrace: Reference sCrashCallback on non-glibc, + non-Android builds + +sCrashCallback is set unconditionally by otSysRegisterCrashCallback() +whenever OPENTHREAD_POSIX_CONFIG_BACKTRACE_ENABLE is set, but it is +only read from signalCritical(), which is compiled solely under the +`OPENTHREAD_POSIX_CONFIG_ANDROID_ENABLE || defined(__GLIBC__)` branch. +On musl (neither Android nor glibc) that branch is replaced by an +empty platformBacktraceInit() stub, so the variable is set but never +used, which clang's -Wunused-but-set-global (promoted to -Werror) +turns into a hard build failure. Use the existing OT_UNUSED_VARIABLE() +idiom already used elsewhere in this file (e.g. in signalCritical()) +to acknowledge the variable on this code path too. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + src/posix/platform/backtrace.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/posix/platform/backtrace.cpp b/src/posix/platform/backtrace.cpp +index 1111111..2222222 100644 +--- a/src/posix/platform/backtrace.cpp ++++ b/src/posix/platform/backtrace.cpp +@@ -185,6 +185,6 @@ void platformBacktraceInit(void) + } + } + #else // OPENTHREAD_POSIX_CONFIG_ANDROID_ENABLE || defined(__GLIBC__) +-void platformBacktraceInit(void) {} ++void platformBacktraceInit(void) { OT_UNUSED_VARIABLE(sCrashCallback); } + #endif // OPENTHREAD_POSIX_CONFIG_ANDROID_ENABLE || defined(__GLIBC__) + #endif // OPENTHREAD_POSIX_CONFIG_BACKTRACE_ENABLE diff --git a/meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb b/meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb index 8c49a30327..59e1dae2a3 100644 --- a/meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb +++ b/meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb @@ -17,6 +17,7 @@ SRC_URI = "gitsm://github.com/openthread/ot-br-posix.git;protocol=https;branch=m file://0001-cmake-Disable-nonnull-compare-warning-on-gcc.patch \ file://default-cxx-std.patch \ file://0001-x509_crt-Zero-initialize-mbedtls_x509_time-at-declar.patch;patchdir=third_party/openthread/repo \ + file://0001-posix-backtrace-Reference-sCrashCallback-on-non-gli.patch;patchdir=third_party/openthread/repo \ " SYSTEMD_SERVICE:${PN} = "otbr-agent.service"