What we're doing right now is a little less invasive.
It embeds a patched copy of MPFR, but tweaks the way they store their constant cache, so that it doesn't use the allocator and not tell us about it, but instead stores the cache using a secondary allocation path.
It works. However, we at last check had some limitations loading it with ghci. I'm hopeful that with 7.8 and the less magic dynamic linker that this will "just work".
Before that Dan Peebles took a stab at rehooking the GMP allocator hook for me to introspect on the stack and switch to malloc when called from the constant cache, so we could just link to the host MPFR implementation. That _worked_, but the code was awful, and it wouldn't work from ghci. We couldn't get the allocator rehook to load from ghci because ghci doesn't currently run c++ initialization blocks. This also appears to be fixed in 7.8 so that may be another path forward.
This has been a very slow burn project for me. I need it eventually so I can finish a library for working with Taylor models, where I need the result interval to have proper rounding, so I can say definitively that the answer lies within some small region and can use extra leading terms in the Taylor model to make the intervals involved arbitrarily small, so I don't get swamped in the error.
When that finally works Haskell should be able to compete with
COSY Infinity in computing models for things like accelerator lattices, electron microscopes, spectrographs, etc.