Legacy Support for GHC-Based Projects

Ken Cunningham ken.cunningham.webuse at gmail.com
Sun Feb 5 02:19:14 UTC 2023

I sorted out the issue I was having with Template Haskell not finding it's shared libraries, thankfully not too hard in the end to fix.

I also sorted out how to force the use of only system libraries.

Finally, I made a static archive with the emulated TLS objects (same procedure that gcc uses, as it only uses emulated TLS too), and embedded that into the ghc executable, so I don't think there will be any more external linkages to any libraries or symbols any longer.

This x86_64 archive of pandoc 3.0 works on 10.6.8, 10.7, and on an arm64 Ventura system under Rosetta.


I can show someone how to reproducibly build this, I believe, using my ghc-for-older-systems toolchain, legacysupport, and the emutls.a archive I made, but making a portfile for it would be a bit of a project. The cabal config file needs some interesting additions to make everything work and force the system libs...

Hope this is useful. Perhaps it might be used as a binary at least, until things are further sorted.


> On Jan 28, 2023, at 6:57 PM, Ken Cunningham <ken.cunningham.webuse at gmail.com> wrote:
> So, some success. I have now managed to build pandoc on 10.6.8, and it seems to work as expected.
> A small bit of unpleasant hackery is currently involved, that with any luck will be fixed upstream somehow. Exactly how to fix this upstream is not clear to me just yet:
> https://github.com/haskell/cabal/issues/8704
> https://github.com/jgm/unicode-collation/issues/13
> I still have a few packaging issues to work out (it links to MacPorts’ libz instead of the system libz, for one, and it uses 10.6.8’s version of thread-local-storage using emutls that will need to be sorted out before this binary could be used on 10.7+, but the basic plan does work.
> Ken

More information about the macports-dev mailing list