• Ben Gamari's avatar
    Disable the SRT offset optimisation on MachO platforms · bf10456e
    Ben Gamari authored
    Unfortunately, this optimisation is infeasible on MachO platforms (e.g.
    Darwin) due to an object format limitation. Specifically, linking fails
    with errors of the form:
    
         error: unsupported relocation with subtraction expression, symbol
         '_integerzmgmp_GHCziIntegerziType_quotInteger_closure' can not be
         undefined in a subtraction expression
    
    Apparently MachO does not permit relocations' subtraction expressions to
    refer to undefined symbols. As far as I can tell this means that it is
    essentially impossible to express an offset between symbols living in
    different compilation units. This means that we lively can't use this
    optimisation on MachO platforms.
    
    Test Plan: Validate on Darwin
    
    Reviewers: simonmar, erikd
    
    Subscribers: rwbarton, thomie, carter, angerman
    
    GHC Trac Issues: #15169
    
    Differential Revision: https://phabricator.haskell.org/D4715
    bf10456e
CmmBuildInfoTables.hs 26.4 KB