enable sse2
fi
+check_header_c() {
+ cat >$TMPDIR/1.c <<EOF
+#include <$1>
+int main() {
+ return 0;
+}
+EOF
+ $CC 2>/dev/null $TMPDIR/1.c -o $TMPDIR/1.bin
+}
+
+check_header_c "execinfo.h" && enable execinfo
+
+
echo >>${CONFIG_MAK} $CC_CONFIG_MAK
#
#include <string.h>
#include <signal.h>
#include <ucontext.h>
+#if ENABLE_EXECINFO
#include <execinfo.h>
+#endif
#include <stdio.h>
#include <stdarg.h>
traphandler(int sig, siginfo_t *si, void *UC)
{
ucontext_t *uc = UC;
+#if ENABLE_EXECINFO
static void *frames[MAXFRAMES];
int nframes = backtrace(frames, MAXFRAMES);
Dl_info dli;
+#endif
int i;
const char *reason = NULL;
}
tvhlog_spawn(LOG_ALERT, "CRASH", "%s", tmpbuf);
+#if ENABLE_EXECINFO
tvhlog_spawn(LOG_ALERT, "CRASH", "STACKTRACE");
for(i = 0; i < nframes; i++) {
tvhlog_spawn(LOG_ALERT, "CRASH", "%p", frames[i]);
}
}
+#endif
}