This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

i960 cross-compiler


Hello

When with help of the mailing list and the FAQs I built cross-compiler
for i960-coff on Cygwin, I recoreded the instructions (see below). The
instructions helped several people to build the compiler on a Linux (do
not remember which). They suggested to put the instructions here. So,
here are the instructions.

Artem

1. Download the compiler and tools

Download the following e.g. from ftp://ftp.gnu.org:
* Binutils:   binutils-2_9_1.tgz
* Gcc:  gcc-2_95.tgz
* Newlib:  newlib-1_8_1.tgz
Suppose furter that we downloaded the files into directory /gnu.

2. Extract the sources

cd /gnu
tar xvzf binutils-2_9_1.tgz
tar xvzf gcc-2_95.tgz
tar xvzf newlib-1_8_1.tgz

As a result three directories will appear
* binutils-2.9.1
* gcc-2.95
* newlib-1.8.1

3. Build and install BINUTILS

cd /gnu
mkdir build-binutils
cd build-binutils
src=/gnu/binutils-2.9.1
rel=/gnu/i960
target=i960-unknown-coff
$src/configure --target=$target --prefix=$rel
make all install

As the result the binutils must be successfully built and installed into
/gnu/i960

4. Build and install GCC (and NEWLIB)

cd /gnu/gcc-2.95
ln –s ../newlib-1.8.1/newlib .
cd ..
mkdir build-gcc
cd build-gcc
src=/gnu/gcc-2.95
rel=/gnu/i960
target=i960-unknown-coff
export PATH=$rel/bin:$PATH
$src/configure --target=$target --prefix=$rel --enable-languages=c,c++
--with-newlib --with-gnu-ld --with-gnu-as
make all install

As the result the compiler must be installed in /gnu/i960

Note:
The version of the compiler has a (submitted) bug in builtin
setjmp/longjmp. That is why C++ exception handling does not work. It can
be fixed running
make all install CFLAGS=”-g –O2 –DDONT_USE_BUILTIN_SETJMP”
instead of "make install" above. Note that this is a workaround while
the bug is not fixed.

5. Using the compiler

Here is an example of a makefile to built a hello world program for
i960:

TARGET=i960-unknown-coff
I960=/gnu/i960/$(TARGET)
INC960=$(I960)/include
LIB960=$(I960)/lib
LIBGCC960=/gnu/i960/lib/gcc-lib/$(TARGET)/2.95/libgcc.a
BIN960=$(I960)/bin
CC960=$(BIN960)/gcc -O3 -mca -I$(INC960)
LD960=$(BIN960)/ld -r -d -Fcoff -L$(LIB960)
AR960=$(BIN960)/ar
STRIP960=$(BIN960)/strip -x
CC=gcc
LD=ld

all: hello.9gx

hello.9gx: hello.9go
    $(LD960) -o hello.9gx hello.9go $(LIBGCC960)
    $(STRIP960) hello.9gx

hello.9go: hello.cpp
    $(CC960) -o hello.9go -c hello.cpp

clean:
    rm –f hello.9gx hello.9go core


The make insures that the target tools are used.

begin:vcard 
n:Alimarine;Artem
tel;home:(+31) 40-2440633
tel;work:(+31) 40-2763078
x-mozilla-html:TRUE
adr:;;;;;;
version:2.1
email;internet:aalimari@best.ms.philips.com
fn:Artem Alimarine
end:vcard

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]