drop DumpBacktrace
authorEvan Martin <martine@danga.com>
Mon, 28 Feb 2011 20:02:01 +0000 (12:02 -0800)
committerEvan Martin <martine@danga.com>
Mon, 28 Feb 2011 20:02:01 +0000 (12:02 -0800)
It wasn't that helpful; simplifies other platforms to just not use it.

bootstrap.sh
src/util.cc

index 571c98c..5c9b950 100755 (executable)
@@ -23,7 +23,7 @@ if [ "${SYSTEMNAME}" = "Linux" ]; then
     EXTRA_LDFLAGS=
 elif [ "${SYSTEMNAME}" = "FreeBSD" ]; then
     EXTRA_CFLAGS="-I/usr/local/include"
-    EXTRA_LDFLAGS="-L/usr/local/lib -lexecinfo"
+    EXTRA_LDFLAGS="-L/usr/local/lib"
 fi
 
 cat >config.ninja <<EOT
@@ -37,11 +37,7 @@ EOT
 
 echo "Building ninja manually..."
 srcs=$(ls src/*.cc | grep -v test)
-if [ "${SYSTEMNAME}" = "Linux" ]; then
-    g++ -Wno-deprecated -o ninja.bootstrap $srcs
-elif [ "${SYSTEMNAME}" = "FreeBSD" ]; then
-    g++ -Wno-deprecated ${EXTRA_CFLAGS} ${EXTRA_LDFLAGS} -o ninja.bootstrap $srcs
-fi
+g++ -Wno-deprecated ${EXTRA_CFLAGS} ${EXTRA_LDFLAGS} -o ninja.bootstrap $srcs
 
 echo "Building ninja using itself..."
 ./ninja.bootstrap ninja
index 2eb4559..1968702 100644 (file)
 
 #include "util.h"
 
-#include <execinfo.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 
-void DumpBacktrace(int skip_frames) {
-  void* stack[256];
-  int size = backtrace(stack, 256);
-  ++skip_frames;  // Skip ourselves as well.
-  backtrace_symbols_fd(stack + skip_frames, size - skip_frames, 2);
-}
-
 void Fatal(const char* msg, ...) {
   va_list ap;
   fprintf(stderr, "FATAL: ");
@@ -33,6 +25,5 @@ void Fatal(const char* msg, ...) {
   vfprintf(stderr, msg, ap);
   va_end(ap);
   fprintf(stderr, "\n");
-  DumpBacktrace(1);
   exit(1);
 }