Dynamic only GHC
Austin Seipp
austin at well-typed.com
Mon Oct 20 14:39:57 UTC 2014
Sorry, I confused 'DynamicGhcPrograms' merely with 'DynamicGhc'. In
other words: DynamicGhc means exactly what I said before - dynamic
GHC, static everything else.
As for the reason why the switch wasn't made for x86, I was not privvy
to the decision at the time, but I imagine it's one of consistency. To
ship a x64 GHC with these features (where it was acceptable) but not a
32bit one means essentially you force 32bit users into one of two
situations:
- Your compiled program may not work in GHCi, or at all in some
corner cases, and most of the bugs that were there are effectively
unfixed.
- Your compiled program suffers a noticeable performance hit, due to
register theft.
Which is rather unfortunate. On the other hand, if you dynamically
link GHC only, only GHC itself pays a hit on the dynamic linking, and
your remaining programs are unaffected.
On Mon, Oct 20, 2014 at 9:32 AM, Jeremy <voldermort at hotmail.com> wrote:
> Austin Seipp <austin <at> well-typed.com> writes:
>
>> As far as I'm aware, Dynamic-by-default GHC is actually broken, and I
>> don't know for how long this has been the case.
>>
>> For some history: originally when all this was being decided to try
>> and fix the linker issues in GHC, dynamic by default was considered an
>> option, but was rejected in favor of DynamicGhcPrograms. Why was it
>> rejected? Well, dynamic by default particularly hurts 32bit x86, which
>> suffers from a very pathetic set of registers, and dynamic programs
>> steal one of these for the GOT (%ebx IIRC).
>>
>> On the other hand, DynamicGhcPrograms instead means GHC builds
>> everything statically, *except itself*, which it builds as a
>> dynamically linked executable. The idea is you dynamically link GHC
>> itself to fix linker issues, and end-user programs remain static,
>> which is the expected mode of operation.
>
> Thank you for the detailed explanation (although I still don't understand
> why DYNAMIC_BY_DEFAULT by default wasn't kept for x64.)
>
> Where does GhcDynamic fit into this?
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
--
Regards,
Austin Seipp, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com/
More information about the Glasgow-haskell-users
mailing list