www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/06/02/15:38:46

Date: Tue, 2 Jun 92 14:44:32 EDT
From: engdahl AT brutus DOT aa DOT ab DOT com (Jon Engdahl)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: developing a cross-compiler
Status: O

OK - I give up: how do you get a cross compiler using the gcc-gas-ld stuff?

The catch is I want it to run it under djgcc on a 386 or 486.

I have gcc-2.1 on the PC, compiled under djgcc, to the point where I
can translate C code to m68k assembly.

I have gas-1.38 on the PC so that it compiles m68k .s to .o,
HOWEVER, the bytes are swapped wrong, so that the ld that comes with
djgcc gets confused. For starters, the longs in the .o header, such as
the magic number, are wrong way round.

I tried compiling the new gld from binutils-beta-1.94 on both a sun4
(it seg faults) and on the PC (flex can't deal with ldlex.l) with no
luck.

I looked at an older version of ld that I had lying around (don't know
exactly which version, but it's close to the one that is used in djgcc),
but there didn't seem to be a straightforward switch that I could throw
to fix the problem. I also took a closer look at gas for the same kind
of switch, and didn't see anything obvious.

OBJECTIVE -  what I want is to compile C and C++ code on the PC, then
download it to a 680x0 evaluation board.

PROBLEM - I don't understand whether I need to fix the assembler or the
linker? Or both? Or is it hopeless? In a cross compiled environment,
should the header of the .o file look like it does on a sun, or like a
386? Which verion of ld or gld should I be using?

Things are not made much easier by the fact that I am using Borland 2.0
make. I tried building the GNU make under djgcc, but gave up after a
while - GNU make is too fancy to run under GO32. Is there a free make
out there that will run the GNU makefiles?

Jonathan Engdahl, Sr. Project Engineer  | engdahl AT aa DOT ab DOT com   313-998-2450
Allen-Bradley Co.                       | A Rockwell International Company
555 Briarwood Circle,                   | Industrial Communication Network
Ann Arbor, MI, 48108, USA               | system design, software, ASICs

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019