OSDN Git Service

gallivm: Disable LLVM's pretty stack trace dumper.
authorJosé Fonseca <jfonseca@vmware.com>
Sun, 29 Aug 2010 11:05:36 +0000 (12:05 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 30 Aug 2010 12:27:28 +0000 (13:27 +0100)
By default LLVM adds a signal handler to output a pretty stack trace.
This signal handler is never removed, causing problems when unloading
the shared object where the gallium driver resides.

Thanks to Chris Li for finding this.

src/gallium/auxiliary/gallivm/lp_bld_misc.cpp

index 92f9adf..48baf7c 100644 (file)
@@ -40,6 +40,7 @@
 #include <llvm/ExecutionEngine/ExecutionEngine.h>
 #include <llvm/ExecutionEngine/JITEventListener.h>
 #include <llvm/Support/CommandLine.h>
+#include <llvm/Support/PrettyStackTrace.h>
 
 #include "pipe/p_config.h"
 #include "util/u_debug.h"
@@ -161,6 +162,13 @@ lp_set_target_options(void)
       llvm::cl::ParseCommandLineOptions(2, const_cast<char**>(options));
       first = FALSE;
    }
+
+   /*
+    * By default LLVM adds a signal handler to output a pretty stack trace.
+    * This signal handler is never removed, causing problems when unloading the
+    * shared object where the gallium driver resides.
+    */
+   llvm::DisablePrettyStackTrace = true;
 }