Opened 6 years ago

Last modified 3 years ago

#7388 new bug

CAPI doesn't work with ghci

Reported by: igloo Owned by:
Priority: normal Milestone:
Component: GHCi Version: 7.6.1
Keywords: Cc: pho@…, hvr, jystic@…, redneb
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: T4012
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

$ ghc -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history T4012 --interactive -ignore-dot-ghci   
GHCi, version 7.7.20121101: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 3] Compiling T4012_B          ( T4012_B.hs, interpreted )

ByteCodeLink: can't find label
During interactive linking, GHCi couldn't find the following symbol:
  ghczuwrapperZC0ZCmainZCT4012zuBZCprintf
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session.  Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
  glasgow-haskell-bugs@haskell.org

> 

Change History (12)

comment:1 Changed 6 years ago by igloo

Test Case: T4012

comment:2 Changed 6 years ago by PHO

Cc: pho@… added

comment:3 Changed 6 years ago by igloo

Owner: igloo deleted

comment:4 Changed 5 years ago by thoughtpolice

Milestone: 7.6.27.10.1

Moving to 7.10.1.

comment:5 Changed 4 years ago by thomie

Cc: hvr added

See also #7955.

comment:6 Changed 4 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:7 Changed 3 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:8 Changed 3 years ago by thomie

Milestone: 8.0.1

comment:9 Changed 3 years ago by jystic

Cc: jystic@… added

comment:10 Changed 3 years ago by bgamari

Can someone clarify what "CAPI" means in this context?

comment:11 in reply to:  10 Changed 3 years ago by hvr

Replying to bgamari:

Can someone clarify what "CAPI" means in this context?

Something like

{-# LANGUAGE CApiFFI #-}

import Foreign.C

foreign import capi "stdio.h printf" printfb :: CString -> CInt -> IO ()

There was a minor improvement in the error-message since 7.10 however:

With 7.10 you get the somewhat cryptic message:

[1 of 1] Compiling T4012_B          ( T4012_B.hs, interpreted )

ByteCodeLink: can't find label
During interactive linking, GHCi couldn't find the following symbol:
  ghczuwrapperZC0ZCmainZCT4012zuBZCprintf
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session.  Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
  glasgow-haskell-bugs@haskell.org

whereas with GHC 8.0 you get

[1 of 1] Compiling T4012_B          ( T4012_B.hs, interpreted )
Error: bytecode compiler can't handle some foreign calling conventions
  Workaround: use -fobject-code, or compile this module to .o separately.

comment:12 Changed 3 years ago by redneb

Cc: redneb added
Note: See TracTickets for help on using tickets.