Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,868
    • Issues 4,868
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #76
Closed
Open
Created Sep 04, 2002 by Simon Marlow@simonmarDeveloper

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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking