GHCi crashes calling a C function imported from a static library on Windows
Script to reproduce:
cat >f.c <<EOF
int f(int x) { return x*2; }
EOF
cat >TestLink.hs <<EOF
module TestLink where
import Foreign.C
foreign import ccall "f" f :: CInt -> IO CInt
test :: IO ()
test = f 42 >>= print
EOF
ghc -c f.c -o f.o
ar cqs libfoo.a f.o
echo "test" | ghci libfoo.a TestLink.hs
(which is also the test ghcilink001
I shall be adding shortly as part of the fix for #5289 (closed)).
Note that this bug only becomes visible after the fix for #5289 (closed), because before that GHCi would not load static libraries specified on the command line.
Trac metadata
Trac field | Value |
---|---|
Version | 7.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | high |
Resolution | Unresolved |
Component | GHCi |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown/Multiple |
Architecture |