Hadrian: include 'findPtr' via find-ptr cabal flag
This is the latest in the 'findPtr' saga. See
for the previous attempts. The problem with re-using the 'debug'
cabal flag for the purpose of forcing inclusion of 'findPtr' occurs
when 'debug' is one of the RTS ways, but RTS is not being compiled
- the 'debug' flag gets passed to cabal, signalling to build 'rts' with the debug flavour, but also forcing inclusion of the 'findPtr'/'_findPtr' symbol
- since '-DDEBUG' isn't enabled, that symbol doesn't show up in the libraries, so executable that depend on 'rts' (everything) will end up always requiring 'findPtr'/'_findPtr' but 'rts' won'y provide it!
The fix is simple: create a a new 'find-ptr' cabal-flag whose only
purpose is forcing '-Wl,-u,findPtr'/'-Wl,-u,_findPtr'. Then, enable that
flag when the RTS is being compiled with '-DDEBUG'
Test Plan: ./hadrian/build.sh -c # on mac
Reviewers: alpmestan, snowleopard, bgamari, erikd, simonmar, Phyx
Reviewed By: alpmestan, snowleopard, Phyx
Subscribers: Phyx, rwbarton, carter
GHC Trac Issues: Trac #15956
Differential Revision: https://phabricator.haskell.org/D5404