[转载]编译内核出错:invalid option `abi=aapcs-linux'

原文链接:http://hi.baidu.com/igouwa/blog/item/88b2ed835f5863ab0df4d2e5.html

                         编译内核出错:invalid option `abi=aapcs-linux'

使用旧编译器,编译出错:
gouwa@gouwa:~/project/kernel/linux-2.6.29$ arm-linux-gcc -v
Reading specs from /usr/local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/specs
Configured with: /opt/crosstool/crosstool-0.28/build/arm-linux/gcc-3.4.1-glibc-2.3.2/gcc-3.4.1/configure --target=arm-linux --host=i686-host_pc-linux-gnu --prefix=/opt/crosstool/arm-linux/gcc-3.4.1-glibc-2.3.2 --with-float=soft --with-headers=/opt/crosstool/arm-linux/gcc-3.4.1-glibc-2.3.2/arm-linux/include --with-local-prefix=/opt/crosstool/arm-linux/gcc-3.4.1-glibc-2.3.2/arm-linux --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long
Thread model: posix
gcc version 3.4.1

错误信息如下:
gouwa@gouwa:~/project/kernel/linux-2.6.29$ make
scripts/kconfig/conf -s arch/arm/Kconfig
CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK     include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-arm
CC      kernel/bounds.s
cc1: error: invalid option `abi=aapcs-linux'
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2


使用新编译器,编译通过(由蓝色部分可看出,该编译器编译对象是EABI的)
gouwa@gouwa:~$ arm-linux-gcc -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /scratch/julian/lite-respin/linux/src/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2008q3-72' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72)

错误分析:
旧编译器可能是用OABI的,而配置内核时又选择了使用EABI的,修改内核配置:
    Kernel Features ---->Use the ARM EABIto compile the kernel
选上EABI,使用旧编译器再编译,哈哈,通过。(~.~)   

你可能感兴趣的:(c,UP,features,编译器)