x86 NCG bug with stdcall f.i. "wrapper"
Original message from Sven Panne:
HOpenGL did it once again... :-} The NCG for x86
doesn't honour the calling convention for "wrappers":
-- example module ------------------------------------
module CB where
import Foreign.C.Types ( CInt )
import Foreign.Ptr ( FunPtr )
type Callback = CInt -> IO ()
foreign import ccall "wrapper" makeCallback1 ::
Callback -> IO (FunPtr Callback)
foreign import stdcall "wrapper" makeCallback2 ::
Callback -> IO (FunPtr Callback)
-- shell transcript ----------------------------------
$ rm -f *.o ; ghc -c -fffi CB.hs ; nm *.o|grep _CB_d
U _CB_dS1
U _CB_dS2 <= !!!!!!!!!! @8 is missing
00000008 T _CB_dS1
00000070 T _CB_dS2@8
$ rm -f *.o ; ghc -c -fffi CB.hs -O ; nm *.o|grep
_CB_d
U _CB_dUu@8
U _CB_dUv
00000070 T _CB_dUu@8
------------------------------------------------------
I'd be grateful if this would be be fixed for the next
patchlevel release.
Cheers,
S.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 5.04 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | ResolvedFixed |
| Component | Compiler (FFI) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |