crosstool-ng
http://freshmeat.net/projects/crosstool-ng/
http://ymorin.is-a-geek.org/download/crosstool-ng/01-fixes/
$ sudo apt-get install subversion gcj g++
$ patch -p1 < 001-XXXX
$ ./configure --prefix=/opt/crosstool-ng
$ make
$ sudo make install $ echo "PATH=$PATH:/opt/crosstool-ng/bin" >> ~/.bashrc
$ source ~/.bashrc
$ mkdir ct_build
$ mkdir src
$ mkdir x-tools
$ cd ct_build
$ ct-ng arm-unknown-linux-gnueabi
$ ct-ng menuconfig
Target options --->
*** Target optimisations ***
(armv5te) Architecture level
(arm926ej-s) Emit assembly for CPU
(arm926ej-s) Tune for CPU
S3C2410/S3C2440
armv4t
arm920t
S3C2416/AT91SAM9263/AT91SAM9G45
armv5te
arm926ej-s
S3C6410
armv6
arm1176jzf-s
$ ct-ng build.2
=======================
1.cloog error
make: *** No rule to make target `/home/arthur/work/ct-atmel/targets/src/cloog-ppl-0.15.10/m4/libtool.m4', needed by `/home/arthur/work/ct-atmel/targets/src/cloog-ppl-0.15.10/Makefile.in'. Stop.
/opt/crosstool-ng/lib/ct-ng-1.9.0/scripts/build/companion_libs/c;oog.sh
diff -r 4d074e5882e5 -r be83d1a14c3d scripts/build/companion_libs/cloog.sh
--- a/scripts/build/companion_libs/cloog.sh Sun Oct 31 11:45:39 2010 +0200
+++ b/scripts/build/companion_libs/cloog.sh Thu Nov 04 18:23:35 2010 +0200
@@ -29,6 +29,7 @@
esac
CT_Pushd "${CT_SRC_DIR}/cloog-ppl${_t}"
CT_Patch nochdir "cloog-ppl" "${CT_CLOOG_VERSION}"
+ ./autogen.sh
CT_Popd
}
2.
[ALL ] In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:
[ALL ] ../misc/syslog.c: In function '__vsyslog_chk':
[ALL ] ../misc/syslog.c:123: sorry, unimplemented: inlining failed in call to 'syslog': function body not available
[ALL ] ../misc/syslog.c:155: sorry, unimplemented: called from here
[ERROR] make[4]: *** [/home/arthur/work/ct-atmel/targets/arm-atmel-linux-gnueabi/build/build-libc/misc/syslog.o] Error 1
CT_LIBC_GLIBC_EXTRA_CFLAGS="-U_FORTIFY_SOURCE"
3.舊linux版會出現的error
[ERROR] /home/arthur/work/ct-2410/targets/src/linux-2.6.24/scripts/unifdef.c:209: error: conflicting types for 'getline'
root@arthur-VirtualBox:/home/arthur/work/ct-2410# find . -name 'unifdef.c'
./targets/src/linux-2.6.24/scripts/unifdef.c
+--- a/scripts/unifdef.c
++++ b/scripts/unifdef.c
+@@ -206,7 +206,7 @@ static void done(void);
+ static void error(const char *);
+ static int findsym(const char *);
+ static void flushline(bool);
+-static Linetype getline(void);
++static Linetype get_line(void);
+ static Linetype ifeval(const char **);
+ static void ignoreoff(void);
+ static void ignoreon(void);
+@@ -512,7 +512,7 @@ process(void)
+
+ for (;;) {
+ linenum++;
+- lineval = getline();
++ lineval = get_line();
+ trans_table[ifstate[depth]][lineval]();
+ debug("process %s -> %s depth %d",
+ linetype_name[lineval],
+@@ -526,7 +526,7 @@ process(void)
+ * help from skipcomment().
+ */
+ static Linetype
+-getline(void)
++get_line(void)
+ {
+ const char *cp;
+ int cursym;
+--
為工具鏈增加鏈接
$ cd arm-unknown-linux-gnueabi/bin
$ ./autoln.sh
autoln.sh是一個腳本,用來自動鏈接arm-unknown-linux-gnueabi的工具...
文件名:autoln.sh 拷到要自動建立鏈接的文件夾使用。
#!/bin/bash
#
# main
#
if [ $# -lt 1 ] ; then
echo "default path: ./"
BIN_PATH=./
else
BIN_PATH=$1
fi
if [ ! -d $1 ] ; then
echo "path error"
exit
fi
cd $BIN_PATH
SRC=`ls | awk '{print $1}'`
for i in $SRC ; do
if [ "$i" != "autoln.sh" ] ; then
#echo $i
TARGET=`echo $i | sed 's/arm-unknown-linux-gnueabi/arm-linux/g' `
echo $TARGET
ln -s $i $TARGET
fi
done