*BSD News Article 12562


Return to BSD News archive

Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!olivea!mintaka.lcs.mit.edu!ai-lab!hal.gnu.ai.mit.edu!mycroft
From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)
Newsgroups: comp.os.386bsd.questions
Subject: Re: cross-compiling (linking actually) using gnu tools
Message-ID: <1nhl3rINN4qc@life.ai.mit.edu>
Date: 9 Mar 93 08:39:23 GMT
References: <1993Mar8.030202.26276@craycos.com>
Organization: /etc/organization
Lines: 64
NNTP-Posting-Host: hal.ai.mit.edu


In article <1993Mar8.030202.26276@craycos.com> scott@craycos.com (Scott
Bolte) writes:
>
>		binutils-2.1
>
>	And the only missing component is ld. It will link a binary
>	without error messages. But when an attempt is made to run it
>	on ref.tfs.com it complains: "./a.out: Cannot allocate memory."

You need to use the `i386bsd' emulation, not `i386aout'.  I sent in a
`bug' report about this:


From: mycroft@gnu.ai.mit.edu
Subject: Building on 386BSD
To: bug-binutils@prep.ai.mit.edu
Date: Tue, 2 Mar 1993 14:41:36 -0500 (EST)


Someone wrote an `i386bsd.sh', but for some reason the i386bsd emulation
is not built by default.

Also, if I don't modify ld/Makefile to set `EMUL' (and, by consequence,
DEFAULT_EMULATION), I get compilation errors.

-----8<-----snip-----8<-----snip-----8<-----snip-----8<-----snip-----8<-----
*** Makefile.in.~1~	Wed Feb  3 12:09:42 1993
--- Makefile.in	Tue Mar  2 14:36:08 1993
***************
*** 120,126 ****
  	em_h8300hms.o em_ebmon29k.o em_sun4.o em_gld960.o \
  	em_m68kcoff.o em_h8300xray.o em_st2000.o em_sa29200.o \
  	em_vanilla.o em_i386coff.o em_z8ksim.o em_mipslit.o \
! 	em_mipsbig.o
  
  EMULATION_OFILES=${ALL_EMULATIONS}
  #EMULATION_OFILES=em_${EMUL}.o ${OTHER_EMULATIONS}
--- 120,126 ----
  	em_h8300hms.o em_ebmon29k.o em_sun4.o em_gld960.o \
  	em_m68kcoff.o em_h8300xray.o em_st2000.o em_sa29200.o \
  	em_vanilla.o em_i386coff.o em_z8ksim.o em_mipslit.o \
! 	em_mipsbig.o em_i386bsd.o
  
  EMULATION_OFILES=${ALL_EMULATIONS}
  #EMULATION_OFILES=em_${EMUL}.o ${OTHER_EMULATIONS}
***************
*** 262,267 ****
--- 262,270 ----
  em_mipsbig.c:  $(srcdir)/mipsbig.sh \
    $(srcdir)/generic.em $(srcdir)/mips.sc-sh ${GEN_DEPENDS}
  	${GENSCRIPTS} mipsbig.sh
+ em_i386bsd.c: $(srcdir)/i386bsd.sh \
+   $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
+ 	${GENSCRIPTS} i386bsd.sh
  
  $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
  	$(CC) $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES)
-----8<-----snip-----8<-----snip-----8<-----snip-----8<-----snip-----8<-----

-- 
 \  /   Charles Hannum, mycroft@ai.mit.edu
 /\ \   PGP public key available on request.  MIME, AMS, NextMail accepted.
Scheme  White heterosexual atheist male (WHAM) pride!