[commit: ghc] master: rts/Printer.c: always define the findPtr symbol (900c47f)

git at git.haskell.org git at git.haskell.org
Wed Sep 12 22:07:29 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/900c47f88784b91517c00be3e1087322e62f698e/ghc

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

commit 900c47f88784b91517c00be3e1087322e62f698e
Author: Alp Mestanogullari <alp at well-typed.com>
Date:   Wed Sep 12 18:06:02 2018 -0400

    rts/Printer.c: always define the findPtr symbol
    
    It was previously only defined (and therefore shipped) when DEBUG is
    defined.  This patch defines it regardless of DEBUG. This will help fix
    hadrian on OS X [1].
    
    [1]: https://github.com/snowleopard/hadrian/issues/614
    
    Test Plan: The error from hadrian#614 is gone
    
    Reviewers: bgamari, erikd, simonmar
    
    Reviewed By: simonmar
    
    Subscribers: rwbarton, carter
    
    Differential Revision: https://phabricator.haskell.org/D5138


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

900c47f88784b91517c00be3e1087322e62f698e
 rts/Printer.c       | 11 ++++++++---
 rts/package.conf.in |  4 ----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/rts/Printer.c b/rts/Printer.c
index 291f529..7f7e83c 100644
--- a/rts/Printer.c
+++ b/rts/Printer.c
@@ -24,6 +24,8 @@
 
 #include <string.h>
 
+void findPtr(P_ p, int follow);
+
 #if defined(DEBUG)
 
 #include "Disassembler.h"
@@ -775,8 +777,6 @@ extern void DEBUG_LoadSymbols( const char *name STG_UNUSED )
 
 #endif /* USING_LIBBFD */
 
-void findPtr(P_ p, int);                /* keep gcc -Wall happy */
-
 int searched = 0;
 
 static int
@@ -876,7 +876,12 @@ void printObj( StgClosure *obj )
     debugBelch("obj 0x%p (enable -DDEBUG for more info) " , obj );
 }
 
-
+void findPtr(P_ p, int follow)
+{
+    // we're printing the arguments just to silence the unused parameter warning
+    debugBelch("recompile your program with -debug in order to run ");
+    debugBelch("findPtr(0x%p, %d)\n", p, follow);
+}
 #endif /* DEBUG */
 
 /* -----------------------------------------------------------------------------
diff --git a/rts/package.conf.in b/rts/package.conf.in
index b5ed26d..b6dac76 100644
--- a/rts/package.conf.in
+++ b/rts/package.conf.in
@@ -174,11 +174,9 @@ ld-options:
 #if WORD_SIZE_IN_BITS == 64
          , "-Wl,-u,_hs_atomicwrite64"
 #endif
-#if defined(DEBUG)
           /* This symbol is useful in gdb, but not referred to anywhere,
            * so we need to force it to be included in the binary. */
          , "-Wl,-u,_findPtr"
-#endif
 #else
            "-Wl,-u,base_GHCziTopHandler_runIO_closure"
          , "-Wl,-u,base_GHCziTopHandler_runNonIO_closure"
@@ -277,12 +275,10 @@ ld-options:
 #if WORD_SIZE_IN_BITS == 64
          , "-Wl,-u,hs_atomicwrite64"
 #endif
-#if defined(DEBUG)
           /* This symbol is useful in gdb, but not referred to anywhere,
            * so we need to force it to be included in the binary. */
          , "-Wl,-u,findPtr"
 #endif
-#endif
 
 /*  Pick up static libraries in preference over dynamic if in earlier search
  *  path.  This is important to use the static gmp in preference on Mac OS.



More information about the ghc-commits mailing list