delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/30/14:35:42

Sender: rich AT delorie DOT com
Message-ID: <38947D64.F4D08438@tudor21.net>
Date: Sun, 30 Jan 2000 18:05:24 +0000
From: Richard Dawe <richdawe AT bigfoot DOT com>
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.14 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: DJGPP newsgroup <djgpp AT delorie DOT com>
Subject: DJGPP 2.03 + egcs 1.1.2 cross-compiling on Linux - some notes
Reply-To: djgpp AT delorie DOT com

Hello.

I recently tried to install a cross-compiler under Linux to make DJGPP
programs. Here are my notes - I hope they are useful to someone:

I followed the instructions from the DJGPP website. I encountered some
problems:

. binutils-2.9.1.0.4-3.src.rpm (from RedHat 5.1 Extras CD)

I tried to apply DJ's patch in binutils-2.9.1/gas/config, but the second
file 'tc-i386.h' had its patch rejected. I patched it by hand instead. The
compile and install went smoothly.

. egcs-1.1.2-24.src.rpm (from Cheapbytes RedHat 6.1 Sources CD)

To build egcs's gcc/objc/ directory, I needed 'CFLAGS+=-D_WCHAR_T' to be
passed to make, to solve a clash between Linux and DJGPP's headers:

Linux: typedef int wchar_t;
DJGPP: typedef unsigned short wchar_t;

I only used this when compiling the gcc/objc/ sources - i.e. I ran make as
normal and changed into this directory when the compile failed. I seemed
to have to use this method twice - is this because the compiler rebuilds
itself?

After commenting out the libgcc1-test section, as directed, the rest of
the compile went OK up until libf2c, where it seemed to be trying to
execute a non-existent command '-c' or 'c' (at various points). To solve
this, I ran the configure script manually in i586-pc-msdosdjgpp/libf2c:

./configure --host=i586-pc-msdosdjgpp --build=i586-pc-linux-gnu         \
        --enable-multilib --with-cross-host=i586-pc-linux-gnu           \
        --with-gcc-version-trigger=/usr/tmp2/egcs-1.1.2/gcc/version.c   \
        --prefix=/usr/local --with-target-subdir=i586-pc-msdosdjgpp     \
        --cache-file=.././config.cache --srcdir=.

This is the version information for my cross-gcc:

[root AT iolanthe] dos-gcc -v
Reading specs from
/usr/local/lib/gcc-lib/i586-pc-msdosdjgpp/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)

Since specs is no longer included in djdev & djlsr, I copied the specs
file from my installation of gcc 2.95.2.

I then tried to compile a simple program using:

make CC=dos-gcc

gcc moaned that it could not find 'stubify'. I copied it into the gcc-lib
directory and then all seemed well.

cd /usr/local/i586-pc-msdosdjgpp
cp stubify /usr/local/lib/gcc-lib/i586-pc-msdosdjgpp/egcs-2.91.66/

When I tried to compile libsocket, I found that egcs headers appeared to
be included before DJGPP's, which is bad, from
/usr/local/lib/gcc-lib/i586-pc-msdosdjgpp/egcs-2.91.66/include. I
wonder why this happened? Renaming this directory seems to help - the
compile then suceeded.

The cross-compiler appears to generate valid, working executables, i.e.
they work from Windows '95 running in VMware under Linux.

I hope this info is useful, bye,

-- 
Richard Dawe
richdawe AT bigfoot DOT com ICQ 47595498 http://www.bigfoot.com/~richdawe/

- Raw text -


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