<div dir="ltr"><div dir="ltr">Hi Laurent,<div><br></div><div>Thanks for the updates.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 13 Jul 2022 at 03:03, Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>><br>
<br>
Compiling backtrace.cpp for ARM32 produces the following error with the<br>
clang-11 (and later) compiler:<br>
<br>
--------------------<br>
../src/libcamera/base/backtrace.cpp:195:12: error: use of SP or PC in the list is deprecated [-Werror,-Winline-asm]<br>
        int ret = unw_getcontext(&uc);<br>
                  ^<br>
/usr/include/arm-linux-gnueabihf/libunwind-common.h:114:29: note: expanded from macro 'unw_getcontext'<br>
                                        ^<br>
/usr/include/arm-linux-gnueabihf/libunwind-arm.h:270:5: note: expanded from macro 'unw_tdep_getcontext'<br>
    "stmia %[base], {r0-r15}"                                           \<br>
    ^<br>
<inline asm>:1:2: note: instantiated into assembly here<br>
        stmia r0, {r0-r15}<br>
--------------------<br>
<br>
Suppress this compilation error with a clang-specific pragma around the<br>
offending statements.<br>
<br>
Further information about this error can be found at<br>
<a href="https://github.com/dotnet/runtime/issues/38652" rel="noreferrer" target="_blank">https://github.com/dotnet/runtime/issues/38652</a></blockquote><div><br></div><div>As mentioned in the last email, I did mean to refer to</div><div><a href="https://github.com/dotnet/runtime/issues/5595">https://github.com/dotnet/runtime/issues/5595</a></div><div><br></div><div>But your link is also related, so happy to keep it (or both).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
Bug: <a href="https://bugs.libcamera.org/show_bug.cgi?id=136" rel="noreferrer" target="_blank">https://bugs.libcamera.org/show_bug.cgi?id=136</a><br>
Signed-off-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>><br>
Tested-by: Jacopo Mondi <<a href="mailto:jacopo@jmondi.org" target="_blank">jacopo@jmondi.org</a>><br>
Reviewed-by: Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com" target="_blank">kieran.bingham@ideasonboard.com</a>><br>
Reviewed-by: Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com" target="_blank">laurent.pinchart@ideasonboard.com</a>><br></blockquote><div><br></div><div>Reviewed-by: Naushir Patuck <<a href="mailto:naush@rasbperrypi.com">naush@rasbperrypi.com</a>></div><div>Tested-by: Naushir Patuck <<a href="mailto:naush@rasbperrypi.com">naush@rasbperrypi.com</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 src/libcamera/base/backtrace.cpp | 12 ++++++++++++<br>
 1 file changed, 12 insertions(+)<br>
<br>
diff --git a/src/libcamera/base/backtrace.cpp b/src/libcamera/base/backtrace.cpp<br>
index 483492c390c3..be30589d255e 100644<br>
--- a/src/libcamera/base/backtrace.cpp<br>
+++ b/src/libcamera/base/backtrace.cpp<br>
@@ -191,10 +191,22 @@ __attribute__((__noinline__))<br>
 bool Backtrace::unwindTrace()<br>
 {<br>
 #if HAVE_UNWIND<br>
+/*<br>
+ * unw_getcontext() for ARM32 is an inline assembly function using the stmia<br>
+ * instruction to store SP and PC. This is considered by clang-11 as deprecated,<br>
+ * and generates a warning.<br>
+ */<br>
+#ifdef __clang__<br>
+#pragma clang diagnostic push<br>
+#pragma clang diagnostic ignored "-Winline-asm"<br>
+#endif<br>
        unw_context_t uc;<br>
        int ret = unw_getcontext(&uc);<br>
        if (ret)<br>
                return false;<br>
+#ifdef __clang__<br>
+#pragma clang diagnostic pop<br>
+#endif<br>
<br>
        unw_cursor_t cursor;<br>
        ret = unw_init_local(&cursor, &uc);<br>
<br>
base-commit: ba6435930f08e802cffc688d90f156a8959a0f86<br>
-- <br>
Regards,<br>
<br>
Laurent Pinchart<br>
<br>
</blockquote></div></div>