[commit: ghc] wip/erikd/rts: Fix detection and use of `USE_LIBDW` (54b2d1e)

git at git.haskell.org git at git.haskell.org
Sat May 28 11:03:47 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/erikd/rts
Link       : http://ghc.haskell.org/trac/ghc/changeset/54b2d1e5231d86422ffff4eb1217080158c4bc81/ghc

>---------------------------------------------------------------

commit 54b2d1e5231d86422ffff4eb1217080158c4bc81
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Sat May 28 19:49:42 2016 +1000

    Fix detection and use of `USE_LIBDW`


>---------------------------------------------------------------

54b2d1e5231d86422ffff4eb1217080158c4bc81
 configure.ac        | 8 ++++++--
 rts/Libdw.c         | 2 +-
 rts/Libdw.h         | 2 +-
 rts/LibdwPool.c     | 2 +-
 rts/LibdwPool.h     | 2 +-
 rts/posix/Signals.c | 2 +-
 6 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4adf9c5..d621f41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1092,13 +1092,17 @@ AC_DEFINE_UNQUOTED([RTS_LINKER_USE_MMAP], [$RtsLinkerUseMmap],
 
 dnl ** Have libdw?
 dnl --------------------------------------------------------------
+USE_LIBDW=0
 AC_ARG_ENABLE(libdw,
-    [AC_HELP_STRING([--enable-dwarf-unwind],
+    [AC_HELP_STRING([--enable-libdw],
         [Enable DWARF unwinding support in the runtime system via elfutils' libdw [default=no]])],
     [AC_CHECK_LIB(dw, dwfl_attach_state, [HaveLibdw=YES], [HaveLibdw=NO])],
     [HaveLibdw=NO]
 )
-AC_SUBST(HaveLibdw)
+if test "$HaveLibdw" = "YES" ; then
+	USE_LIBDW=1
+fi
+AC_DEFINE_UNQUOTED([USE_LIBDW], [$USE_LIBDW],[Have libdw])
 
 if test -n "$SPHINXBUILD"; then
     BUILD_MAN=YES
diff --git a/rts/Libdw.c b/rts/Libdw.c
index e796840..a16ea59 100644
--- a/rts/Libdw.c
+++ b/rts/Libdw.c
@@ -10,7 +10,7 @@
 #include "RtsUtils.h"
 #include "Libdw.h"
 
-#ifdef USE_LIBDW
+#if USE_LIBDW
 
 #include <elfutils/libdwfl.h>
 #include <dwarf.h>
diff --git a/rts/Libdw.h b/rts/Libdw.h
index e5fa054..bb3e71b 100644
--- a/rts/Libdw.h
+++ b/rts/Libdw.h
@@ -16,7 +16,7 @@
 
 #include "BeginPrivate.h"
 
-#ifdef USE_LIBDW
+#if USE_LIBDW
 
 /* Begin a libdw session. A session is tied to a particular capability */
 LibdwSession *libdwInit(void);
diff --git a/rts/LibdwPool.c b/rts/LibdwPool.c
index 2363212..8d065c3 100644
--- a/rts/LibdwPool.c
+++ b/rts/LibdwPool.c
@@ -10,7 +10,7 @@
 #include "RtsUtils.h"
 #include "LibdwPool.h"
 
-#ifdef USE_LIBDW
+#if USE_LIBDW
 
 #include <unistd.h>
 
diff --git a/rts/LibdwPool.h b/rts/LibdwPool.h
index a6b670e..3c4216d 100644
--- a/rts/LibdwPool.h
+++ b/rts/LibdwPool.h
@@ -14,7 +14,7 @@
 #include "Rts.h"
 #include "Libdw.h"
 
-#ifdef USE_LIBDW
+#if USE_LIBDW
 
 /* Initialize the pool */
 void libdwPoolInit(void);
diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c
index 496ec7b..d73143b 100644
--- a/rts/posix/Signals.c
+++ b/rts/posix/Signals.c
@@ -536,7 +536,7 @@ shutdown_handler(int sig STG_UNUSED)
 static void
 backtrace_handler(int sig STG_UNUSED)
 {
-#ifdef USE_LIBDW
+#if USE_LIBDW
     LibdwSession *session = libdwInit();
     Backtrace *bt = libdwGetBacktrace(session);
     libdwPrintBacktrace(session, stderr, bt);



More information about the ghc-commits mailing list