Hi Erik and everyone else,
I read the article
http://www.armlinux.org/docs/toolchain and tried to
compile gcc according to it, but I got big problem!!
I tried even more that Marr, I tried gcc-2.8.1.tar.gz
gcc-2.95.2.tar.gz gcc-core-2.95.3.tar.gz
gcc-2.95.3.tar.gz nothing works!! I couldn't compile
any of them.
According to the article, I downloaded the latest
version linux-2.4.5.tar.gz, and edit Makefile changed
ARCH := $(shell uname -m ...) to ARCH=arm, (I also
find another paper says change it to ARCH := arm,
which is correct????????), I don't know what I should
put after CrossCompile = . and the make menuconfig
didn't display the configure menu correctly! it only
displays
three menu item,
------
Load an Alternate configuration File
Save Configuration to an Alternate File
So, there is not 'System and processor type' menu item
at all! Then, I tried linux-2.4.4.tar.gz, it is the
same as linux-2.4.5.tar.gz, and Finally I found
linux-2.4.2.tar.gz works, it could has that menu item,
and I fired make dep
After that I tried to compile that 3 version of gcc,
none could be compiled. (by the way, I tried to access
ftp://ftp.armlinux.org/pub/toolchain to get patch for
gcc, but ftp can be accessed), I also applied the
-Dinhibit_libc hack. but I alway got libgccl.S(maybe
libgccl.c) error, can't find unistd.h
I am using RedHat 7.0 the kernel should be 2.2.16-22
Please read attachment to find what I did exactly.
Please help me, I have do that for one week!
Thanks in advance.
Gavin
--- Erik Mouw <[EMAIL PROTECTED]> wrote:
> On Sat, Jun 02, 2001 at 06:55:12PM +1000, Daniel
> Marr wrote:
> > Hi everyone and particularly anyone who knows the
> pain of building the gcc
> > cross compiler for the ARM Thumb.
>
> I got no problems with it. Check out
>
> http://www.armlinux.org/docs/toolchain/
>
> > I have tried everything (obviously not otherwise
> it would work!) but can't
> > seem to get it to work.
> >
> > I have downloaded : gcc-2.8.1, gcc-2.95.3,
> snapshot 210501,
>
> Gcc-2.8.1 is ancient and shouldn't be used at all.
>
> > binutils -2.11, 2.9.1
>
> Binutils 2.11 works quite well.
>
> > glibc, newlib-1.8.l
>
> Which glibc version? I compiled a toolchain with
> glibc-2.2.2.
>
> > I have Mandrake 8 with the new linux kernel.
> >
> > I have tried :
> >
> > binutilsx/configure -target=arm-thumb-elf,
> arm-elf, thumb-elf
>
> You only tell configure which ABI it should compile
> for, you don't
> select a target OS.
>
> > gcc/configure -target = as above with newlib and
> glibc
> >
> > I can type in arm-thumb-elf-gcc at the command
> prompt and it is a valid
> > command, but when I try to compile a file it can't
> find crt0 or something.
> > Any suggestions? For instance are there any other
> parameters in the
> > arm-elf-gcc -b? etc.
>
> You should either select arm-thumb for a flat thumb
> target (creates
> binaries for use without OS), or select arm-linux
> for a compiler that
> supports linux and has support for both ARM and
> thumb instructions.
>
> BTW, the upcoming gcc-3.0 has much better support
> for arm/thumb
> interwork, so you should try that one. I do have a
> precompiled gcc-3.0
> target online, see:
>
> http://www.lart.tudelft.nl/lartware/compile-tools/
>
> It's the 2010409 snapshot.
>
> > Also, should you be able to rescue me on this you
> may be able to help me
> > actually communicating with the arm. I thought I
> read somewhere you can
> > communicate with angel from hyperterminal. Mine
> comes up with Angel but
> > then garble.
> >
> > You should be able to do it with gdb, right?
> >
> > gdb -target=arm-thumb-elf
>
> I tried this for about 15 minutes on an ARM
> evaluation board and
> decided that the Angel version on the board was too
> broken to be
> useful.
>
>
> Erik
>
> --
> J.A.K. (Erik) Mouw, Information and Communication
> Theory Group, Department
> of Electrical Engineering, Faculty of Information
> Technology and Systems,
> Delft University of Technology, PO BOX 5031, 2600
> GA Delft, The Netherlands
> Phone: +31-15-2783635 Fax: +31-15-2781843 Email:
> [EMAIL PROTECTED]
> WWW: http://www-ict.its.tudelft.nl/~erik/
>
> _______________________________________________
>
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
> Please visit the above address for information on
> this list.
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
MyHome=/home/gavin
cd $MyHome
mkdir arm
cd arm
mkdir tools targz builds
cd tools
mkdir arm-linux
cd ..
cd builds
mkdir build-binutils build-gcc build-newlib build-gdb
cd ../targz
mkdir src
TARGET=arm-coff
which arm= armv2, armv3l, armv3b, armv4l, armv4b, armv5l, armv5b
PREFIX=$MyHome/arm/tools
PREFIXTARGET=$PREFIX/$TARGET
KERNELSOURCELOCATION=$MyHome/arm/linux
ftp ftp.gnu.org:/pub/gnu
Get binutils-2.11.tar.gz gcc-2.95.3.tar.gz gdb-5.0.tar.gz
ftp sourceware.cygnus.com:pub/newlib
Get newlib-1.9.0.tar.gz
ftp ftp.kernel.org:/pub/linux/kernel/v2.4
Get linux-2.4.2.tar.gz
------ end of prepair ---------
--- unpack the archieves
cd src
tar -zxvf ../binutils-2.11.tar.gz
tar -zxvf ../gcc-2.95.3.tar.gz
tar -zxvf ../gdb-5.0.tar.gz
tar -zxvf ../newlib-1.9.0.tar.gz
cd $MyHome/arm
tar -zxvf targz/linux-2.4.2.tar.gz
------- build binutils -----
cd builds/build-binutils
$MyHome/arm/targz/src/binutils-2.11/configure --target=$TARGET --prefix=$PREFIX -v
make all install
------- build gcc -----
--- prepair kernel ---
cd $MyHome/arm/linux
vi Makefile
change
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e
s/sa110/arm/)
to
ARCH=arm
make menuconfig
System Type ---> (SA1100-based) ARM system type
SA11x0 Implementations ---> [*] LART (NEW)
make dep
--- prepair -Dinhibit-libc hack ---
vi $MyHome/arm/targz/src/gcc-2.95.3/gcc/config/arm/t-linux
add -Dinhibit-libc -D__gthr_posix_h to TARGET_LIBGCC2_CFLAGS
then it looks like:
TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC -Dinhibit_libc -D__gthr_posix_h
--- start build gcc ---
cd $MyHome/builds/build-gcc
$MyHome/arm/targz/src/gcc-2.95.3/configure --target=$TARGET --prefix=$PREFIX
--with-headers=KERNELSOURCELOCATION/include --enable-languages=c --disable-threads -v
export PATH=$PATH:$PREFIX/bin
make LANGUAGES=c all-gcc > make.log 2>&1