Hadrian: include 'findPtr' via find-ptr cabal flag

Authored by harpocrates on Mon, Dec 3, 6:21 PM.

Description

Hadrian: include 'findPtr' via find-ptr cabal flag

Summary:
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
with '-DDEBUG':

  • 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

Details

Committed
PhyxTue, Dec 4, 1:15 AM
Reviewer
alpmestan
Differential Revision
D5404: Hadrian: include 'findPtr' via find-ptr cabal flag
Parents
rGHC6090002e19d5: Improve test T14452 for Windows
Branches
Unknown
Tags
Unknown