Discussion:
Howto make the GCC big-endian toolchain for IXP2400/Linux (AR M XS cale core)
David Mentre
2003-05-14 15:02:57 UTC
Permalink
You'll find below the build procedure we have used to make a
gcc big endian
cross toolchain for Intel IXP2400 which contains an ARM
XScale core. I think
this procedure is valid for any ARM target.
I have put the howto on the web at following URL:
http://www.linux-france.org/~dmentre/doc/en/

Please note that is seems that this toolchain is still not able to produce
dynamically linked binaries. YMMV.

Best regards,
david
--
David Mentré <***@tcl.ite.mee.com> - Research engineer
Mitsubishi Electric ITE-TCL / European Telecommunication Research Laboratory

Phone: +33 2 23 45 58 29 / Fax: +33 2 23 45 58 59
http://www.mitsubishi-electric-itce.fr

-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
e***@lexmark.com
2003-05-15 03:09:10 UTC
Permalink
What seems to be the problem with your loader?
I had tried your configuration a dozen times and I was able to create
binaries with dynamically shared libraries. Although I mixed the configure
options with the once used in the arm-linux toolchain site.

Eman





Chetan Kumar S <***@wipro.com> on 05/15/2003 10:48:46 AM

Please respond to Chetan Kumar S <***@wipro.com>

To: ***@lexmark.com
cc: David Mentre <***@tcl.ite.mee.com>, "'***@cs.princeton.edu'"
<***@cs.princeton.edu>, <linux-***@lists.arm.linux.org.uk>
Subject: RE: Howto make the GCC big-endian toolchain for IXP2400/Linux
(AR M XS cale core)
Hi,
The problem seems to be with the dynamic loader ld-linux.so. With
the newly built tool-chain, the ld-linux do not run, crashes with some
errors.

Thanks
chetan S
CC="$target-gcc -mbig-endian" AR=$target-ar RANLIB=$target-ranlib
../glibc-2.2.5/configure --host=$target --prefix=$prefix/$target
--enable-add-ons=linuxthreads --enable-shared
--with-headers=$prefix/$target/include
gcc-3.X in big-endian has many complaints if c++ support is added. If it
is
not really that crucial to have gcc-3.x it is better to use gcc-2.95.3
since it has support for c and c++. Everything in your howto works for
gcc-2.95.3 except for the patch in gcc, it may not be necessary.
Hope this helps.
Eman
05/14/2003
11:02:57 PM
Subject: RE: Howto make the GCC big-endian toolchain for IXP2400/Linux
(AR M XS cale core)
You'll find below the build procedure we have used to make a
gcc big endian
cross toolchain for Intel IXP2400 which contains an ARM
XScale core. I think
this procedure is valid for any ARM target.
http://www.linux-france.org/~dmentre/doc/en/
Please note that is seems that this toolchain is still not able to
produce
dynamically linked binaries. YMMV.
Best regards,
david
--
Mitsubishi Electric ITE-TCL / European Telecommunication Research
Laboratory
Phone: +33 2 23 45 58 29 / Fax: +33 2 23 45 58 59
http://www.mitsubishi-electric-itce.fr
-------------------------------------------------------------------
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
http://www.arm.linux.org.uk/armlinux/mailinglists.php
Jæìr¸©¶*'¢›b¢{>†ÛiûÿåŠËlj¹¥Š{±¢¸.“ùšŠYšŸùb²Ø§~åŠ{±j¹…Ķ*®zÛ^úm§ïÿà 
®ibžìh® ¤ýªæ–)îÇùšŠX§‚X¬¶Êa
--
Phases of a Project:
(1) Exultation.
(2) Disenchantment.
(3) Confusion.
(4) Search for the Guilty.
(5) Punishment for the Innocent.
(6) Distinction for the Uninvolved.


**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited is
'privileged' and 'confidential' and intended for use only by the individual
or entity to which it is addressed. You are notified that any use, copying
or dissemination of the information contained in the E-MAIL in any manner
whatsoever is strictly prohibited.

***************************************************************************





