
Hello, I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled (on 64-bit linux). I downloaded the source tarball, added DYNAMIC_GHC_PROGRAMS = NO to mk/build.mk, and did ./configure && ./make. ghc builds and everything seems to work (cabal installed a bunch of packages, ghci seems to work), however whenever I try to run Setup.hs dynamically (either 'runghc Setup.hs configure' or loading it with ghci and executing 'main') it dumps core. Compiling Setup.hs works, and nothing else has caused ghci to crash either (this email is a literate haskell file equivalent to Setup.hs). Building with DYNAMIC_GHC_PROGRAMS = YES works properly. With that in mind, I have a few questions: How should I compile a non-dynamic ghc? Is this a bug in ghc? Thanks, John L. * Setup.hs
import Distribution.Simple main = defaultMain

John Lato wrote:
I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled (on 64-bit linux). I downloaded the source tarball, added
DYNAMIC_GHC_PROGRAMS = NO
I've had success with setting both DYNAMIC_BY_DEFAULT = NO DYNAMIC_GHC_PROGRAMS = NO and removing the 'dyn' way altogether from GhcLibWays by setting GhcLibWays = v explicitely. I expect that the latter is optional; my goal was only to speed up the build. (The lines were copied from the perf-cross settings.) Cheers, Bertram

On Apr 25, 2014 5:36 AM, "Bertram Felgenhauer" < bertram.felgenhauer@googlemail.com> wrote:
John Lato wrote:
I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled (on
64-bit
linux). I downloaded the source tarball, added
DYNAMIC_GHC_PROGRAMS = NO
I've had success with setting both
DYNAMIC_BY_DEFAULT = NO DYNAMIC_GHC_PROGRAMS = NO
and removing the 'dyn' way altogether from GhcLibWays by setting GhcLibWays = v explicitely. I expect that the latter is optional; my goal was only to speed up the build.
(The lines were copied from the perf-cross settings.)
I tried disabling dynamicByDefault also, but that didn't help. It may be a problem with lib ways though, I'll try that. Thanks, John
Cheers,
Bertram _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

