ghc 7.4.1 not producing stub.o files
Asked Answered
B

1

5

I'm running the default installation of Haskell platform on Ubuntu and when I run this example http://www.haskell.org/haskellwiki/Calling_Haskell_from_C "ghc -c -O Safe.hs" is not producing the Safe_stub.o file. I have checked this on a separate installation of Ubuntu on a friends box and on both 32 bit and 64 bit Ubuntu installs.

Can somebody confirm if this is specific to ghc-7.4.1 or Ubuntu installs only?

Thanks!

Bresnahan answered 11/6, 2012 at 16:5 Comment(0)
P
10

It's a ghc-7.4 (ghc >= 7.2 actually) thing. That doesn't need and produce *_stub.o (or *_stub.c) files anymore. However, the command line for the final compilation has to change

$ ghc -no-hs-main -optc-O test.c Safe.o  -o test

You have to tell GHC that the main is not a haskell call.

Providenciaprovident answered 11/6, 2012 at 16:15 Comment(1)
Good to know, I was on #haskell irc and a user said it was still in the specifications and that the stub might have just been redirected. Thanks, when I get around to it, i'll update the haskell wiki to reflect this.Bresnahan

© 2022 - 2024 — McMap. All rights reserved.