bug
Alexander V. Voinov
avv at quasar.ipa.nw.ru
Fri Aug 10 21:34:42 EDT 2001
Hi
bash.exe-2.04$ pwd
/cygdrive/d/avv/soft/haskell/testc
bash.exe-2.04$ ghc --interactive -fglasgow-exts
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 5.01, for Haskell
98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.
Loading package std ... linking ... done.
Prelude> :load testh2c.hs
Skipping Main ( testh2c.hs, ./testh2c.o )
ghc: panic! (the `impossible' happened, GHC version 5.01):
resolveObjs: failed
Please report it as a compiler bug to glasgow-haskell-bugs at haskell.org,
or http://sourceforge.net/projects/ghc/.
Prelude> :quit
Leaving GHCi.
ocResolve_PEi386: ./testh2c.o: unknown symbol `_testc'
====================================
testh2c.hs:
module Main where
foreign import ccall "testc" testC :: Int -> Int
main =
do
let n = map testC (take 100 [1..])
print n
====================================
testc.c:
#include <stdio.h>
int testc(int v)
{
return 2 * v + 1;
}
====================================
cd d:/avv/soft/haskell/testc/
gmake -k
ghc -c -fglasgow-exts testh2c.hs
gcc -c -o testc.o testc.c
ghc testh2c.o testc.o -o testh2c.exe
./testh2c.exe
[3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201]
Compilation finished at Fri Aug 10 18:27:56
****************************************************
Now, Linux:
++++++++++++++++++++++++++++++++++++++++++++++++++++
cd /projects/softeng/haskell/testc/
make -k
ghc -c -fglasgow-exts testh2c.hs
cc -c -o testc.o testc.c
ghc testh2c.o testc.o -o testh2c
./testh2c
[3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201]
make: warning: Clock skew detected. Your build may be incomplete.
[avv at str12 testc]$ ghci -fglasgow-exts
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 5.00, For Haskell
98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.
Loading package std ... linking ... done.
Prelude> :load testh2c.hs
Compiling Main ( testh2c.hs, interpreted )
ghc-5.00: panic! (the `impossible' happened, GHC version 5.00):
bytecode generator can't handle unboxed tuples
Please report it as a compiler bug to glasgow-haskell-bugs at haskell.org,
or http://sourceforge.net/projects/ghc/.
Prelude> :quit
Leaving GHCi.
[avv at str12 testc]$
Regards
Alexander
More information about the Glasgow-haskell-bugs
mailing list