*BSD News Article 97273


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mira.net.au!inquo!nntp.uio.no!news.maxwell.syr.edu!news-feed.inet.tele.dk!news.algonet.se!uab.ericsson.se!erinews.ericsson.se!news
From: Kent Boortz <kent@erlang.ericsson.se>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: gcc cross compiler, Solaris -> FreeBSD
Date: 06 Jun 1997 19:12:57 +0200
Organization: Ericsson Software Technology AB, Erlang Systems
Lines: 41
Message-ID: <d2910nslie.fsf@erlang.ericsson.se>
NNTP-Posting-Host: townsend.ericsson.se
X-Newsreader: Gnus v5.3/Emacs 19.34
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:42524


I want to be able to cross compile an application on a Sparc machine
running Solaris 2.5.1 to FreeBSD object code (I have my reasons
;-). The final linking of the resulting executable will be done on a
FreeBSD machine.

Som entries in "binutils/ld/configure.tgt" that may be relevant

i[3456]86-*-bsd)        targ_emul=i386bsd ;;
i[3456]86-*-bsd386)     targ_emul=i386bsd ;;
i[3456]86-*-bsdi*)      targ_emul=i386bsd ;;
i[3456]86-*-aout)       targ_emul=i386aout ;;
i[3456]86-*-netbsd*)    targ_emul=i386nbsd ;;
i[3456]86-*-elf*)       targ_emul=elf_i386 ;;
i[3456]86-*-freebsdelf*) targ_emul=elf_i386 ;;

The only FreeBSD entry I found was "i386-freebsdelf".  Is this the
target to use? I know FreeBSD can run most software that is compiled
for BSDi but why not all?  Is the problem shared libraries?

The "*.o" files produced has to be linkable with the standard FreeBSD
2.2.1 linker.

I read that ELF is supported by FreeBSD but does it require kernel or
some other configuration?  Will the libraries, like "libc.a" link with
object files in ELF?

If someone has a Web page on the topic of cross compiling to FreeBSD
please let me know the URL.  I have searched and searches and ......

Hmmm...I just managed to create a cross compiler for freebsdelf, after
hours of trial and error, but running it on a simple program

  % /myinst/bin/i386-freebsdelf-gcc -o foo.o foo.c
  /myinst/i386-freebsdelf/lib/crt0.o: file not recognized: \
  File format not recognized

The "crt0.o" was copied from FreeBSD 2.2.1 so I know for sure I got
something wrong ;-)

/kgb