Hello,
I've tried `ghc-4.02-i386-unknown-linux.tar.gz' in-place, but even
"hello world" will dump core.
Some info about my box:
glibc-2.1.1
zhurui@unstable:6:~$ uname -a
Linux monoid 2.0.36 #1 Sat May 29 13:39:30 CEST 1999 i586 unknown
zhurui@unstable:6:~$ gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 Debian GNU/Linux (egcs-1.1.2 release)
zhurui@unstable:6:~$ ld --version
GNU ld 2.9.1
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
Supported emulations:
elf_i386
i386linux
BTW, I've tried to give ghc `-optc-g', but all ghc-4.02 versions which
I have, include those being compiled by myself, cause `ld' to dump
core, even with glibc-2.0.7 and gcc 2.7.2.3 :-(
So where can I find *.hc files to boot ghc? I can only find some
under "ghc/rts" in `ghc-4.02-src.tar.gz'.
All helps will be appreciated.
Regards,
Rui
Example session:
zhurui@monoid:3:~/Temp/functional/haskell/world$ cat world.hs
module Main (main) where
import Prelude
main = do
putStr "Hello, world!\n"
zhurui@unstable:6:~/Temp/functional/haskell/world$ ghc -v -optc-g world.hs
The Glorious Glasgow Haskell Compilation System, version 4.02, patchlevel 0
Effective command line: -v -optc-g
Ineffective C pre-processor:
echo '{-# LINE 1 "world.hs" -}' > /tmp/ghc693.cpp && cat world.hs >>
/tmp/ghc693.cpp
real 0m0.034s
user 0m0.000s
sys 0m0.000s
ghc:compile:Interface file world.hi doesn't exist
Haskell compiler:
/usr/lib/ghc/hsc ,-W ,/tmp/ghc693.cpp -fignore-interface-pragmas
-fomit-interface-pragmas -fsimplify [ -ffloat-lets-exposing-whnf -ffloat-primops-ok
-fcase-of-case -fdo-case-elim -freuse-con -fpedantic-bottoms
-fmax-simplifier-iterations4 ] -fwarn-overlapping-patterns -fwarn-missing-methods
-fwarn-duplicate-exports -fhi-version=402 -himap=.%.hi:/usr/lib/ghc/imports/std%.hi
-v -hifile=/tmp/ghc693.hi -C=/tmp/ghc693.hc -F=/tmp/ghc693_stb.c -FH=/tmp/ghc693_stb.h
+RTS -H6000000 -K1000000
Glasgow Haskell Compiler, version 4.02, for Haskell 98
real 0m13.841s
user 0m6.120s
sys 0m0.330s
Pin on Haskell consistency info:
echo 'static char ghc_hsc_ID[] = "@(#)hsc world.hs 40.0,,";' >>
/tmp/ghc693.hc
real 0m0.001s
user 0m0.000s
sys 0m0.000s
*** New hi file follows...
__interface Main 402 where
import IO 1 :: putStr 1;
import PrelBase 1 :: Monad 1 String 1 addr2Integer 1 foldr 1 int2Integer 1 integer_0 1
integer_1 1 integer_2 1 integer_m1 1 zddmfail 1 zddmzgzg 1 zdfMonadZMZN 1;
import PrelIOBase 1 :: IO 1 zdfMonadIO 1;
import PrelPack 1 :: packCStringzh 1 unpackAppendCStringzh 1 unpackCStringzh 1
unpackFoldrCStringzh 1 unpackNByteszh 1;
__instimport IO ; __instimport PrelAddr ; __instimport PrelArr ; __instimport
PrelBounded ; __instimport PrelCCall ; __instimport PrelConc ; __instimport
PrelForeign ; __instimport PrelIOBase ; __instimport PrelNum ; __instimport
PrelNumExtra ; __instimport PrelStable ; __instimport PrelTup ;
__export Main main;
main :: PrelIOBase.IO PrelBase.Z0T ;
ghc: module version unchanged at 1
Replace .hi file, if changed:
cmp -s Main.hi /tmp/ghc693.hi-new || ( rm -f Main.hi && cp /tmp/ghc693.hi-new
Main.hi )
real 0m0.250s
user 0m0.010s
sys 0m0.010s
C compiler:
cc -v -S -Wimplicit -g -g -O -DSTOLEN_X86_REGS=4 -fomit-frame-pointer
-fno-defer-pop -I. -I/usr/lib/ghc/includes -I/usr/lib/ghc/includes ghc693.c >
/tmp/ghc693.ccout 2>&1 && ( if [ ghc693.s != /tmp/ghc693_o.s ] ; then mv ghc693.s
/tmp/ghc693_o.s ; else exit 0 ; fi )
real 0m4.030s
user 0m0.540s
sys 0m0.160s
Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 Debian GNU/Linux (egcs-1.1.2 release)
/usr/lib/gcc-lib/i486-linux/egcs-2.91.66/cpp -lang-c -v -I. -I/usr/lib/ghc/includes
-I/usr/lib/ghc/includes -undef -D__GNUC__=2 -D__GNUC_MINOR__=91 -D__ELF__ -Dunix
-Di386 -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__i386__ -D__linux__
-D__unix -D__i386 -D__linux -Asystem(posix) -D__OPTIMIZE__ -g -g -Wimplicit
-Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di486 -D__i486
-D__i486__ -DSTOLEN_X86_REGS=4 ghc693.c /tmp/ccn7krmC.i
GNU CPP version egcs-2.91.66 Debian GNU/Linux (egcs-1.1.2 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
.
/usr/lib/ghc/includes
/usr/local/include
/usr/lib/gcc-lib/i486-linux/egcs-2.91.66/include
/usr/include
End of search list.
/usr/lib/gcc-lib/i486-linux/egcs-2.91.66/cc1 /tmp/ccn7krmC.i -quiet -dumpbase
ghc693.c -g -g -O -Wimplicit -version -fomit-frame-pointer -fno-defer-pop -o ghc693.s
GNU C version egcs-2.91.66 Debian GNU/Linux (egcs-1.1.2 release) (i486-linux) compiled
by GNU C version egcs-2.91.66 Debian GNU/Linux (egcs-1.1.2 release).
Unix assembler:
cc -o world.o -c -I. -I/usr/lib/ghc/includes -I/usr/lib/ghc/includes
/tmp/ghc693.s
0.03user 0.03system 0:00.67elapsed 8%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (362major+119minor)pagefaults 0swaps
Linker:
cc -v -u PrelMain_mainIO_closure -u PrelBase_Izh_static_info -u
PrelBase_Czh_static_info -u PrelBase_Fzh_static_info -u PrelBase_Dzh_static_info -u
PrelAddr_Azh_static_info -u PrelAddr_Wzh_static_info -u PrelAddr_I64zh_static_info -u
PrelAddr_W64zh_static_info -u PrelStable_StablePtr_static_info -u
PrelBase_Izh_con_info -u PrelBase_Czh_con_info -u PrelBase_Fzh_con_info -u
PrelBase_Dzh_con_info -u PrelAddr_Azh_con_info -u PrelAddr_Wzh_con_info -u
PrelAddr_I64zh_con_info -u PrelAddr_W64zh_con_info -u PrelStable_StablePtr_con_info -u
PrelBase_False_static_closure -u PrelBase_True_static_closure -u
PrelPack_unpackCString_closure world.o -L/usr/lib/ghc -lHS -lHS_cbits -lHSrts
-lgmp2 -lm
Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 Debian GNU/Linux (egcs-1.1.2 release)
/usr/lib/gcc-lib/i486-linux/egcs-2.91.66/collect2 -m elf_i386 -dynamic-linker
/lib/ld-linux.so.2 -u PrelMain_mainIO_closure -u PrelBase_Izh_static_info -u
PrelBase_Czh_static_info -u PrelBase_Fzh_static_info -u PrelBase_Dzh_static_info -u
PrelAddr_Azh_static_info -u PrelAddr_Wzh_static_info -u PrelAddr_I64zh_static_info -u
PrelAddr_W64zh_static_info -u PrelStable_StablePtr_static_info -u
PrelBase_Izh_con_info -u PrelBase_Czh_con_info -u PrelBase_Fzh_con_info -u
PrelBase_Dzh_con_info -u PrelAddr_Azh_con_info -u PrelAddr_Wzh_con_info -u
PrelAddr_I64zh_con_info -u PrelAddr_W64zh_con_info -u PrelStable_StablePtr_con_info -u
PrelBase_False_static_closure -u PrelBase_True_static_closure -u
PrelPack_unpackCString_closure /usr/lib/crt1.o /usr/lib/crti.o
/usr/lib/gcc-lib/i486-linux/egcs-2.91.66/crtbegin.o -L/usr/lib/ghc
-L/usr/lib/gcc-lib/i486-linux/egcs-2.91.66 world.o -lHS -lHS_cbits -lHSrts -lgmp2 -lm
-lgcc -lc -lgcc /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/crtend.o /usr/lib/crtn!
.o
collect2: ld terminated with signal 11 [Segmentation fault]
Command exited with non-zero status 1
0.62user 0.29system 0:18.44elapsed 4%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (964major+762minor)pagefaults 0swaps
deleting... a.out
rm -f /tmp/ghc693*