diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2018-05-22 09:36:35 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-05-23 16:49:51 -0400 |
commit | bf10456edaa03dc010821cd4c3d9f49cb11d89da (patch) | |
tree | 38c508cad2bd3690fafd6f3d96d3dc1b029ed45a /compiler/cmm/CmmInfo.hs | |
parent | d424d4a46a729f8530e9273282d22b6b8f34daaa (diff) | |
download | haskell-bf10456edaa03dc010821cd4c3d9f49cb11d89da.tar.gz |
Disable the SRT offset optimisation on MachO platforms
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
Diffstat (limited to 'compiler/cmm/CmmInfo.hs')
-rw-r--r-- | compiler/cmm/CmmInfo.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/cmm/CmmInfo.hs b/compiler/cmm/CmmInfo.hs index 3b2eea1a5e..43cba2526d 100644 --- a/compiler/cmm/CmmInfo.hs +++ b/compiler/cmm/CmmInfo.hs @@ -271,7 +271,10 @@ mkSRTLit dflags _ Nothing = ([], CmmInt 0 (halfWordWidth dflags)) mkSRTLit dflags _ (Just lbl) = ([CmmLabel lbl], CmmInt 1 (halfWordWidth dflags)) --- | is the SRT offset field inline in the info table on this platform? +-- | Is the SRT offset field inline in the info table on this platform? +-- +-- See the section "Referring to an SRT from the info table" in +-- Note [SRTs] in CmmBuildInfoTables.hs inlineSRT :: DynFlags -> Bool inlineSRT dflags = platformArch (targetPlatform dflags) == ArchX86_64 && tablesNextToCode dflags |