[GHC] #15956: Linker error building `runghc`

GHC ghc-devs at haskell.org
Tue Dec 4 07:15:52 UTC 2018


#15956: Linker error building `runghc`
-------------------------------------+-------------------------------------
        Reporter:  harpocrates       |                Owner:  harpocrates
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.6.3
       Component:  Build System      |              Version:  8.6.2
  (Hadrian)                          |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D5404
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Tamar Christina <tamar@…>):

 In [changeset:"924026e0405396a3f559f163e829b88f30cca49e/ghc" 924026e/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="924026e0405396a3f559f163e829b88f30cca49e"
 Hadrian: include 'findPtr' via find-ptr cabal flag

 Summary:
 This is the latest in the 'findPtr' saga. See

   * 900c47f88784b91517c00be3e1087322e62f698e
   * 561748cb507505bd5b7bd76bdc57796d896b62a2

 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: #15956

 Differential Revision: https://phabricator.haskell.org/D5404
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15956#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list