Failure to catch C++ exception in Haskell on OS X

Carter Schonwald carter.schonwald at gmail.com
Sat Jan 5 22:46:56 UTC 2019


Are we talking about Haskell or linking/ calling c plus plus? If the
latter, that’s more of a cabal issue I think?


If you mean ghc build wise
No. The unwind library only supports elf format. Which OS X does not use.

Even that issue aside : ghc currently can’t build with any level of dwarf
enabled on OS X, eg the system linker complains about exceeding some system
section object format limit.

I guess my point is : dwarf data for Haskell libraries on OS X have a few
challenges between here and there.

On Fri, Jan 4, 2019 at 9:29 PM Bas van Dijk <v.dijk.bas at gmail.com> wrote:

> On Fri, 4 Jan 2019 at 23:46, Adam Sandberg Eriksson
> <adam at sandbergericsson.se> wrote:
> > A ticket which seems to cover the same problem:
> https://ghc.haskell.org/trac/ghc/ticket/11829
>
> Wonderful! I can confirm[1] that adding the following to the cabal
> file fixes the problem:
>
>   if os(darwin)
>     ld-options: -Wl,-keep_dwarf_unwind
>
> Shouldn't GHC do this by default when linking on OS X?
>
> Bas
>
> [1]
> https://github.com/basvandijk/darwin-cxx-exception-bug/commit/9b48441606d2fe364c2a21a4ca8ba6b7ff735fe5
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20190105/839069e5/attachment.html>


More information about the ghc-devs mailing list