[libcamera-devel] [PATCH v2] backtrace: Include cxxabi.h without HAVE_DW

Khem Raj raj.khem at gmail.com
Wed Dec 1 21:15:48 CET 2021


Since its used in code without HAVE_DW, it fails to compile on such
systems e.g. linux/musl

Fixes
src/libcamera/base/backtrace.cpp:235:16: error: use of undeclared identifier 'abi'
                char *name = abi::__cxa_demangle(symbol, nullptr, nullptr, nullptr);
                             ^
1 error generated.

Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
v2: Fix typo in subject

 src/libcamera/base/backtrace.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/libcamera/base/backtrace.cpp b/src/libcamera/base/backtrace.cpp
index d93e5518..42c60f7c 100644
--- a/src/libcamera/base/backtrace.cpp
+++ b/src/libcamera/base/backtrace.cpp
@@ -13,11 +13,12 @@
 #endif
 
 #ifdef HAVE_DW
-#include <cxxabi.h>
 #include <elfutils/libdwfl.h>
 #include <unistd.h>
 #endif
 
+#include <cxxabi.h>
+
 #if HAVE_UNWIND
 /*
  * Disable support for remote unwinding to enable a more optimized
-- 
2.34.1



More information about the libcamera-devel mailing list