���*m����ب��m����+-����)�Ɗ��O�j)fj���b��?�)�Ū�
Jeremy McNicoll
2003-05-30 06:40:21 UTC
Permalink
You'll find below the build procedure we have used to make a
gcc big endian
cross toolchain for Intel IXP2400 which contains an ARM
XScale core. I think
this procedure is valid for any ARM target.
http://www.linux-france.org/~dmentre/doc/en/


I have managed to add to the good work that David has done and
implemented C++ support, which was missing.

Here is the a script that I now use to build my toolchains for IXP425
developement boards.


I would appreciate any comments. Its a work in progress.

---------------------------------------------------------
## NOTE: THIS Program is in ALPHA!!! As Such I could use some
suggestions.

####################################################
##
## Purpose: To AutoMagically install, apply patches and create a
toolchain.
##
## Author: Jeremy McNicoll, ***@mcnicoll.ca
##
## Credits: Arm mailing lists
## Cross compiler Mailing Lists
## Version 1.5 / 2003-05-15, toolchainHowto
(http://www.linux-france.org/~dmentre/doc/en/)
## David MENTRE <***@tcl.ite.mee.com>
## Mathieu BERTRAND <***@tcl.ite.mee.com>
## Robert Schiele's <***@uni-mannheim.de> GCC cross compiler
tutorial from the
## GCC Summit tutorial
(http://www.gccsummit.org/2003/view_abstract.php?talk=35)
##
##
## Problem:
## There has been alot of buzz recently on creating an arm cross
compile toolchain
## on the mailing lists. I too needed to have a toolchain for a
project that I am
## working on at school(http://www.carleton.ca). There are already
toolchains that
## can be downloaded on the net, but I had no luck in getting the C++
to work.
## So since this is a school project I decided to create my own script
for installing
## and creating a toolchain.
##
## Solution:
## Using some of the stuff that was available on the internet,
mainly the howto that
## David Mentre posted as a starting point. Then I added C++
support to the toolchain.
## This proved to be difficult but doable. YEE HA!!!!
##
## Assumptions:
## 1) You have downloaded , patched and configured the kernel
## for your target.
## 2) The following files are located in the same location as this
scripts:
## binutils-2.13.1.tar.gz
## gcc-3.2.3.tar.gz
## glibc-2.2.5.tar.gz
## glibc-linuxthreads-2.2.5.tar.gz
##
## Bugs Patched for:
## http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=8896
##
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/linuxthreads/sysdeps/p
thread/pthread.h?cvsroot=glibc
##
##
## Testing:
## All Testing was done on a clean Mandrake 9.1 system.
##
## ToDO:
## -Get XScale (armv5b) working.
## -Command line parameters
## -Make it somewhat interactive with the user
## -test with GCC 3.3
##
## Extras:
## [***@project bin]$ ./arm-linux-g++ -v
## Reading specs from ./../lib/gcc-lib/arm-linux/3.2.3/specs
## Configured with: ./configure --target=arm-linux
--prefix=/usr/local/arm-tools i686-pc-linux-gnu
--with-headers=/usr/local/arm-tools/include --enable-languages=c,c++
## Thread model: posix
## gcc version 3.2.3
##
## Tips:
## for VI users to do a global search and replace use
## :%s/gcc-3.2.3/gcc-3.3/g
##
####################################################

#!/bin/sh -e

PREFIX=/usr/local/arm-tools
KERNEL=/ixp425/Kernel_Source/linux-2.4.19
HOST=i686-pc-linux-gnu
TARGET=arm-linux
echo "Setting the CC variable"
CC=/usr/bin/gcc
echo "CC is now set to $CC"
echo " "


##################################################
# Check to see if we have the required files first
##################################################

if [ "$KERNEL" = "" -o ! -f "$KERNEL/Documentation/arm/README" ]; then
echo "You haven't changed KERNEL to point at a valid kernel tree"
exit 1
fi
if [ ! -f binutils-2.13.1.tar.gz ]; then
echo Binutils 2.13.1 seems to be missing
exit 1
fi
if [ ! -f gcc-3.2.3.tar.gz ]; then
echo GCC 3.2.3 seems to be missing
exit 1
fi

if [ ! -f glibc-2.2.5.tar.gz ]; then
echo glibc-2.2.5.tar.gz seems to be missing
exit 1
fi
if [ ! -f glibc-linuxthreads-2.2.5.tar.gz ]; then
echo glibc-linuxthreads-2.2.5.tar.gz seems to be missing
exit 1
fi

##########################
### Copy everything over!
#########################

rm -rf $PREFIX
mkdir -p $PREFIX
mkdir -p $PREFIX/$TARGET/
mkdir -p $PREFIX/$TARGET/include
mkdir -p $PREFIX/$TARGET/include/linux/asm
mkdir -p $PREFIX/$TARGET/include/asm

cp -fr $KERNEL/include/linux $PREFIX/$TARGET/include
cp -fr $KERNEL/include/asm-arm/* $PREFIX/$TARGET/include/linux/asm/.
cp -fr $KERNEL/include/asm-arm/* $PREFIX/$TARGET/include/asm/.


######################
# Do Binutils
######################

rm -rf binutils-2.13.1
tar zvxf binutils-2.13.1.tar.gz
pushd binutils-2.13.1
./configure --target=arm-linux --prefix=$PREFIX
make LDFLAGS="-mbig-endian"
make install
popd
rm -rf binutils-2.13.1

###################
##Finished BinUtils
###################


##################
# Start GCC
#################

echo "Starting GCC First Pass!!!"
rm -rf gcc-3.2.3
echo "UnCompressing GCC"
tar zvxf gcc-3.2.3.tar.gz
echo "Finished Uncompressing GCC"
pushd gcc-3.2.3


perl -pi -e 's/^(TARGET_LIBGCC2_CFLAGS.*)/$1 -Dinhibit_libc
-D__gthr_posix_h/' gcc/config/arm/t-linux

echo "Changing GCC for BigEndian\n"
perl -pi -e 's/GCC_FOR_TARGET = \$\$r\/gcc\/xgcc /GCC_FOR_TARGET =
\$\$r\/gcc\/xgcc -mbig-endian /g' Makefile.in


##This is a known bug
#http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=8896
##But you dont have to do this for GCC 3.3
pushd gcc
patch -p0 < /ixp425/TOOLS/ToolChain/Patch.pr8896
perl -pi -e 's/GCC_FOR_TARGET = \.\/xgcc /GCC_FOR_TARGET = \.\/xgcc
-mbig-endian /g' Makefile.in


pushd config
pushd arm
##By default it compiles for little endian, so we have to change that to
big endian

perl -pi -e 's/^# MULTILIB_OPTIONS =
mlittle-endian\/mbig-endian/MULTILIB_OPTIONS +=
mlittle-endian\/mbig-endian/' t-arm-elf
perl -pi -e 's/^# MULTILIB_DIRNAMES = le be/MULTILIB_DIRNAMES +=
le be/' t-arm-elf
perl -pi -e 's/^# MULTILIB_MATCHES = mbig-endian=mbe
mlittle-endian=ml/MULTILIB_MATCHES += mbig-endian=mbe
mlittle-endian=ml/' t-arm-elf
popd
popd
popd

echo 'T_CFLAGS = -Dinhibit_libc -D__gthr_posix_h' >>
gcc/config/arm/t-linux

PATH=$PREFIX/bin:$PREFIX/$TARGET/include:$PATH

echo "Setting the CC variable"
CC=/usr/bin/gcc
echo "CC is now set to $CC"
echo " "

./configure --target=arm-linux --prefix=$PREFIX $HOST
--with-headers=$PREFIX/include --disable-shared --disable-threads
--enable-languages="c"

make LDFLAGS="-mbig-endian"
make install


popd
rm -rf gcc-3.2.3


#######################
# Start GLIBC
#######################
rm -rf glibc-2.2.5
tar zvxf glibc-2.2.5.tar.gz
tar -C glibc-2.2.5 -zvxf glibc-linuxthreads-2.2.5.tar.gz
pushd glibc-2.2.5
perl -pi -e
's/i386/arm*)\n\tlibc_cv_gcc_unwind_find_fde=yes\n\tarch_minimum_kernel=
2.0.10\n\t;;\n i386/' sysdeps/unix/sysv/linux/configure
perl -pi -e 's/weak_alias \(__old_sys_nerr/\/\/ $&/'
sysdeps/unix/sysv/linux/arm/errlist.c
perl -pi -e 's/weak_alias \(__old_sys_nerr/\/\/ $&/'
sysdeps/unix/sysv/linux/errlist.c

popd
rm -rf build-glibc/
mkdir build-glibc
pushd build-glibc

perl -pi -e 's/__thread/__thread_param/'
../glibc-2.2.5/linuxthreads/sysdeps/unix/sysv/linux/bits/sigthread.h
perl -pi -e 's/__thread/__thread_param/'
../glibc-2.2.5/linuxthreads/sysdeps/pthread/pthread.h


CC="$TARGET-gcc -mbig-endian" AR=$TARGET-ar RANLIB=$TARGET-ranlib
LD="$TARGET-ld -mbig-endian"

../glibc-2.2.5/configure $TARGET --target=$TARGET
--build=i686-pc-linux-gnu --with-headers=$PREFIX/$TARGET/include
--enable-add-ons=linuxthreads --enable-shared --prefix=$PREFIX/$TARGET

perl -pi -e 's/arm-linux-gcc/arm-linux-gcc -mbig-endian/' config.make


make LDFLAGS="-mbig-endian"
make install
popd

echo "Finished GLIBC , Now doing GCC for a Second Time"
echo " "
echo " "

rm -rf glibc-2.2.5

##################################
## Finish GLIBC
##################################

##################################
## Gcc a second time
##################################

tar zxvf gcc-3.2.3.tar.gz
pushd gcc-3.2.3


echo "Changing GCC for BigEndian\n"
perl -pi -e 's/GCC_FOR_TARGET = \$\$r\/gcc\/xgcc /GCC_FOR_TARGET =
\$\$r\/gcc\/xgcc -mbig-endian /g' Makefile.in

pushd gcc
patch -p0 < /ixp425/TOOLS/ToolChain/Patch.pr8896

perl -pi -e 's/GCC_FOR_TARGET = \.\/xgcc /GCC_FOR_TARGET = \.\/xgcc
-mbig-endian /g' Makefile.in

pushd config
pushd arm
perl -pi -e 's/^# MULTILIB_OPTIONS =
mlittle-endian\/mbig-endian/MULTILIB_OPTIONS +=
mlittle-endian\/mbig-endian/' t-arm-elf
perl -pi -e 's/^# MULTILIB_DIRNAMES = le be/MULTILIB_DIRNAMES +=
le be/' t-arm-elf
perl -pi -e 's/^# MULTILIB_MATCHES = mbig-endian=mbe
mlittle-endian=ml/MULTILIB_MATCHES += mbig-endian=mbe
mlittle-endian=ml/' t-arm-elf
popd
popd
popd

PATH=$PREFIX/bin:$PREFIX/$TARGET/include:$PATH

CC="$TARGET-gcc -mbig-endian" AR=$TARGET-ar RANLIB=$TARGET-ranlib
LD="$TARGET-ld -mbig-endian"


echo "Setting the CC variable"
CC=/usr/bin/gcc
echo "CC is now set to $CC"
echo " "



./configure --target=$TARGET --prefix=$PREFIX $HOST
--with-headers=$PREFIX/include --enable-languages="c,c++"

perl -pi -e 's/^CC_FOR_TARGET = \$\$r\/gcc\/xgcc/CC_FOR_TARGET =
\$\$r\/gcc\/xgcc -mbig-endian /' Makefile
perl -pi -e 's/\$\$r\/gcc\/ -nostdinc\+\+ /\$\$r\/gcc\/ -nostdinc++
-mbig-endian /' Makefile

pushd gcc

perl -pi -e 's/libstdc\+\+ /libstdc\+\+ -mbig-endian /' Makefile

popd



perl -pi -e 's/int namelen/unsigned int namelen/'
libjava/java/net/natInetAddress.cc

echo " "
echo " *********** "
echo " Now Running Make for Gcc The second time!!"


##I had to use the -i because after the C cross compiler is made
## there is another configure done which craps out when testing the
## C++ Xcompiler. But since we dont have one then it wotn work. Thsi
##step in the configure script should be ommited.

make -i LDFLAGS="-mbig-endian"
make install
popd
rm -rf gcc-3.2.3

echo " "
echo " "
echo " Good Bye All Done!"

echo "Thats It for now folks..."

exit 1


-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
Alex Zeffertt
2003-05-30 09:23:56 UTC
Permalink
Thanks for sending us the script. Please could you repost it as an
attachment so that the lines don't get wrapped.

Cheers,

Alex
Post by David Mentre
You'll find below the build procedure we have used to make a
gcc big endian
cross toolchain for Intel IXP2400 which contains an ARM
XScale core. I think
this procedure is valid for any ARM target.
http://www.linux-france.org/~dmentre/doc/en/
I have managed to add to the good work that David has done and
implemented C++ support, which was missing.
Here is the a script that I now use to build my toolchains for IXP425
developement boards.
I would appreciate any comments. Its a work in progress.
---------------------------------------------------------
## NOTE: THIS Program is in ALPHA!!! As Such I could use some
suggestions.
####################################################
##
## Purpose: To AutoMagically install, apply patches and create a
toolchain.
##
##
## Credits: Arm mailing lists
## Cross compiler Mailing Lists
## Version 1.5 / 2003-05-15, toolchainHowto
(http://www.linux-france.org/~dmentre/doc/en/)
tutorial from the
## GCC Summit tutorial
(http://www.gccsummit.org/2003/view_abstract.php?talk=35)
##
##
## There has been alot of buzz recently on creating an arm cross
compile toolchain
## on the mailing lists. I too needed to have a toolchain for a
project that I am
## working on at school(http://www.carleton.ca). There are already
toolchains that
## can be downloaded on the net, but I had no luck in getting the C++
to work.
## So since this is a school project I decided to create my own script
for installing
## and creating a toolchain.
##
## Using some of the stuff that was available on the internet,
mainly the howto that
## David Mentre posted as a starting point. Then I added C++
support to the toolchain.
## This proved to be difficult but doable. YEE HA!!!!
##
## 1) You have downloaded , patched and configured the kernel
## for your target.
## 2) The following files are located in the same location as this
## binutils-2.13.1.tar.gz
## gcc-3.2.3.tar.gz
## glibc-2.2.5.tar.gz
## glibc-linuxthreads-2.2.5.tar.gz
##
## http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=8896
##
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/linuxthreads/sysdeps/p
thread/pthread.h?cvsroot=glibc
##
##
## All Testing was done on a clean Mandrake 9.1 system.
##
## -Get XScale (armv5b) working.
## -Command line parameters
## -Make it somewhat interactive with the user
## -test with GCC 3.3
##
## Reading specs from ./../lib/gcc-lib/arm-linux/3.2.3/specs
## Configured with: ./configure --target=arm-linux
--prefix=/usr/local/arm-tools i686-pc-linux-gnu
--with-headers=/usr/local/arm-tools/include --enable-languages=c,c++
## Thread model: posix
## gcc version 3.2.3
##
## for VI users to do a global search and replace use
## :%s/gcc-3.2.3/gcc-3.3/g
##
####################################################
#!/bin/sh -e
PREFIX=/usr/local/arm-tools
KERNEL=/ixp425/Kernel_Source/linux-2.4.19
HOST=i686-pc-linux-gnu
TARGET=arm-linux
echo "Setting the CC variable"
CC=/usr/bin/gcc
echo "CC is now set to $CC"
echo " "
##################################################
# Check to see if we have the required files first
##################################################
if [ "$KERNEL" = "" -o ! -f "$KERNEL/Documentation/arm/README" ]; then
echo "You haven't changed KERNEL to point at a valid kernel tree"
exit 1
fi
if [ ! -f binutils-2.13.1.tar.gz ]; then
echo Binutils 2.13.1 seems to be missing
exit 1
fi
if [ ! -f gcc-3.2.3.tar.gz ]; then
echo GCC 3.2.3 seems to be missing
exit 1
fi
if [ ! -f glibc-2.2.5.tar.gz ]; then
echo glibc-2.2.5.tar.gz seems to be missing
exit 1
fi
if [ ! -f glibc-linuxthreads-2.2.5.tar.gz ]; then
echo glibc-linuxthreads-2.2.5.tar.gz seems to be missing
exit 1
fi
##########################
### Copy everything over!
#########################
rm -rf $PREFIX
mkdir -p $PREFIX
mkdir -p $PREFIX/$TARGET/
mkdir -p $PREFIX/$TARGET/include
mkdir -p $PREFIX/$TARGET/include/linux/asm
mkdir -p $PREFIX/$TARGET/include/asm
cp -fr $KERNEL/include/linux $PREFIX/$TARGET/include
cp -fr $KERNEL/include/asm-arm/* $PREFIX/$TARGET/include/linux/asm/.
cp -fr $KERNEL/include/asm-arm/* $PREFIX/$TARGET/include/asm/.
######################
# Do Binutils
######################
rm -rf binutils-2.13.1
tar zvxf binutils-2.13.1.tar.gz
pushd binutils-2.13.1
./configure --target=arm-linux --prefix=$PREFIX
make LDFLAGS="-mbig-endian"
make install
popd
rm -rf binutils-2.13.1
###################
##Finished BinUtils
###################
##################
# Start GCC
#################
echo "Starting GCC First Pass!!!"
rm -rf gcc-3.2.3
echo "UnCompressing GCC"
tar zvxf gcc-3.2.3.tar.gz
echo "Finished Uncompressing GCC"
pushd gcc-3.2.3
perl -pi -e 's/^(TARGET_LIBGCC2_CFLAGS.*)/$1 -Dinhibit_libc
-D__gthr_posix_h/' gcc/config/arm/t-linux
echo "Changing GCC for BigEndian\n"
perl -pi -e 's/GCC_FOR_TARGET = \$\$r\/gcc\/xgcc /GCC_FOR_TARGET =
\$\$r\/gcc\/xgcc -mbig-endian /g' Makefile.in
##This is a known bug
#http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=8896
##But you dont have to do this for GCC 3.3
pushd gcc
patch -p0 < /ixp425/TOOLS/ToolChain/Patch.pr8896
perl -pi -e 's/GCC_FOR_TARGET = \.\/xgcc /GCC_FOR_TARGET = \.\/xgcc
-mbig-endian /g' Makefile.in
pushd config
pushd arm
##By default it compiles for little endian, so we have to change that to
big endian
perl -pi -e 's/^# MULTILIB_OPTIONS =
mlittle-endian\/mbig-endian/MULTILIB_OPTIONS +=
mlittle-endian\/mbig-endian/' t-arm-elf
perl -pi -e 's/^# MULTILIB_DIRNAMES = le be/MULTILIB_DIRNAMES +=
le be/' t-arm-elf
perl -pi -e 's/^# MULTILIB_MATCHES = mbig-endian=mbe
mlittle-endian=ml/MULTILIB_MATCHES += mbig-endian=mbe
mlittle-endian=ml/' t-arm-elf
popd
popd
popd
echo 'T_CFLAGS = -Dinhibit_libc -D__gthr_posix_h' >>
gcc/config/arm/t-linux
PATH=$PREFIX/bin:$PREFIX/$TARGET/include:$PATH
echo "Setting the CC variable"
CC=/usr/bin/gcc
echo "CC is now set to $CC"
echo " "
./configure --target=arm-linux --prefix=$PREFIX $HOST
--with-headers=$PREFIX/include --disable-shared --disable-threads
--enable-languages="c"
make LDFLAGS="-mbig-endian"
make install
popd
rm -rf gcc-3.2.3
#######################
# Start GLIBC
#######################
rm -rf glibc-2.2.5
tar zvxf glibc-2.2.5.tar.gz
tar -C glibc-2.2.5 -zvxf glibc-linuxthreads-2.2.5.tar.gz
pushd glibc-2.2.5
perl -pi -e
's/i386/arm*)\n\tlibc_cv_gcc_unwind_find_fde=yes\n\tarch_minimum_kernel=
2.0.10\n\t;;\n i386/' sysdeps/unix/sysv/linux/configure
perl -pi -e 's/weak_alias \(__old_sys_nerr/\/\/ $&/'
sysdeps/unix/sysv/linux/arm/errlist.c
perl -pi -e 's/weak_alias \(__old_sys_nerr/\/\/ $&/'
sysdeps/unix/sysv/linux/errlist.c
popd
rm -rf build-glibc/
mkdir build-glibc
pushd build-glibc
perl -pi -e 's/__thread/__thread_param/'
../glibc-2.2.5/linuxthreads/sysdeps/unix/sysv/linux/bits/sigthread.h
perl -pi -e 's/__thread/__thread_param/'
../glibc-2.2.5/linuxthreads/sysdeps/pthread/pthread.h
CC="$TARGET-gcc -mbig-endian" AR=$TARGET-ar RANLIB=$TARGET-ranlib
LD="$TARGET-ld -mbig-endian"
../glibc-2.2.5/configure $TARGET --target=$TARGET
--build=i686-pc-linux-gnu --with-headers=$PREFIX/$TARGET/include
--enable-add-ons=linuxthreads --enable-shared --prefix=$PREFIX/$TARGET
perl -pi -e 's/arm-linux-gcc/arm-linux-gcc -mbig-endian/' config.make
make LDFLAGS="-mbig-endian"
make install
popd
echo "Finished GLIBC , Now doing GCC for a Second Time"
echo " "
echo " "
rm -rf glibc-2.2.5
##################################
## Finish GLIBC
##################################
##################################
## Gcc a second time
##################################
tar zxvf gcc-3.2.3.tar.gz
pushd gcc-3.2.3
echo "Changing GCC for BigEndian\n"
perl -pi -e 's/GCC_FOR_TARGET = \$\$r\/gcc\/xgcc /GCC_FOR_TARGET =
\$\$r\/gcc\/xgcc -mbig-endian /g' Makefile.in
pushd gcc
patch -p0 < /ixp425/TOOLS/ToolChain/Patch.pr8896
perl -pi -e 's/GCC_FOR_TARGET = \.\/xgcc /GCC_FOR_TARGET = \.\/xgcc
-mbig-endian /g' Makefile.in
pushd config
pushd arm
perl -pi -e 's/^# MULTILIB_OPTIONS =
mlittle-endian\/mbig-endian/MULTILIB_OPTIONS +=
mlittle-endian\/mbig-endian/' t-arm-elf
perl -pi -e 's/^# MULTILIB_DIRNAMES = le be/MULTILIB_DIRNAMES +=
le be/' t-arm-elf
perl -pi -e 's/^# MULTILIB_MATCHES = mbig-endian=mbe
mlittle-endian=ml/MULTILIB_MATCHES += mbig-endian=mbe
mlittle-endian=ml/' t-arm-elf
popd
popd
popd
PATH=$PREFIX/bin:$PREFIX/$TARGET/include:$PATH
CC="$TARGET-gcc -mbig-endian" AR=$TARGET-ar RANLIB=$TARGET-ranlib
LD="$TARGET-ld -mbig-endian"
echo "Setting the CC variable"
CC=/usr/bin/gcc
echo "CC is now set to $CC"
echo " "
./configure --target=$TARGET --prefix=$PREFIX $HOST
--with-headers=$PREFIX/include --enable-languages="c,c++"
perl -pi -e 's/^CC_FOR_TARGET = \$\$r\/gcc\/xgcc/CC_FOR_TARGET =
\$\$r\/gcc\/xgcc -mbig-endian /' Makefile
perl -pi -e 's/\$\$r\/gcc\/ -nostdinc\+\+ /\$\$r\/gcc\/ -nostdinc++
-mbig-endian /' Makefile
pushd gcc
perl -pi -e 's/libstdc\+\+ /libstdc\+\+ -mbig-endian /' Makefile
popd
perl -pi -e 's/int namelen/unsigned int namelen/'
libjava/java/net/natInetAddress.cc
echo " "
echo " *********** "
echo " Now Running Make for Gcc The second time!!"
##I had to use the -i because after the C cross compiler is made
## there is another configure done which craps out when testing the
## C++ Xcompiler. But since we dont have one then it wotn work. Thsi
##step in the configure script should be ommited.
make -i LDFLAGS="-mbig-endian"
make install
popd
rm -rf gcc-3.2.3
echo " "
echo " "
echo " Good Bye All Done!"
echo "Thats It for now folks..."
exit 1
-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
Jeremy McNicoll
2003-05-30 16:13:06 UTC
Permalink
Post by Alex Zeffertt
Thanks for sending us the script. Please could you repost it
as an attachment so that the lines don't get wrapped.
Okay Here.

Loading...