@john, what version of cabal-install were you using? (i realize you're
probably using the right one, but worth asking :) )
On Fri, Apr 25, 2014 at 12:25 PM, John Lato
On Apr 25, 2014 5:36 AM, "Bertram Felgenhauer" < bertram.felgenhauer@googlemail.com> wrote:
John Lato wrote:
I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled (on
64-bit
linux). I downloaded the source tarball, added
DYNAMIC_GHC_PROGRAMS = NO
I've had success with setting both
DYNAMIC_BY_DEFAULT = NO DYNAMIC_GHC_PROGRAMS = NO
and removing the 'dyn' way altogether from GhcLibWays by setting GhcLibWays = v explicitely. I expect that the latter is optional; my goal was only to speed up the build.
(The lines were copied from the perf-cross settings.)
I tried disabling dynamicByDefault also, but that didn't help. It may be a problem with lib ways though, I'll try that.
Thanks, John
Cheers,
Bertram _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Hi Carter, cabal-install-1.20.0.0, using Cabal 1.20.0.0. But this also happened IIRC with just ghc, no libraries installed, and no cabal anywhere on the path. In any case, thus far the worst behavior I've seen from a too-old cabal is a compile failure, not a core dump :) On Fri, Apr 25, 2014 at 9:47 AM, Carter Schonwald < carter.schonwald@gmail.com> wrote:
@john, what version of cabal-install were you using? (i realize you're probably using the right one, but worth asking :) )
On Fri, Apr 25, 2014 at 12:25 PM, John Lato
wrote: On Apr 25, 2014 5:36 AM, "Bertram Felgenhauer" < bertram.felgenhauer@googlemail.com> wrote:
John Lato wrote:
I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled (on
64-bit
linux). I downloaded the source tarball, added
DYNAMIC_GHC_PROGRAMS = NO
I've had success with setting both
DYNAMIC_BY_DEFAULT = NO DYNAMIC_GHC_PROGRAMS = NO
and removing the 'dyn' way altogether from GhcLibWays by setting GhcLibWays = v explicitely. I expect that the latter is optional; my goal was only to speed up the build.
(The lines were copied from the perf-cross settings.)
I tried disabling dynamicByDefault also, but that didn't help. It may be a problem with lib ways though, I'll try that.
Thanks, John
Cheers,
Bertram _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

John Lato-2 wrote
I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled
Are you able to use template haskell (and qusiquoting) with this? Don't they need dynamic libs? -- View this message in context: http://haskell.1045720.n5.nabble.com/how-to-compile-non-dynamic-ghc-7-8-2-tp... Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.

John Lato-2 wrote
I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled
Are you able to use template haskell (and qusiquoting) with this? Don't they need dynamic libs? -- View this message in context: http://haskell.1045720.n5.nabble.com/how-to-compile-non-dynamic-ghc-7-8-2-tp... Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.

On 25/04/2014 02:15, John Lato wrote:
Hello,
I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled (on 64-bit linux). I downloaded the source tarball, added
DYNAMIC_GHC_PROGRAMS = NO
to mk/build.mk http://build.mk, and did ./configure && ./make.
ghc builds and everything seems to work (cabal installed a bunch of packages, ghci seems to work), however whenever I try to run Setup.hs dynamically (either 'runghc Setup.hs configure' or loading it with ghci and executing 'main') it dumps core. Compiling Setup.hs works, and nothing else has caused ghci to crash either (this email is a literate haskell file equivalent to Setup.hs).
Building with DYNAMIC_GHC_PROGRAMS = YES works properly.
With that in mind, I have a few questions:
How should I compile a non-dynamic ghc? Is this a bug in ghc?
I think you are running into this: https://ghc.haskell.org/trac/ghc/ticket/8935 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. Cheers, Simon

On Tue, Apr 29, 2014 at 10:36 AM, Simon Marlow
On 25/04/2014 02:15, John Lato wrote:
Hello,
I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled (on 64-bit linux). I downloaded the source tarball, added
DYNAMIC_GHC_PROGRAMS = NO
to mk/build.mk http://build.mk, and did ./configure && ./make.
ghc builds and everything seems to work (cabal installed a bunch of packages, ghci seems to work), however whenever I try to run Setup.hs dynamically (either 'runghc Setup.hs configure' or loading it with ghci and executing 'main') it dumps core. Compiling Setup.hs works, and nothing else has caused ghci to crash either (this email is a literate haskell file equivalent to Setup.hs).
Building with DYNAMIC_GHC_PROGRAMS = YES works properly.
With that in mind, I have a few questions:
How should I compile a non-dynamic ghc? Is this a bug in ghc?
I think you are running into this: https://ghc.haskell.org/trac/ ghc/ticket/8935
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.
I just updated the ticket. I think I know what is going on so I added a possible explanation. I'm not sure how you want to fix it.

Hi Simon,
Thanks very much for this response. I believe you're correct; ghc -e
'System.Environment.getEnvironment' segfaults with my ghc build.
John
On Tue, Apr 29, 2014 at 10:36 AM, Simon Marlow
On 25/04/2014 02:15, John Lato wrote:
Hello,
I'd like to compile ghc-7.8.2 with DynamicGhcPrograms disabled (on 64-bit linux). I downloaded the source tarball, added
DYNAMIC_GHC_PROGRAMS = NO
to mk/build.mk http://build.mk, and did ./configure && ./make.
ghc builds and everything seems to work (cabal installed a bunch of packages, ghci seems to work), however whenever I try to run Setup.hs dynamically (either 'runghc Setup.hs configure' or loading it with ghci and executing 'main') it dumps core. Compiling Setup.hs works, and nothing else has caused ghci to crash either (this email is a literate haskell file equivalent to Setup.hs).
Building with DYNAMIC_GHC_PROGRAMS = YES works properly.
With that in mind, I have a few questions:
How should I compile a non-dynamic ghc? Is this a bug in ghc?
I think you are running into this: https://ghc.haskell.org/trac/ ghc/ticket/8935
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.
Cheers, Simon
participants (6)
-
Bertram Felgenhauer
-
Carter Schonwald
-
harry
-
Jason Dagit
-
John Lato
-
Simon Marlow