I am haveing some real problems with setting up gcc as a cross
compiler. The host platform is an i686-pc-linux-gnu. The target will
be sh-linux-gnu (linux running on an embedded board based on the
hitachi sh4 processor). My host platform is also running kernel 2.4
which supports sh4. Here is what I have done.
Installed 010116 snapshot of binutils. No problem here, I configured
with the options: --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu
--target=sh-linux-gnu. This left me with cross binutilities in
Then, I placed "appropriate" headers in the directory
/usr/local/sh-linux-gnu/include. These headers included:
asm -- a symbolic link to /usr/src/linux/include/asm-sh
linux - a symbolic link to /usr/src/linux/include/linux
(Note, the above links point to kernel 2.4 source files.)
The remaining headers and directories I got out of glibc-2.2.1 and
copied to /usr/local/sh-linux-gnu/include:
/usr/include/endian.h, alloca.h, time.h, features.h, unistd.h, and
I decided on the above files and directories by attempting to build
gcc and noteing where it failed. I then added the header files it
needed until I got no more errors concerning missing files.
I configure gcc with options: --build=i686-pc-linux-gnu
--host=i686-pc-linux-gnu --target=sh-linux-gnu --enable-shared
I then build with the command: make gcc-all LANGUAGES=c
The problem is, I get errors from the assembler about bad assembly
code while xgcc is trying to compile libgcc2.c. I compiled a little
test program with the xgcc program that the build process made. It
doesn't seem to make any valid assembly. That is, neither my native
x86 assembler, nor the sh cross-assembler sitting in
/usr/local/sh-linux-gnu/bin seem to be able to do anything with the
code generated by xgcc. Does anyone have any thoughts on this?
As I understand it, while installing gcc, xgcc is made first. This is
then used to compile the rest of the gcc source. So, shouldn't xgxx be
generating x86 assembly code?
Kai has been helping me through this whole process, yet he doesn't
seem to be having any of these troubles.
Thanks for any help,