summaryrefslogtreecommitdiffstats
path: root/testing/fotoxx/no-execinfo.patch
blob: 2c8195c9e964ab6429196e7d07812b201a2b3d75 (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
64
65
diff --git a/zfuncs.cc b/zfuncs.cc
index 0427f99..686b75a 100644
--- a/zfuncs.cc
+++ b/zfuncs.cc
@@ -45,12 +45,14 @@ void appcrash(cchar *pMess, ... )
    va_end(arglist);
    
    printf("appcrash: \n %s \n",message);
-   
+#ifndef __UCLIBC__ 
    nstack = backtrace(stacklist,nstack);                                   //  good for g++ -rdynamic
    stackents = backtrace_symbols(stacklist,nstack);
    for (ii = 0; ii < nstack; ii++) 
       printf(" %s \n",stackents[ii]);
-
+#else
+   printf("backtrace not available\n");
+#endif
    abort();                                                                //  good for gdb backtrace
 }
 
@@ -105,11 +107,13 @@ void zappcrash(cchar *pMess, ... )                                         //  v
 
    printf("zappcrash: \n %s \n",message);                                  //  stdout message      v.3.7
 
+#ifndef __UCLIBC__
    nstack = backtrace(stacklist,nstack);                                   //  get traceback data
    stackents = backtrace_symbols(stacklist,nstack);
 
    for (ii = 0; ii < nstack; ii++)                                         //  stdout backtrace
       printf(" %s \n",stackents[ii]);
+#endif
 
    fid1 = fopen("zappcrash","w");                                          //  text file for backtrace
 
@@ -118,6 +122,7 @@ void zappcrash(cchar *pMess, ... )                                         //  v
    cc = readlink("/proc/self/exe",progexe,300);                            //  get own program path
    progexe[cc] = 0;
 
+#ifndef __UCLIBC__
    for (ii = 0; ii < nstack; ii++)                                         //  output backtrace
    {
       pfunc = 0;
@@ -137,6 +142,7 @@ void zappcrash(cchar *pMess, ... )                                         //  v
 
       fprintf(fid1," %s %s \n",stackents[ii],pfunc);                       //  write to text file
    }
+#endif
 
    fclose(fid1);
    
diff --git a/zfuncs.h b/zfuncs.h
index 9ec9a6b..76b7b44 100644
--- a/zfuncs.h
+++ b/zfuncs.h
@@ -34,7 +34,9 @@
 #include <pthread.h>
 #include <errno.h>
 #include <signal.h>
+#ifndef __UCLIBC__
 #include <execinfo.h>
+#endif
 #include <locale.h>
 #include <sys/inotify.h>