Mail Archives: djgpp/1992/08/04/23:41:15

Date: Thu, 30 Jul 92 01:29:19 -0500
From: rcharif AT math DOT utexas DOT edu
Posted-Date: Thu, 30 Jul 92 01:29:19 -0500
To: dj AT ctron DOT com
Cc: alvin AT eyepoint DOT on DOT ca, hideki AT isl DOT rdc DOT toshiba DOT co DOT jp,
djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: A way to use cross compilation for DJ1.0x
Reply-To: rcharif AT math DOT utexas DOT edu

After some tests I found a way to perform a 2 step cross compilation
that will not require changing the code of neither go32 nor gnu ld.
I made the test using version 1.97.1 of binutils on a SPARC station.

There is a bug in the cross linker when generating go32 a.out files.
It will generate the right header but it fails when it comes to align
the data segment on a 0x400000 boundary. A solution is to perform the
cross linking with the switch -r or -Ur for c++ programs. This will
produce a relocatable file with a magic number 0x107. This file is not
accepted by go32 so you need to run ld.exe on it on a Dos machine. No
libraries are needed as everything is already in the file. Only the
data segment needs to be fixed and ld.exe will take care of it.

This might seems cumbersome but it has the advantage of being
commpatible with go32 and binutils 1.97.1

If anyone is interested in the following cross compiled on the SPARC
send me mail and I will try to find some place to put them on our ftp

	binutils 1.97.1
	gas 1.92.3 
	gcc 2.2.2 version 920724

Cross compilation is handy when recompiling unix programs that use
file name that need to be changed in order to run under Dos. Cross
compilation avoids us to maintain many versions of the source code.
cross-gcc is much faster on the Sparcs.

Rami El Charif

- Raw text -

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