<div dir="ltr">Hi Simon,<div><br></div><div>Thanks very much for this response.  I believe you're correct; ghc -e 'System.Environment.getEnvironment' segfaults with my ghc build.</div><div><br></div><div>John</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 29, 2014 at 10:36 AM, Simon Marlow <span dir="ltr"><<a href="mailto:marlowsd@gmail.com" target="_blank">marlowsd@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 25/04/2014 02:15, John Lato wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
Hello,<br>
<br>
I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled (on<br>
64-bit linux).  I downloaded the source tarball, added<br>
<br>
DYNAMIC_GHC_PROGRAMS = NO<br>
<br></div>
to mk/<a href="http://build.mk" target="_blank">build.mk</a> <<a href="http://build.mk" target="_blank">http://build.mk</a>>, and did ./configure && ./make.<div class=""><br>
<br>
ghc builds and everything seems to work (cabal installed a bunch of<br>
packages, ghci seems to work), however whenever I try to run Setup.hs<br>
dynamically (either 'runghc Setup.hs configure' or loading it with ghci<br>
and executing 'main') it dumps core.  Compiling Setup.hs works, and<br>
nothing else has caused ghci to crash either (this email is a literate<br>
haskell file equivalent to Setup.hs).<br>
<br>
Building with DYNAMIC_GHC_PROGRAMS = YES works properly.<br>
<br>
With that in mind, I have a few questions:<br>
<br>
  How should I compile a non-dynamic ghc?<br>
  Is this a bug in ghc?<br>
</div></blockquote>
<br>
I think you are running into this: <a href="https://ghc.haskell.org/trac/ghc/ticket/8935" target="_blank">https://ghc.haskell.org/trac/<u></u>ghc/ticket/8935</a><br>
<br>
It took me a *long* time to track that one down.  I still don't know what the root cause is, because I don't understand the system linker's behaviour here.  Given that other people are running into this, we ought to milestone it for 7.8.3 and do something about it.<br>

<br>
Cheers,<br>
Simon<br>
</blockquote></div><br></div>