clash-lang / clash-compiler

Haskell to VHDL/Verilog/SystemVerilog compiler
https://clash-lang.org/
Other
1.4k stars 149 forks source link

Enable ghc mmap crash workaround for every ghc compiled binary #2572

Closed leonschoorl closed 10 months ago

leonschoorl commented 11 months ago

In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages. That flag added -with-rtsopts=-xm20000000 to some of our binaries.

But other binaries would occasionally still trigger the mmap bug, most importantly ghc itself.

This commit undoes the previous way of applying the workaround and applies the same -xm20000000 RTS option everywhere via the GHCRTS environment variable.

But for this to work we have to link all binaries with the -rtsopts flag, otherwise they'll just ignore the GHCRTS. Unfortunately this is impossible for custom setups, like used by clash-cosim and clash-ffi-example. Therefor we clear the GHCRTS variable when building just those packages. And hope we don't hit the mmap issue while building those.

Still TODO: