[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] Toochain build successful



WARNING: This e-mail has been altered by ITEE at UQ's anti-virus
filter MIMEDefang.  Following this paragraph are indications of 
the actual changes made.  For more information about ITEE at UQ's
anti-virus policy, please contact postmaster@itee.uq.edu.au. 

Bad filename 'build-mbgcc.sh'

The attachment 'build-mbgcc.sh' was removed from this email as it
violated ITEE's anti-virus policy.  If you require this document,
please contact the sender and arrange an alternate means of
receiving it (ask them to zip it up or change the extension,
for instance).

Here's an updated script (still rough) to build binutils, gcc, and
newlib

The trick was that you should never, never, never build gcc within it's
own directory. I remembered that from some other gcc work I'd done a
while back and it holds true. The problem is that weird things creep in
from some hacks within the gcc build process. I think the 3.x series is
ok, but the 2.x series was prone to these little issues creeping in.
I've both cat'ed the script into the text here and mime-attached it.
There is still an error thrown about not having libxil.a, but this
should cure all of the other ills. Criticism is more than welcome.
Anyway, withut further delay:

#!/bin/sh

# turn on debugging
set -x

# set up directories
# where is the source
export EDKSRC=`pwd`
# release (target) directory
export RELDIR=`pwd`/reldir
# where can we copy existing header files from?
export INSTALLDIR=/opt/mb-gcc

# make release directory
mkdir -f ${RELDIR}

# first build binutils:
cd ${EDKSRC}/binutils/microblaze
./configure --target=microblaze --prefix=${RELDIR}
make all CFLAGS="-O2 -g -DMICROBLAZE -DEDK" CXXFLAGS="-O2 -g
-DMICROBLAZE -DEDK"
make install

# link microblaze-as to mb-as
ln ${RELDIR}/bin/microblaze-as ${RELDIR}/bin/mb-as 
ln ${RELDIR}/bin/microblaze-ld ${RELDIR}/bin/mb-ld 
ln ${RELDIR}/bin/microblaze-ar ${RELDIR}/bin/mb-ar 
ln ${RELDIR}/bin/microblaze-ranlib ${RELDIR}/bin/mb-ranlib 

# add newly created binutils to the path
export PATH=${PATH}:${RELDIR}/bin

# copy header files from install directory into new release directory
cp -R ${INSTALLDIR}/microblaze/include ${RELDIR}/microblaze/include
cp -R ${INSTALLDIR}/include ${RELDIR}/include

# Now build gcc
cd ${EDKSRC}/gcc
#touch gcc/configure
mkdir build
cd build
../configure --target=microblaze --prefix=${RELDIR}
make all CFLAGS="-O2 -g -DMICROBLAZE -DEDK" CXXFLAGS="-O2 -g
-DMICROBLAZE -DEDK"
make install

ln ${RELDIR}/bin/microblaze-gcc ${RELDIR}/bin/mb-gcc 

# Now build newlib (crt files, libc, etc...)
cd ${EDKSRC}/newlib/microblaze
make

# We've got to pick out the things that we want 
# since there's no `make install`

cp libc.a libm.a ${RELDIR}/microblaze/lib
cp libgloss/microblaze/crt*.o ${RELDIR}/microblaze/lib