gcc-3.4.5クロス環境(1)

一番楽なのは、crosstoolを使う方法でしょう。
crosstool-0.42.tar.gz(現時点での最新バージョン)を展開し、 demo-*.sh を実行するだけ。必要なファイルもDLしてくれます。
また、toolchainの作成手順やconfigureオプションが参考になるし、パッチ(patches/*)も利用できます。


実際にgcc-3.4.5のクロスコンパイラを作る方法は、attyさん2006-03-30の日記が参考になります。これを元にして、例えば hardfloat にするには、

arm-xscale_hardfloat.dat

NELCONFIG=`pwd`/arm.config
TARGET=arm-xscale_hardfloat-linux-gnu
TARGET_CFLAGS="-O"
GCC_EXTRA_CONFIG="--with-float=hard --with-cpu=xscale --enable-cxx-flags=-mcpu=xscale"
GLIBC_EXTRA_CONFIG="--without-fp"

demo-arm-hardfloat.sh

eval `cat arm-xscale_hardfloat.dat gcc-3.4.5-glibc-2.3.6.dat` sh all.sh --notest -gdb


共有ライブラリを参照しないものはこれで大丈夫ですが、依存関係を解消しようとすると面倒になります。
つづく