After installation of the CygWin environment for
Windows you are ready to compile the needed cross-compiler
for the Hitachi SH4 processor.
First we have to prepare a directory structure for our
compiles. Go to the root of your Cygnus-Environment
and make a directory called GCC (I will use the
same locations and descriptions as Hitmen do in their guide
for easier adaption).
Inside this directory make the three directories build-binutils,
build-gcc and build-newlib. For easier understanding
here's a little tree:
GCC
build-binutils
build-gcc
build-newlib
Copy your downloaded source tar-balls (those files that
end with .tar.gz or .tar.bz2) into the
GCC directory.
Now let's unzip and untar these files.
- Use the following commandline to unpack the files:
.tar.gz: gunzip filename.tar.gz
.tar.bz2: bunzip2 filename.tar.bz2
- Use the following commandline to untar the files:
tar xf filename.tar
Now your directory structure should look someting like:
GCC
build-binutils
build-gcc
build-newlib
binutils-2.11.2
gcc-3.0.3
newlib-1.9.0
Now everything is set to compile the whole xGCC toolchain
for SH4.
IMPORTANT:
In case any compile process throws errors concerning a variable
called sys_errlist (it being declared twice)
you have to change the file /usr/include/sys/errno.h.
Search for the variable in question and change the following
lines to:
/* Please don't use these variables
directly.
Use strerror instead. */
// extern __IMPORT _CONST char * _CONST _sys_errlist[];
extern __IMPORT int _sys_nerr;
#ifdef __CYGWIN__
// extern __IMPORT const char * const sys_errlist[];
(you have to comment out the declaration of sys_errlist
here. the bold lines have to be changed )
|