开发者

Advice on building a cross-compiler for Xscale ARM?

开发者 https://www.devze.com 2022-12-19 01:29 出处:网络
I am playing around with a PXA270 Xscale development board (similar to the Gumstix), and was provided a cross compiler, but it is GCC 3.3.3.I would like to lea开发者_StackOverflowrn how to build my ow

I am playing around with a PXA270 Xscale development board (similar to the Gumstix), and was provided a cross compiler, but it is GCC 3.3.3. I would like to lea开发者_StackOverflowrn how to build my own cross compiler, so I can customize the setup, but have had trouble getting crosstools and crosstools-ng to successfully build a toolchain. My main needs are using GCC 4.2.X and the ability to use soft float. I am running Ubuntu 9. Does anyone have any recommendations or advice on building a toolchain for such a system?

Thanks in advance,

Ben


www.gnuarm.com has instructions for building your own ARM cross compiler as well as binaries available for download. They don't have GCC 4.2.x there, but I've built it using steps pretty similar to those instructions without too many problems.

Why do you want software floating point? It's going to be really slow; most applications only really need to use a fixed point implementation (read: integers).


Short answer, very difficult. Longer answer, keep trying, you may stumble upon it but likely not. Xscale with hard float is more likely and just dont use any floating point. I know I tried many combinations and failed. There is a reason why the combination you are looking for normally uses the older gcc, the last one to work. You might look at codesourcery to see what they have, using there tools or learning what they are up to is likely your best bet.


I used Dan Kegel's crosstool for creating my arm cross toolchain. It took a few tries, but I was eventually able to get it right.

I recommend reviewing the matrix of build results for various architectures to help determine a suitable combination of gcc, glibc, binutils, and linux kernel headers.

The following is the script that I used to create my arm cross toolchain. I realize that my requirements are a bit different that yours, but you may be able to modify it to suit your needs.

#!/bin/sh

set -ex

# Extract crosstool
tar zxf crosstool-0.43.tar.gz
ln -sf crosstool-0.43 crosstool

# Create .dat file for toolchain
cat << EOF > $HOME/arm-cross.dat

BINUTILS_DIR=binutils-2.15
GCC_DIR=gcc-3.4.5
GCC_EXTRA_CONFIG=--with-float=soft
GCC_LANGUAGES=c,c++
GLIBC_ADDON_OPTIONS==linuxthreads,
GLIBC_DIR=glibc-2.3.6
GLIBC_EXTRA_CONFIG=--without-fp
GDB_DIR=gdb-6.5
KERNELCONFIG="\$HOME/crosstool/arm.config"
LINUX_DIR=linux-2.6.12.6
LINUX_SANITIZED_HEADER_DIR=
SHARED_MODE=--enable-shared
TARGET=arm-softfloat-linux-gnu
TARGET_CFLAGS=-O

BUILD_DIR="\$HOME/crosstool/build/\$TARGET/\$GCC_DIR-\$GLIBC_DIR"
PREFIX="/usr/crossgnu/\$GCC_DIR-\$GLIBC_DIR/\$TARGET"
SRC_DIR="\$HOME/crosstool/build/\$TARGET/\$GCC_DIR-\$GLIBC_DIR"
TARBALLS_DIR="\$HOME/downloads"
TOP_DIR="\$HOME/crosstool"

EOF

# Create toolchain directory
sudo mkdir -p /usr/crossgnu
sudo chown $USER /usr/crossgnu

# Build toolchain
pushd crosstool
eval `cat $HOME/arm-cross.dat` sh all.sh --gdb --notest
popd

Note: I had the crosstool-0.43.tar.gz tarball in the same directory I ran the script from.


If you can't manage to build a crosscompiler using crosstool*, you're unlikely be able to do so without them. It is not straightforward!

However, you can most easily get recent cross-compilers onto Ubuntu by editing /etc/apt/sources.list to include

deb http://www.emdebian.org/debian/ lenny main

then saying

apt-get update
apt-get install g{cc,++}-4.3-arm-linux-gnueabi


I too used crosstool, and was able to build an arm-xscale-linux-gcc under Cygwin. The instructions are here: http://sourceforge.net/apps/mediawiki/imote2-linux/index.php?title=ToolsGccArm

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号