|
Message
From: Balaji V. Iyer<bviyer@n...>
Date: Sat Aug 20 19:29:16 CEST 2005
Subject: [openrisc] Problem with building GDB 5.0 of GNU Toolchain
Hey Kory, Try this modified ATS script. I am attaching it with this email. It will build the whole system. It should build the whole toolchain. Just type "Compile_Script" and hit enter. One thing to note is that it will build it in the /tmp/opt directory. Please modify it appropriately to your needs. It worked when I tried it.
Thanks,
Balaji V. Iyer.
Kory Schoenfliess wrote: > Hello, > > Following the tutorial on: > http://www.asisi.co.uk/or1k.html > > changes: trying to install gcc-3.2.3 instead of gcc-3.1 > > As the tutorial directs, I make sure that I have all the proper versions > of autoconf, automake, etc installed. I do this by installing the ones > that I need in my directory and making sure that the PATH env variable is > correct to find them. This is tested with 'which <program>' and '<program> > --version' to check for the correct version number. Everything works fine > up till this point. > > I then run the following commands the from or1k/ directory (I want > everything installed in /local2/muse/users/kmschoen/tools): > > mkdir b-b > cd b-b > ../binutils/configure --target=or32-uclinux > --prefix=/local2/muse/users/kmschoen/or1k/tools > make all install > > *WORKS FINE* > > setenv PATH /local2/muse/users/kmschoen/or1k/tools/bin:${PATH} > > *WORKS FINE -- new binaries are now accessible* > > mkdir b-gcc-3.2.3 > cd b-gcc-3.2.3 > ../gcc-3.2.3/configure --target=or32-uclinux > --prefix=/local2/muse/users/kmschoen/or1k/tools > --local-prefix=/local2/muse/users/kmschoen/or1k/tools/or32-uclinux > --with-gnu-as --with-gnu-ld --verbose --enable-languages=c > make all install > > *WORKS FINE -- CAN EXECUTE gcc now ** > > I now make the change in gdb-5.0/gdb/utils.c that the author of the > tutorial suggests, then I try to compile gdb: > > mkdir b-gdb > cd b-gdb > ../gdb-5.0/configure --target=or32-uclinux > make all > cp gdb/gdb /local2/muse/users/kmschoen/or1k/tools/bin/or32-uclinux-gdb > cd .. > > **THIS PROCESS NEVER COMPLETES -- I get the following error information > (the first few are an example of alot of the warnings i get right before > it fails to make)** > > ../../gdb-5.0/gdb/config/or1k/tm-or1k.h:319: warning: parameter has > incomplete type % -------------- next part -------------- #!/ncsu/gnu/bin/bash
# This script if used as part of ATS needs to be invoked with # argument 'ats'. All build directories will be removed. # # W/o any argument this script can be used to # install the openrisc uclinux toolchain. It should automatically # checkout all the sources, automatically build all the tools and # install them. If you modify the sources, you can't commit back # to CVS because sources are checked out as anonymous. Build # directories are not removed. # # Modified Appropriately by Balaji V. Iyer <bviyer@n...> # Advisor: Dr. Tom Conte. # North Carolina State University
# The Author/Modifier does not give any form of warranty of this product.
# # Some common variables # if [ "$1" == "ats" ]; then OR1K_WEB=../../www/cores/or1k/ats/or32-uclinux OR1K_WEB_LAST=$OR1K_WEB/last_ok INSTALL_PREFIX=/home/oc/testpool/or1k/or32-uclinux export PATH=$PATH:/usr/local/bin else OR1K_WEB=/tmp/or1k OR1K_WEB_LAST=$OR1K_WEB/last_ok
INSTALL_PREFIX=/tmp/or32-uclinux
fi
OK_STR="<font color=#00af00>Test Passed</font>"
FAIL_STR="<font color=#bf0000>Test Failed</font>"
ALL_STABLE=1
#
# Allocate test pool directory
#
cd /tmp/
rm -rf /tmp/or1k/
mkdir or1k
cd or1k
# rm -rf b-gcc/ b-b/ b-gdb/
# rm -f build_* rebuild_* checkout_* last_ok orksim_*
#
# Copy script for web visitors' reference
#
# cp ../or1k_ats_uclinux.sh $OR1K_WEB/or1k_ats_uclinux.txt
#
# Start with binutils
#
date > checkout_binutils.txt 2>&1
nice cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d binutils or1k/binutils >> checkout_binutils.txt 2>&1
mkdir b-b
cd b-b
date > ../build_binutils.txt 2>&1
uname -a >> ../build_binutils.txt 2>&1
../binutils/configure --target=or32-uclinux --prefix=$INSTALL_PREFIX >> ../build_binutils.txt 2>&1
nice /usr/bin/make all install >> ../build_binutils.txt 2>&1
BUILD_BINUTILS_STATUS=$?
export PATH=$INSTALL_PREFIX/bin:$PATH
cd ..
if [ "$1" == "ats" ]; then
rm -rf binutils
fi
#
# Copy all log files into or1k web directory
#
cp checkout_binutils.txt $OR1K_WEB
cp build_binutils.txt $OR1K_WEB
#
# Check if binutils was built and installed correctly
#
if [ $BUILD_BINUTILS_STATUS = 0 ]; then
echo "$OK_STR (`date`)" > $OR1K_WEB/build_binutils.status
cp $OR1K_WEB/build_binutils.status $OR1K_WEB_LAST
cp $OR1K_WEB/checkout_binutils.txt $OR1K_WEB_LAST
cp $OR1K_WEB/build_binutils.txt $OR1K_WEB_LAST
else
echo "$FAIL_STR (`date`)" > $OR1K_WEB/build_binutils.status
ALL_STABLE=0
fi
#
# Start with gcc
#
date > checkout_gcc.txt 2>&1
nice cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d gcc or1k/obsolete/gcc-3.2.3 >> checkout_gcc.txt 2>&1
mkdir b-gcc
cd b-gcc
date > ../build_gcc.txt 2>&1
uname -a >> ../build_gcc.txt 2>&1
nice ../gcc/configure --target=or32-uclinux --prefix=$INSTALL_PREFIX --with-local-prefix=$INSTALL_PREFIX/or32-uclinux --with-gnu-as --with-gnu-ld --verbose --enable-threads --enable-languages=c >> ../build_gcc.txt 2>&1
nice /usr/bin/make all install >> ../build_gcc.txt 2>&1
BUILD_GCC_STATUS=$?
cd ..
#
# Copy all log files into or1k web directory
#
cp checkout_gcc.txt $OR1K_WEB
cp build_gcc.txt $OR1K_WEB
#
# Check if gcc was built and installed correctly
#
if [ $BUILD_GCC_STATUS = 0 ]; then
echo "$OK_STR (`date`)" > $OR1K_WEB/build_gcc.status
cp $OR1K_WEB/build_gcc.status $OR1K_WEB_LAST
cp $OR1K_WEB/checkout_gcc.txt $OR1K_WEB_LAST
cp $OR1K_WEB/build_gcc.txt $OR1K_WEB_LAST
else
echo "$FAIL_STR (`date`)"> $OR1K_WEB/build_gcc.status
ALL_STABLE=0
fi
#
# Start with gdb
#
date > checkout_gdb.txt 2>&1
nice cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d gdb or1k/gdb-5.0 >> checkout_gdb.txt 2>&1
mkdir b-gdb
cd b-gdb
date > ../build_gdb.txt 2>&1
uname -a >> ../build_gdb.txt 2>&1
../gdb/configure --target=or32-uclinux --prefix=$INSTALL_PREFIX >> ../build_gdb.txt 2>&1
nice /usr/bin/make all install >> ../build_gdb.txt 2>&1
BUILD_GDB_STATUS=$?
cd ..
if [ "$1" == "ats" ]; then
rm -rf gdb
fi
#
# Copy all log files into or1k web directory
#
cp checkout_gdb.txt $OR1K_WEB
cp build_gdb.txt $OR1K_WEB
#
# Check if gdb was built and installed correctly
#
echo $BUILD_GDB_STATUS
if [ $BUILD_GDB_STATUS = 0 ]; then
echo "$OK_STR (`date`)" > $OR1K_WEB/build_gdb.status
cp $OR1K_WEB/build_gdb.status $OR1K_WEB_LAST
cp $OR1K_WEB/checkout_gdb.txt $OR1K_WEB_LAST
cp $OR1K_WEB/build_gdb.txt $OR1K_WEB_LAST
else
echo "$FAIL_STR (`date`)"> $OR1K_WEB/build_gdb.status
ALL_STABLE=0
fi
#
# Start with or1ksim
#
date > checkout_or1ksim.txt 2>&1
nice cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d or1ksim or1k/or1ksim >> checkout_or1ksim.txt 2>&1
cd or1ksim
date > ../build_or1ksim.txt 2>&1
uname -a >> ../build_or1ksim.txt 2>&1
../or1ksim/configure --target=or32-uclinux --prefix=$INSTALL_PREFIX >> ../build_or1ksim.txt 2>&1
nice /usr/bin/make all install >> ../build_or1ksim.txt 2>&1
BUILD_OR1KSIM_STATUS=$?
cd ..
#
# Copy all log files into or1k web directory
#
cp checkout_or1ksim.txt $OR1K_WEB
cp build_or1ksim.txt $OR1K_WEB
#
# Check if or1ksim was built and installed correctly
#
if [ $BUILD_OR1KSIM_STATUS = 0 ]; then
echo "$OK_STR (`date`)" > $OR1K_WEB/build_or1ksim.status
cp $OR1K_WEB/build_or1ksim.status $OR1K_WEB_LAST
cp $OR1K_WEB/checkout_or1ksim.txt $OR1K_WEB_LAST
cp $OR1K_WEB/build_or1ksim.txt $OR1K_WEB_LAST
else
echo "$FAIL_STR (`date`)"> $OR1K_WEB/build_or1ksim.status
ALL_STABLE=0
fi
#
# Start with uclinux
#
date > checkout_uclinux.txt 2>&1
nice cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d uClinux-2.0.x \
or1k/uclinux/uClinux-2.0.x >> checkout_uclinux.txt 2>&1
mkdir uclinux
mv uClinux-2.0.x uclinux
cd uclinux/uClinux-2.0.x
sed -e 's/^LIBGCC/#LIBGCC/; /^#LIBGCC/ a \
#updated by bviyer
LIBGCC = '$INSTALL_PREFIX'\/lib\/gcc\/or32-uclinux\/3.4.2\/libgcc.a' \
< arch/or32/Rules.make > arch/or32/Rules.make.edited
mv arch/or32/Rules.make.edited arch/or32/Rules.make
sed -e 's/^CONFIG_NET/#CONFIG_NET/; /^#CONFIG_NET/ a \
CONFIG_NET=n' < arch/or32/defconfig > arch/or32/defconfig.edited
mv arch/or32/defconfig.edited arch/or32/defconfig
nice make oldconfig >> ../../build_uclinux.txt 2>&1
nice make dep >> ../../build_uclinux.txt 2>&1
nice /usr/bin/make all >> ../../build_uclinux.txt 2>&1
BUILD_UCLINUX_STATUS=$?
touch uart0.rx
echo -e "run 40000000 hush\nq" | or32-uclinux-sim -f sim.cfg linux -i > /dev/null
cp uart0.tx ../../or1ksim_uclinux.txt
cd ../../
#
# Copy all log files into or1k web directory
#
cp checkout_uclinux.txt $OR1K_WEB
cp build_uclinux.txt $OR1K_WEB
cp or1ksim_uclinux.txt $OR1K_WEB
#
# Check if uclinux was built and installed correctly
#
if [ $BUILD_UCLINUX_STATUS = 0 ]; then
echo "$OK_STR (`date`)" > $OR1K_WEB/build_uclinux.status
cp $OR1K_WEB/build_uclinux.status $OR1K_WEB_LAST
cp $OR1K_WEB/checkout_uclinux.txt $OR1K_WEB_LAST
cp $OR1K_WEB/build_uclinux.txt $OR1K_WEB_LAST
else
echo "$FAIL_STR (`date`)"> $OR1K_WEB/build_uclinux.status
ALL_STABLE=0
fi
if [ `grep Executing or1ksim_uclinux.txt | wc -l` -gt 0 ]; then
echo "$OK_STR (`date`)" > $OR1K_WEB/or1ksim_uclinux.status
cp $OR1K_WEB/or1ksim_uclinux.status $OR1K_WEB_LAST
cp $OR1K_WEB/or1ksim_uclinux.txt $OR1K_WEB_LAST
else
echo "$FAIL_STR (`date`)"> $OR1K_WEB/or1ksim_uclinux.status
ALL_STABLE=0
fi
#
# Start with uclibc
#
date > checkout_uclibc.txt 2>&1
nice cvs -d :pserver:cvs@cvs.opencores.org:/home/oc/cvs -z9 co -d uclibc \
or1k/obsolete/uclibc >> checkout_uclibc.txt 2>&1
cd uclibc
date > ../build_uclibc.txt 2>&1
uname -a >> ../build_uclibc.txt 2>&1
ln -s ./extra/Configs/Config.cross.or32.uclinux Config
sed -e 's/^KERNEL_SOURCE/#KERNEL_SOURCE/; /^#KERNEL_SOURCE/ a \
KERNEL_SOURCE = '`pwd`'\/..\/uclinux\/uClinux-2.0.x' < Config > Config.edited
sed -e 's/^DEVEL_PREFIX/#DEVEL_PREFIX/; /^#DEVEL_PREFIX/ a \
DEVEL_PREFIX = '$INSTALL_PREFIX < Config.edited > Config
rm Config.edited
nice /usr/bin/make all install >> ../build_uclibc.txt 2>&1
BUILD_UCLIBC_STATUS=$?
pushd .
cd $INSTALL_PREFIX/bin
rm -f ar as cc cpp gasp gcc ld nm objcopy objdump ranlib size strings strip jar grepjar
popd
cd ../b-gcc
date > ../rebuild_gcc.txt 2>&1
uname -a >> ../rebuild_gcc.txt 2>&1
nice ../gcc/configure --target=or32-uclinux --prefix=/tmp/opt/or32-uclinux --with-local-prefix=/tmp/opt/or32-uclinux/or32-uclinux --with-gnu-as --with-gnu-ld --enable-threads --enable-languages=c >> ../rebuild_gcc.txt 2>&1
nice make all install >> ../rebuild_gcc.txt 2>&1
REBUILD_GCC_STATUS=$?
cd ..
#
# Check or1ksim testbench
#
cd or1ksim/testbench
date > ../../or1ksim_testbench.txt 2>&1
CFLAGS="-nostdlib" ./configure --target=or32-uclinux --host=or32-uclinux >> ../../or1ksim_testbench.txt 2>&1
export PATH=$PATH:..
make check >> ../../or1ksim_testbench.txt 2>&1
cd ../..
#
# Copy all log files into or1k web directory
#
cp or1ksim_testbench.txt $OR1K_WEB
#
# Check if or1ksim testbench passed OK
#
if [ `grep passed or1ksim_testbench.txt | wc -l` -gt 0 ]; then
echo "$OK_STR (`date`)" > $OR1K_WEB/or1ksim_testbench.status
cp $OR1K_WEB/or1ksim_testbench.status $OR1K_WEB_LAST
cp $OR1K_WEB/or1ksim_testbench.txt $OR1K_WEB_LAST
else
echo "$FAIL_STR (`date`)"> $OR1K_WEB/or1ksim_testbench.status
ALL_STABLE=0
fi
if [ "$1" == "ats" ]; then
rm -rf uclibc uclinux gcc or1ksim
fi
#
# Copy all log files into or1k web directory
#
cp checkout_uclibc.txt $OR1K_WEB
cp build_uclibc.txt $OR1K_WEB
cp rebuild_gcc.txt $OR1K_WEB
#
# Check if uclibc was built and installed correctly
#
if [ $BUILD_UCLIBC_STATUS = 0 ]; then
echo "$OK_STR (`date`)" > $OR1K_WEB/build_uclibc.status
cp $OR1K_WEB/build_uclibc.status $OR1K_WEB_LAST
cp $OR1K_WEB/checkout_uclibc.txt $OR1K_WEB_LAST
cp $OR1K_WEB/build_uclibc.txt $OR1K_WEB_LAST
else
echo "$FAIL_STR (`date`)"> $OR1K_WEB/build_uclibc.status
ALL_STABLE=0
fi
if [ $REBUILD_GCC_STATUS = 0 ]; then
echo "$OK_STR (`date`)" > $OR1K_WEB/rebuild_gcc.status
cp $OR1K_WEB/rebuild_gcc.status $OR1K_WEB_LAST
cp $OR1K_WEB/rebuild_gcc.txt $OR1K_WEB_LAST
else
echo "$FAIL_STR (`date`)"> $OR1K_WEB/rebuild_gcc.status
ALL_STABLE-0
fi
#
# rtag sources as ats-stable if everything worked
#
cd ..
if [ "$1" == "ats" ]; then
if [ $ALL_STABLE = 1 ]; then
nice cvs -d :pserver:ats@cvs.opencores.org:/home/oc/cvs -z9 rtag -FR ats-stable or1k/binutils > /dev/null 2>&1
nice cvs -d :pserver:ats@cvs.opencores.org:/home/oc/cvs -z9 rtag -FR ats-stable or1k/gcc-3.2.3 > /dev/null 2>&1
nice cvs -d :pserver:ats@cvs.opencores.org:/home/oc/cvs -z9 rtag -FR ats-stable or1k/gdb-5.0 > /dev/null 2>&1
nice cvs -d :pserver:ats@cvs.opencores.org:/home/oc/cvs -z9 rtag -FR ats-stable or1k/or1ksim > /dev/null 2>&1
nice cvs -d :pserver:ats@cvs.opencores.org:/home/oc/cvs -z9 rtag -FR ats-stable or1k/uclinux > /dev/null 2>&1
nice cvs -d :pserver:ats@cvs.opencores.org:/home/oc/cvs -z9 rtag -FR ats-stable or1k/uclibc > /dev/null 2>&1
fi
fi
#
# Clean testpool
#
if [ "$1" == "ats" ]; then
rm -rf or1k
fi
|
 |