[GHC] #10053: Too late for parseStaticFlags, error in ghci calling main after loading compiled code

GHC ghc-devs at haskell.org
Wed Feb 4 01:49:02 UTC 2015


#10053: Too late for parseStaticFlags, error  in ghci calling main after loading
compiled code
-------------------------------------+-------------------------------------
        Reporter:  George            |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  GHCi              |                 Version:  7.10.1-rc2
      Resolution:                    |                Keywords:
Operating System:  MacOS X           |            Architecture:  x86_64
 Type of failure:  Incorrect result  |  (amd64)
  at runtime                         |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by George):

 I can reproduce it with -fobject-code set in .ghci
 But I can also do it no .ghci and just loading object code
 I now have a file mainbug.hs that consists of

 {{{
 main =
     print "hello"
 }}}

 I can reproduce it as follows:

 {{{
  ghc -dynamic mainbug.hs
 [1 of 1] Compiling Main             ( mainbug.hs, mainbug.o )
 Linking mainbug ...
 bash-3.2$ ghci
 GHCi, version 7.10.0.20150123: http://www.haskell.org/ghc/  :? for help
 Prelude> :load mainbug
 Ok, modules loaded: Main.
 Prelude Main> :show modules
 Main             ( mainbug.hs, mainbug.o )
 Prelude Main> main
 Too late for parseStaticFlags: call it before runGhc or runGhcT
 *** Exception: ExitFailure 1
 }}}

 Loading it interpreted works fine:

 {{{
 rm mainbug.o
 bash-3.2$ ghci
 GHCi, version 7.10.0.20150123: http://www.haskell.org/ghc/  :? for help
 Prelude> :load mainbug
 [1 of 1] Compiling Main             ( mainbug.hs, interpreted )
 Ok, modules loaded: Main.
 *Main> main
 "hello"
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10053#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list