[Q] Need help installing ghc on NetBSD

fis at ssh.com fis at ssh.com
Fri Mar 30 08:47:13 EST 2001



 Hi there,


I don't know whether this should be considered a bug.  I tried to
install the following package:

ftp://ftp.netbsd.org/pub/NetBSD/packages/1.4.2/i386/All/ghc-4.04.tgz

Since installation via the NetBSD standard installation procedure
failed, I patched the paths in the driver and tried to run it
in-place, which sigsegved the linker (see below).

My NetBSD is 1.5 and the package is 1.4.2.  Was the jump between a.out
and ELF between those two?

Anyway I need to get it running somehow.  Any ideas?  Could anyone
provide me with alpha binaries?  I am happy to run whatever you send
me... (-:


 thanks a lot,
  Matthias





===============================================================================-
when I run ghc on Main.hs (a simple hello world), this happens:
===============================================================================

cd /u/fis/tmp/
rm -f *.o *.hi a.out && gmake compile link
/u/fis/ghc-pkg_4.04_NetBSD/bin/ghc -v -c Main.hs
The Glorious Glasgow Haskell Compilation System, version 4.04, patchlevel 1

Effective command line: -v -c

Ineffective C pre-processor:
	echo '{-# LINE 1 "Main.hs" -}' > /tmp/ghc8214.cpp && cat Main.hs >> /tmp/ghc8214.cpp
        0.03 real         0.00 user         0.00 sys
ghc:compile:Output file Main.o doesn't exist
ghc:compile:Interface file Main.hi doesn't exist
ghc:recompile:Input file Main.hs newer than Main.o

Haskell compiler:
	/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/hsc /tmp/ghc8214.cpp  -fignore-interface-pragmas -fomit-interface-pragmas -fsimplify [ -finline-phase2 -fmax-simplifier-iterations4 ]   -fwarn-overlapping-patterns -fwarn-missing-methods -fwarn-duplicate-exports -fhi-version=404 -static -himap=.%.hi:/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/imports/std%.hi    -v -hifile=/tmp/ghc8214.hi -C=/tmp/ghc8214.hc -F=/tmp/ghc8214_stb.c -FH=/tmp/ghc8214_stb.h +RTS -H6000000 -K1000000
Glasgow Haskell Compiler, version 4.04, for Haskell 98, compiled by GHC version 4.04
        9.29 real         1.16 user         0.70 sys

Pin on Haskell consistency info:
	echo 'static char ghc_hsc_ID[] = "@(#)hsc Main.hs	40.0,,";' >> /tmp/ghc8214.hc
        0.05 real         0.00 user         0.00 sys
*** New hi file follows...
__interface Main 404 where
__export Main main;
import IO 1 ! ::;
import PrelAddr 1 ! ::;
import PrelArr 1 ! ::;
import PrelCCall 1 ! ::;
import PrelConc 1 ! ::;
import PrelForeign 1 ! ::;
import PrelIOBase 1 ! ::;
import PrelList 1 ! ::;
import PrelNum 1 ! ::;
import PrelNumExtra 1 ! ::;
main :: PrelIOBase.IO PrelBase.Z0T ;


ghc: module version changed to 1; reason: no old .hi file

Replace .hi file, if changed:
	cmp -s Main.hi /tmp/ghc8214.hi-new || ( rm -f Main.hi && cp /tmp/ghc8214.hi-new Main.hi )
        0.05 real         0.00 user         0.01 sys

C compiler:
	gcc -v  -DDONT_WANT_WIN32_DLL_SUPPORT -S -Wimplicit -O -DSTOLEN_X86_REGS=4 -fomit-frame-pointer -fno-defer-pop  -I. -I/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/includes -I/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/includes ghc8214.c > /tmp/ghc8214.ccout 2>&1 && ( if [ ghc8214.s != /tmp/ghc8214_o.s ] ; then mv ghc8214.s /tmp/ghc8214_o.s ; else exit 0 ; fi )
Using builtin specs.
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
 /usr/libexec/cpp -lang-c -v -I. -I/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/includes -I/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/includes -undef -D__GNUC__=2 -D__GNUC_MINOR__=91 -Di386 -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -D__i386__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -D__i386 -Asystem(unix) -Asystem(NetBSD) -Acpu(i386) -Amachine(i386) -D__OPTIMIZE__ -Wimplicit -DDONT_WANT_WIN32_DLL_SUPPORT -DSTOLEN_X86_REGS=4 ghc8214.c /tmp/ccUhHsyA.i
GNU CPP version egcs-2.91.66 19990314 (egcs-1.1.2 release) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 .
 /u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/includes
 /usr/include
End of search list.
 /usr/libexec/cc1 /tmp/ccUhHsyA.i -quiet -dumpbase ghc8214.c -O -Wimplicit -version -fomit-frame-pointer -fno-defer-pop -o ghc8214.s
GNU C version egcs-2.91.66 19990314 (egcs-1.1.2 release) (i386-netbsd) compiled by GNU C version egcs-2.91.66 19990314 (egcs-1.1.2 release).
        3.11 real         0.22 user         0.13 sys

Unix assembler:
	gcc -o Main.o -c  -I. -I/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/includes -I/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/includes /tmp/ghc8214.s
        0.46 real         0.00 user         0.04 sys

rm -f /tmp/ghc8214*
/u/fis/ghc-pkg_4.04_NetBSD/bin/ghc -v -L/usr/pkg/lib -lHS Main.o -lc -o a.out
The Glorious Glasgow Haskell Compilation System, version 4.04, patchlevel 1

Linker:
	gcc -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 -u _PrelException_stackOverflow_closure -u _PrelException_heapOverflow_closure -u _PrelException_NonTermination_static_closure -o a.out Main.o  -L/usr/pkg/lib -L/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc -lHS -lc -lHS -lHS_cbits -lHSrts -lgmp -lm
Using builtin specs.
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
 /usr/libexec/collect2 -m elf_i386 -dc -dp -e __start -dynamic-linker /usr/libexec/ld.elf_so -o a.out -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 -u _PrelException_stackOverflow_closure -u _PrelException_heapOverflow_closure -u _PrelException_NonTermination_static_closure /usr/lib/crt0.o /usr/lib/crtbegin.o -L/usr/pkg/lib -L/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc -L/usr/libexec Main.o -lH!
S -lc -lHS -lHS_cbits -lHSrts -lgmp -lm -lgcc -lc -lgcc /usr/lib/crtend.o
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/lib/crt0.o: In function `___start':
/usr/lib/crt0.o(.text+0xc1): undefined reference to `main'
Main.o: In function `cPw_entry':
Main.o(.text+0x9): undefined reference to `__DISCARD__'
Main.o(.text+0xe): undefined reference to `stg_gc_enter_1'
Main.o(.text+0x19): undefined reference to `Upd_frame_info'
Main.o(.text+0x38): undefined reference to `PrelPack_unpackCStringzh_closure'
Main.o(.text+0x40): undefined reference to `__DISCARD__'
Main.o(.rodata+0x0): undefined reference to `PrelPack_unpackCStringzh_closure'
Main.o(.rodata+0x4): undefined reference to `IO_putStr_closure'
/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/libHS.a(PrelMain__1.o)(.text+0x56): undefined reference to `_Main_main_closure'
/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/libHS_cbits.a(writeError.o)(.text+0x26): undefined reference to `_errno'
/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/libHS_cbits.a(writeError.o)(.text+0x36): undefined reference to `_write'
/u/fis/ghc-pkg_4.04_NetBSD/lib/ghc/libHS_cbits.a(writeError.o)(.text+0x4a): undefined reference to `_write'
        5.75 real         0.33 user         0.36 sys
deleting... a.out

rm -f /tmp/ghc8243*
gmake: *** [link] Error 1

Compilation exited abnormally with code 2 at Fri Mar 30 16:42:34



===============================================================================
The paths I patched:
===============================================================================

diff -r ghc-pkg--/bin/ghc /u/fis/ghc-pkg_4.04_NetBSD/bin/ghc
1,6c1,7
< #! /usr/pkg/bin/perl
< $bindir='/usr/pkg/bin';
< $libdir='/usr/pkg/lib/ghc';
< $libexecdir='/usr/pkg/lib/ghc';
< $datadir='/usr/pkg/share';
< #! /usr/pkg/bin/perl
---
> #!/usr/pkg/bin/perl
> $fixpaths='/u/fis/ghc-pkg_4.04_NetBSD';
> $bindir='$fixpaths/bin';
> $libdir='$fixpaths/lib/ghc';
> $libexecdir='$fixpaths/lib/ghc';
> $datadir='$fixpaths/share';
> #!/usr/pkg/bin/perl
38,41c39,42
< $libdir="/usr/pkg/lib/ghc";
< $libexecdir="/usr/pkg/lib/ghc";
< $datadir="/usr/pkg/share";
< $bindir="/usr/pkg/bin";
---
> $libdir="$fixpaths/lib/ghc";
> $libexecdir="$fixpaths/lib/ghc";
> $datadir="$fixpaths/share";
> $bindir="$fixpaths/bin";
43c44
< $TOP_PWD="/usr/pkg";
---
> $TOP_PWD="$fixpaths";
diff -r ghc-pkg--/bin/ghc-4.04 /u/fis/ghc-pkg_4.04_NetBSD/bin/ghc-4.04
1,6c1,7
< #! /usr/pkg/bin/perl
< $bindir='/usr/pkg/bin';
< $libdir='/usr/pkg/lib/ghc';
< $libexecdir='/usr/pkg/lib/ghc';
< $datadir='/usr/pkg/share';
< #! /usr/pkg/bin/perl
---
> #!/usr/pkg/bin/perl
> $fixpaths='/u/fis/ghc-pkg_4.04_NetBSD';
> $bindir='$fixpaths/bin';
> $libdir='$fixpaths/lib/ghc';
> $libexecdir='$fixpaths/lib/ghc';
> $datadir='$fixpaths/share';
> #!/usr/pkg/bin/perl
38,41c39,42
< $libdir="/usr/pkg/lib/ghc";
< $libexecdir="/usr/pkg/lib/ghc";
< $datadir="/usr/pkg/share";
< $bindir="/usr/pkg/bin";
---
> $libdir="$fixpaths/lib/ghc";
> $libexecdir="$fixpaths/lib/ghc";
> $datadir="$fixpaths/share";
> $bindir="$fixpaths/bin";
43c44
< $TOP_PWD="/usr/pkg";
---
> $TOP_PWD="$fixpaths";
Only in /u/fis/ghc-pkg_4.04_NetBSD/bin: ghc-4.04~





-- 
Matthias Fischmann | Research Engineer               | +358 (9) 8565 7474
fis at ssh.fi         | SSH Communication Security Corp | +358 (40) 752 5291




More information about the Glasgow-haskell-bugs mailing list