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 /includes | |
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 'includes')
-rw-r--r-- | includes/rts/storage/InfoTables.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/includes/rts/storage/InfoTables.h b/includes/rts/storage/InfoTables.h index 137cfe2a1e..db50d1613b 100644 --- a/includes/rts/storage/InfoTables.h +++ b/includes/rts/storage/InfoTables.h @@ -156,6 +156,9 @@ typedef union { #if defined(x86_64_TARGET_ARCH) && defined(TABLES_NEXT_TO_CODE) // On x86_64 we can fit a pointer offset in half a word, so put the SRT offset // in the info->srt field directly. +// +// See the section "Referring to an SRT from the info table" in +// Note [SRTs] in CmmBuildInfoTables.hs #define USE_INLINE_SRT_FIELD #endif |