|
楼主 |
发表于 2009-8-25 16:26:05
|
显示全部楼层
图 用Vi编辑器在.bash_profile文件中添加环境变量
设置完环境变量,也就意味着交叉编译工具链已经构建完成,然后就可以进行测试刚刚建立的工具链,在命令行输入arm-linux-gcc看是否有输入文件提示,如果有说明交叉编译器已经安装好。
实践出现的问题及解决方法:
问题一:执行.arm.sh出现如下权限错误?
[root@localhost crosstool-0.43]# ./arm.sh
+ TARBALLS_DIR=/home/mike/downloads
+ RESULT_TOP=/opt/crosstool
+ export TARBALLS_DIR RESULT_TOP
+ GCC_LANGUAGES=c,c++
+ export GCC_LANGUAGES
+ mkdir -p /opt/crosstool
++ cat arm.dat gcc-3.4.5-glibc-2.3.6.dat
+ eval 'KERNELCONFIG=`pwd`/arm.config' TARGET=arm-linux 'TARGET_CFLAGS="-O"' BINUTILS_DIR=binutils-2.15 GCC_DIR=gcc-3.4.5 GLIBC_DIR=glibc-2.3.6 LINUX_DIR=linux-2.6.28.2 LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 sh all.sh --notest
+++ pwd
++ KERNELCONFIG=/home/mike/crosstool-0.43/arm.config
++ TARGET=arm-linux
++ TARGET_CFLAGS=-O
++ BINUTILS_DIR=binutils-2.15
++ GCC_DIR=gcc-3.4.5
++ GLIBC_DIR=glibc-2.3.6
++ LINUX_DIR=linux-2.6.28.2
++ LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
++ GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2
++ sh all.sh --notest
You set both LINUX_DIR and LINUX_SANITIZED_HEADER_DIR - ignoring LINUX_DIR for the build
DEJAGNU not set, so not running any regression tests
GCC_EXTRA_CONFIG not set, so not passing any extra options to gcc's configure script
GLIBC_ADDON_OPTIONS not set, so building all glibc add-on's
+ TOOLCOMBO=gcc-3.4.5-glibc-2.3.6
++ pwd
+ BUILD_DIR=/home/mike/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6
++ pwd
+ TOP_DIR=/home/mike/crosstool-0.43
+ test -z ''
+ SRC_DIR=/home/mike/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6
+ echo 'SRC_DIR not set, so source tarballs will be unpacked in the build directory'
SRC_DIR not set, so source tarballs will be unpacked in the build directory
+ abort 'Don'\''t run all.sh or crosstool.sh as root, it'\''s dangerous'
+ echo 'Don'\''t' run all.sh or crosstool.sh as root, 'it'\''s' dangerous
Don't run all.sh or crosstool.sh as root, it's dangerous
+ exec false
[root@localhost crosstool-0.43]#
解决办法:
[root@localhost crosstool-0.43]# su mike //切换到普通用户mike
[mike@localhost crosstool-0.43]$ ./arm.sh
+ TARBALLS_DIR=/home/mike/downloads
+ RESULT_TOP=/opt/crosstool
+ export TARBALLS_DIR RESULT_TOP
+ GCC_LANGUAGES=c,c++
+ export GCC_LANGUAGES
+ mkdir -p /opt/crosstool
++ cat arm.dat gcc-3.4.5-glibc-2.3.6.dat
+ eval 'KERNELCONFIG=`pwd`/arm.config' TARGET=arm-linux 'TARGET_CFLAGS="-O"' BINUTILS_DIR=binutils-2.15 GCC_DIR=gcc-3.4.5 GLIBC_DIR=glibc-2.3.6 LINUX_DIR=linux-2.6.28.2 LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0 GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2 sh all.sh --notest
+++ pwd
++ KERNELCONFIG=/home/mike/crosstool-0.43/arm.config
++ TARGET=arm-linux
++ TARGET_CFLAGS=-O
++ BINUTILS_DIR=binutils-2.15
++ GCC_DIR=gcc-3.4.5
++ GLIBC_DIR=glibc-2.3.6
++ LINUX_DIR=linux-2.6.28.2
++ LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
++ GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2
++ sh all.sh --notest
You set both LINUX_DIR and LINUX_SANITIZED_HEADER_DIR - ignoring LINUX_DIR for the build
DEJAGNU not set, so not running any regression tests
GCC_EXTRA_CONFIG not set, so not passing any extra options to gcc's configure script
GLIBC_ADDON_OPTIONS not set, so building all glibc add-on's
+ TOOLCOMBO=gcc-3.4.5-glibc-2.3.6
++ pwd
+ BUILD_DIR=/home/mike/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6
++ pwd
+ TOP_DIR=/home/mike/crosstool-0.43
+ test -z ''
+ SRC_DIR=/home/mike/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6
+ echo 'SRC_DIR not set, so source tarballs will be unpacked in the build directory'
SRC_DIR not set, so source tarballs will be unpacked in the build directory
+ test -w /tmp
+ TARBALLS_DIR=/home/mike/downloads
+ RESULT_TOP=/opt/crosstool
+ PREFIX=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/arm-linux
+ export TOOLCOMBO
+ export PREFIX
+ export BUILD_DIR
+ export SRC_DIR
+ export TARBALLS_DIR
+ export TOP_DIR
+ '[' 1 -gt 0 ']'
+ opt_no_test=1
+ shift
+ '[' 0 -gt 0 ']'
+ test '' = 1
+ test '' = ''
+ test '' = 1
+ test -d /home/mike/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6
+ mkdir -p /home/mike/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6
mkdir: cannot create directory `/home/mike/crosstool-0.43/build': Permission denied
[mike@localhost crosstool-0.43]$ su
Password:
[root@localhost crosstool-0.43]# ./arm.sh
来源:http://bbs.eeworld.com.cn/thread-80832-3-1.html |
|