aboutsummaryrefslogtreecommitdiffstats
path: root/testing/qt-creator/fix-execinfo.patch
blob: b409a30afd767a2a2fda3a7cda366a7808b2f184 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--- a/src/plugins/debugger/shared/backtrace.cpp
+++ b/src/plugins/debugger/shared/backtrace.cpp
@@ -30,8 +30,10 @@
 #if defined(Q_OS_LINUX)
 #include <stdio.h>
 #include <signal.h>
+#ifdef __GLIBC__
 #include <execinfo.h>
 #endif
+#endif

 namespace Debugger {
 namespace Internal {
@@ -40,7 +42,7 @@ void dumpBacktrace(int maxdepth)
 {
     if (maxdepth == -1)
         maxdepth = 200;
-#if defined(Q_OS_LINUX)
+#if defined(Q_OS_LINUX) && defined(__GLIBC__)
     void *bt[200] = {nullptr};
     qDebug() << "BACKTRACE:";
     int size = backtrace(bt, sizeof(bt) / sizeof(bt[0]));
diff --git a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp
index a3a9806f7e..c369e681ab 100644
--- a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp
+++ b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp
@@ -26,7 +26,9 @@
 #include "exception.h"

 #ifdef Q_OS_LINUX
+#if defined(__GLIBC__)
 #include <execinfo.h>
+#endif
 #include <cxxabi.h>
 #endif

@@ -100,6 +102,7 @@ bool Exception::warnAboutException()
 }

 #ifdef Q_OS_LINUX
+#ifdef __GLIBC__
 static QString getBackTrace()
 {
     QString backTrace;
@@ -115,6 +118,7 @@ static QString getBackTrace()
     return backTrace;
 }
 #endif
+#endif

 QString Exception::defaultDescription(int line, const QByteArray &function, const QByteArray &file)
 {
@@ -138,8 +142,10 @@ Exception::Exception(int line, const QByteArray &function,
   , m_file(QString::fromUtf8(file))
   , m_description(description)
   #ifdef Q_OS_LINUX
+  #ifdef __GLIBC__
   , m_backTrace(getBackTrace())
   #endif
+  #endif
 {
     if (s_shouldAssert) {
         qDebug() << Exception::description();