Subject: Re: Cross-compiling HBC
To: None <xiamin@scdesantis.ne.mediaone.net>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: port-mac68k
Date: 07/28/1998 11:43:48
> I'm trying to cross-compile HBC (a Haskell compilier) on a Linux box for
> my NetBSD/mac68k machine. I've built binutils and gcc for my mahcine on
> the Linux box and have them installed in decent places. I also installed
> /usr/include and /usr/lib into ~/local/{include,lib} (I'm not sure if
> that's the correct thing to do though, I'm working from the
> cross-compilation HOW-TO on macbsd.com, which doesn't mention /usr/lib).
> However, when I try to make HBC (using my gcc) I get this:
> xiamin@uberjihad ~/hbc/src % make universe
> cd syntax; make EXE= SYSTEM='-D__NetBSD__' STATICFLAG='' myinstall
> make[1]: Entering directory `/h1/xiamin/hbc/src/syntax'
> cd ugendir; make EXE=
> make[2]: Entering directory `/h1/xiamin/hbc/src/syntax/ugendir'
> sh ../../bin/mycc -s main.o gen.o lex.yy.o y.tab.o id.o tree.o yyerror.o
> -o ugen
> /home/xiamin/local/m68k-apple-netbsd1.3.2/bin/ld: cannot open crt0.o: No
> such file or directory
> make[2]: *** [ugen] Error 1
> make[2]: Leaving directory `/h1/xiamin/hbc/src/syntax/ugendir'
> make[1]: *** [ugen] Error 2
> make[1]: Leaving directory `/h1/xiamin/hbc/src/syntax'
> make: *** [myinstall] Error 2
>
> I had hoped that putting /usr/lib where I did would solve the ld problem,
> but I guess it didn't work. Can anyone give me a few pointers regarding
> cross-compiling?
crt0.o is in your copied /lib, isn't it?
Oh, you aren't using the binutils ld to link, are you? It doesn't work
for NetBSD shared libraries. You have to patch the NetBSD ld, and have
it cross-link.
My cross-linking ld doesn't look in the right places for libraries. I've
had to add "-nostdlib -L/my/destdir" to make things work right. Try that.
You might also just try compiling "ls" or something else small and see
if the cross-compiling works.
Take care,
Bill