how to compile non-dynamic ghc-7.8.2 ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

how to compile non-dynamic ghc-7.8.2 ?

John Lato-2
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

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile non-dynamic ghc-7.8.2 ?

Bertram Felgenhauer-2
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
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile non-dynamic ghc-7.8.2 ?

John Lato-2


On Apr 25, 2014 5:36 AM, "Bertram Felgenhauer" <[hidden email]> 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
> [hidden email]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile non-dynamic ghc-7.8.2 ?

Carter Schonwald
@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 <[hidden email]> wrote:


On Apr 25, 2014 5:36 AM, "Bertram Felgenhauer" <[hidden email]> 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
> [hidden email]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile non-dynamic ghc-7.8.2 ?

Jonathon Delgado
In reply to this post by John Lato-2
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?
Reply | Threaded
Open this post in threaded view
|

Re: how to compile non-dynamic ghc-7.8.2 ?

John Lato-2
In reply to this post by Carter Schonwald
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 <[hidden email]> 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 <[hidden email]> wrote:


On Apr 25, 2014 5:36 AM, "Bertram Felgenhauer" <[hidden email]> 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
> [hidden email]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users




_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile non-dynamic ghc-7.8.2 ?

Simon Marlow-7
In reply to this post by John Lato-2
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
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile non-dynamic ghc-7.8.2 ?

Jason Dagit-3



On Tue, Apr 29, 2014 at 10:36 AM, Simon Marlow <[hidden email]> wrote:
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.



_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile non-dynamic ghc-7.8.2 ?

John Lato-2
In reply to this post by Simon Marlow-7
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 <[hidden email]> wrote:
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


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: how to compile non-dynamic ghc-7.8.2 ?

Jonathon Delgado
In reply to this post by Jonathon Delgado
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?