diff options
author | Alp Mestanogullari <alp@well-typed.com> | 2018-09-12 18:06:02 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-09-12 18:06:44 -0400 |
commit | 900c47f88784b91517c00be3e1087322e62f698e (patch) | |
tree | 7d599df22acf069948988607f474708cb3441e26 /rts | |
parent | 5c48c41239ee2a6228ff469cab8e06763d485c77 (diff) | |
download | haskell-900c47f88784b91517c00be3e1087322e62f698e.tar.gz |
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
Diffstat (limited to 'rts')
-rw-r--r-- | rts/Printer.c | 11 | ||||
-rw-r--r-- | rts/package.conf.in | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/rts/Printer.c b/rts/Printer.c index 291f529e8f..7f7e83cb8b 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 b5ed26d39e..b6dac767fb 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. |