cc1plus.exe of bundled mingw-w64 segfaults

Shao, Cheng cheng.shao at
Sun Sep 2 19:36:11 UTC 2018

I managed to build a ghc bindist which bundles gcc 8.2.0, and
cc1plus.exe works as intended now. However, I'm getting linker errors

    ghc.EXE: unable to load package `ghc-prim-0.5.3'
    ghc.EXE:  |
unknown symbol `__acrt_iob_func'
    ghc.EXE:  |
unknown symbol `__mingw_raise_matherr'
    ghc.EXE:  |
unknown symbol `exp'

I checked ghc-prim.cabal, but saw that on Windows ghc-prim already
links with libmingw32.a/libmingwex.a, which is supposed to provide
`__mingw_raise_matherr`, etc. Is there any other library to link, or
something else has gone wrong? Thank you.
On Sun, Sep 2, 2018 at 10:06 PM, Shao, Cheng <cheng.shao at> wrote:
> Hi folks,
> I'm building a Haskell/C++ hybrid project with a recent revision of
> ghc on Windows, and noticed that cc1plus.exe always segfaults. The
> same code builds fine on AppVeyor however and currently I have no clue
> why it ceases to work on my machine. Is anyone else experiencing a
> similar problem? I'm not sure if it's worth a trac ticket.
> Using cc1plus.exe from a newer version of mingw-w64-x86_64-gcc works
> on my machine, but weird linker errors arise when I attempt to use the
> newer gcc toolchain to override the bundled one. Is there a way to
> manually specify mingw-w64 tarball version/urls when configuring ghc?
> I notice there's an "--enable-distro-toolchain" flag, does it work
> with building a bindist? Thank you.
> Regards,
> Shao Cheng

More information about the ghc-devs mailing list