Hi,
we have compiled GHC version 3.03 under Solaris and under Linux without
any serious errors. The compilation under Linux works well, but the Solaris
binary only produces code that ends up in bus errors, no matter what it
should do.
Below is the output of the compilation of Main.hs which is the well-known
hello-world test file, just as it is suggested in the documentation. It is
followed by what "truss hello" has reported.
Thanks for any help,
Martin
menelaos [~] 125) ghc -v -o hello Main.hs
The Glorious Glasgow Haskell Compilation System, version 3.03, patchlevel 0
Effective command line: -v -o hello
Ineffective C pre-processor:
echo '{-# LINE 1 "Main.hs" -}' /tmp/ghc4865.cpp cat Main.hs
/tmp/ghc4865.cpp
0.00user 0.01system 0:00.01elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
Haskell compiler:
/usr/local/lib/hsc ,-W ,/tmp/ghc4865.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 -fclone-binds
-fmax-simplifier-iterations4 ] -fwarn-overlapping-patterns -fwarn-missing-methods
-fwarn-duplicate-exports
-fhi-version=303 -himap=.%.hi:/usr/local/lib/imports/std%.hi -v
-hifile=/tmp/ghc4865.hi -S=/tmp/ghc4865.s -F= -FH=
+RTS -H600 -K100
Glasgow Haskell Compiler, version3.03, for Haskell 1.4
1.50user 0.08system 0:01.62elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
Pin on Haskell consistency info:
echo '
.text
hsc.Main.hs.33.0..:' /tmp/ghc4865.s
0.00user 0.01system 0:00.01elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
*** New hi file follows...
_interface_ Main 303
_instance_modules_
IO PrelAddr PrelArr PrelBounded PrelCCall PrelConc PrelForeign PrelIOBase PrelNum
_usages_
IO 1 :: putStr 1;
PrelBase 1 :: $dEval0 1 $dEval1 1 $dEvalBool0 1 $dEvalChar0 1 $dEvalDouble0 1
$dEvalInt0 1 Eval 1 String 1;
PrelIOBase 1 :: $dEvalIO0 1 $dEvalIOResult0 1 IO 1 IOResult 1;
_exports_
Main main;
_declarations_
main _:_ PrelIOBase.IO PrelBase.() ;;
ghc: module version unchanged at 1
Replace .hi file, if changed:
cmp -s Main.hi /tmp/ghc4865.hi-new || ( rm -f Main.hi cp
/tmp/ghc4865.hi-new Main.hi )
0.00user 0.00system 0:00.01elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
Unix assembler:
gcc -o Main.o -c /tmp/ghc4865.s
0.02user 0.01system 0:00.17elapsed 17%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
Linker:
gcc -v -u PrelBase_Z91Z93_closure -u PrelBase_IZh_static_info -u
PrelBase_CZh_static_info -u
PrelBase_False_inregs_info -u PrelBase_True_inregs_info -u DEBUG_REGS -o hello Main.o
/usr/local/lib/TopClosure.o
-L/usr/local/lib -lHS -lHS_cbits -lHSrts -lHSclib -lgmp -lm
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/specs
gcc version 2.8.1
/usr/local/sparc-sun-solaris2.6/bin/ld -V -Y P,/usr/ccs/lib:/usr/lib -Qy -o hello -u
PrelBase_Z91Z93_closure -u
PrelBase_IZh_static_info -u PrelBase_CZh_static_info -u PrelBase_False_inregs_info -u
PrelBase_True_inregs_info -u
DEBUG_REGS /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/crt1.o
/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/crti.o /usr/ccs/lib/values-Xa.o
/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/crtbegin.o -L/usr/local/lib
-L/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1
-L/usr/local/sparc-sun-solaris2.6/lib -L/usr/ccs/bin -L/usr/ccs/lib
-L/usr/local/lib Main.o /usr/local/lib/TopClosure.o -lHS -lHS_cbits -lHSrts -lHSclib
-lgmp -lm -lgcc -lc -lgcc
/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/crtend.o
/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/crtn.o
GNU ld version 2.9.1 (with BFD 2.9.1)
Supported emulations:
elf32_sparc
0.56user 0.16system 0:01.56elapsed 46%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+0minor)pagefaults 0swaps
Checking consistency of: hello
rm -f /tmp/ghc4865*
menelaos [~] 126) hello
Bus error (core dumped)
menelaos [~] 127) truss hello
execve("./hello", 0xEAD0, 0xEAD8) argc = 1
open("/usr/ccs/lib/libm.so.1", O_RDONLY)Err#2 ENOENT
open("/usr/lib//libm.so.1", O_RDONLY) = 3
fstat(3, 0xE668)= 0
mmap(0x, 8192, PROT_READ|PROT_EXEC, MAP_SHARED, 3, 0) = 0xEF7B
mmap(0x, 155648, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xEF78
munmap(0xEF796000, 57344) = 0
mmap(0xEF7A4000, 7309, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3,
81920) = 0xEF7A4000
close(3)= 0
open("/usr/ccs/lib/libc.so.1", O_RDONLY)Err#2 ENOENT
open("/usr/lib//libc.so.1", O_RDONLY) = 3
fstat(3, 0xE668)= 0
mmap(0xEF7B, 8192,