rts/Printer.c: always define the findPtr symbol
ClosedPublic

Authored by alpmestan on Sep 7 2018, 7:45 AM.

Details

Summary

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

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
alpmestan created this revision.Sep 7 2018, 7:45 AM

I presume this is because we can't use the same method that the old build system uses? https://phabricator.haskell.org/diffusion/GHC/browse/master/rts%2Fpackage.conf.in$177-181

@simonmar Absolutely (see e.g the discussion here). In fact, you ended up "recommending" this approach yourself in D4846 , so I just went ahead and implemented it. :)

The only decent alternative that I see would be to have a cabal flag that we would set whenever we're building the RTS with -DDEBUG. We could then use good old .cabal conditionals to selectively pass or omit some options wherever we like. I don't feel great about introducing this and the complexity that goes with it (and in both build systems!) just for our small findPtr problem, when we have the solution from this diff and its 7 silly lines.

alpmestan updated this revision to Diff 17943.Sep 7 2018, 12:35 PM
  • address unused parameter error

Ok, could you also remove the hack in rts/package.conf.in since that's no longer necessary?

rts/Printer.c
879–884

Could you make it print a message to suggest recompiling with -debug? Otherwise the user could get confused.

alpmestan updated this revision to Diff 17959.Sep 10 2018, 5:31 AM
  • remove findPtr hack in rts/package.conf.in, give an helpful error message when not running a debugged RTS
  • silence unused argument warning/error
alpmestan marked an inline comment as done.Sep 10 2018, 5:33 AM

@simonmar I implemented both of your suggestions. Thanks!

Looks like that didn't break anything for the make build system either, judging from the harbormaster builds.

simonmar accepted this revision.Sep 11 2018, 11:23 AM
This revision is now accepted and ready to land.Sep 11 2018, 11:23 AM
This revision was automatically updated to reflect the committed changes.