[GHC] #2459: can't link haskell without "main" function, or -no-hs-main broken on windows?

GHC ghc-devs at haskell.org
Tue Jan 5 19:55:18 UTC 2016


#2459: can't link haskell without "main" function, or -no-hs-main broken on
windows?
-------------------------------------+-------------------------------------
        Reporter:  jvl               |                Owner:
            Type:  bug               |               Status:  new
        Priority:  lowest            |            Milestone:  8.0.1
       Component:  Driver            |              Version:  6.8.2
      Resolution:                    |             Keywords:
Operating System:  Windows           |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash                              |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by thomie):

 It seems the first issue is fixed.

 Without `-no-hs-main` we get a link error, as expected:
 {{{
 $ ghc --version
 The Glorious Glasgow Haskell Compilation System, version 7.10.3
 $ ghc -c -o MyHelloWorld.o MyHelloWorld.hs
 $ ghc -o hello.exe mymain.c MyHelloWorld.o -fforce-recomp
 C:\msys64\tmp\ghc5784_0\ghc_4.o:ghc_3.c:(.text+0x0): multiple definition
 of `main'
 }}}

 With `-no-hs-main` it works:
 {{{
 $ ghc -c -o MyHelloWorld.o MyHelloWorld.hs
 $ ghc -no-hs-main -o hello.exe mymain.c MyHelloWorld.o -fforce-recomp
 $ ./hello.exe
 Hello World
 }}}

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


More information about the ghc-tickets mailing list