[GHC] #15446: compiling files in ghci on MacOS eventually results in malformed mach-o: load commands size (32800) > 32768

GHC ghc-devs at haskell.org
Wed Aug 1 23:39:28 UTC 2018


#15446: compiling files in ghci on MacOS eventually results in malformed mach-o:
load commands size (32800) > 32768
-------------------------------+--------------------------------------
        Reporter:  George      |                Owner:  (none)
            Type:  bug         |               Status:  patch
        Priority:  normal      |            Milestone:  8.6.1
       Component:  GHCi        |              Version:  8.4.3
      Resolution:              |             Keywords:
Operating System:  MacOS X     |         Architecture:  x86_64 (amd64)
 Type of failure:  GHCi crash  |            Test Case:
      Blocked By:              |             Blocking:
 Related Tickets:              |  Differential Rev(s):  Phab:D5021
       Wiki Page:              |
-------------------------------+--------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"b803c40608119469bdda330cb88860be2cbed25b/ghc"
 b803c406/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="b803c40608119469bdda330cb88860be2cbed25b"
 linker: Nub rpaths

 When compiling and linking files in `ghci`, we keep adding rpath
 arguments to the linker command invoation.  If those are identical we
 should `nub` them out.  Otherwise we not only risk overflowing the
 argument limit, but also embed huge amounts of identical rpath values
 into the dynamic library, eventually leading to the overflow of the load
 command size limit, due to the number of rpath entries alone.

 A further improvement could be to pass `-Xlinker -dead_strip_dylibs`;
 that however might be stipping too aggressively, and potentially lead to
 missing symbols?

 For the time being I suggest to only do the nubbing and if need be to
 provide -Wl,-dead_strip_dylibs when invoking ghci.

 Test Plan: ./validate

 Reviewers: bgamari, hvr

 Reviewed By: bgamari

 Subscribers: rwbarton, thomie, carter

 GHC Trac Issues: #15446

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

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


More information about the ghc-tickets mailing list