最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】cc1: error: invalid option `abi=apcs-gnu’

工作和技术 crifan 2429浏览 0评论

【记录】cc1: error: invalid option `abi=apcs-gnu’

在用arm-linux-gcc编译uboot 1.1.6:

其中,arm-linux-gcc的版本是:

<p> <a rel="nofollow" href="mailto:crifan@crifan-ubuntu10:~/develop/tq2440/uboot/u-boot-1.1.6_20100601/opt/EmbedSky/u-boot-1.1.6$">crifan@crifan-ubuntu10:~/develop/tq2440/uboot/u-boot-1.1.6_20100601/opt/EmbedSky/u-boot-1.1.6$</a> arm-linux-gcc -v<br />Using built-in specs.<br />Target: arm-none-linux-gnueabi<br />Configured with: /scratch/maxim/arm-lite/src-4.3-arm-none-linux-gnueabi-lite/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 --with-specs='%{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables}' --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2009q1-176' --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/maxim/arm-lite/install-4.3-arm-none-linux-gnueabi-lite/arm-none-linux-gnueabi/libc --with-gmp=/scratch/maxim/arm-lite/obj-4.3-arm-none-linux-gnueabi-lite/host-libs-2009q1-176-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/maxim/arm-lite/obj-4.3-arm-none-linux-gnueabi-lite/host-libs-2009q1-176-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/maxim/arm-lite/install-4.3-arm-none-linux-gnueabi-lite/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/maxim/arm-lite/install-4.3-arm-none-linux-gnueabi-lite/arm-none-linux-gnueabi/bin<br />Thread model: posix<br />gcc version 4.3.3 (Sourcery G++ Lite 2009q1-176) </p>

正常编译都是OK的,只是无意间,把一个编译选项从:

DBGFLAGS= -gdwarf-2

设置为

DBGFLAGS= -gdwarf

结果导致编译时候出错:

cc1: error: invalid option `abi=apcs-gnu’

而不是预想的,如果识别不了编译参数-gdwarf,那么至少会提示不识别此参数,而不是给出不相关的其他错误啊。

所以,此处弄出个

cc1: error: invalid option `abi=apcs-gnu’

还真的很是无语,如果在不小心或者不知情的情况下,给了个错误的编译参数,结果编译器却没有正确提示,那么真的很难找到问题到底出在哪,也就难解决问题了。

【总结】

如果以后编译Uboot的时候,遇到此提示:

cc1: error: invalid option `abi=apcs-gnu’

可以考虑一下,有可能是,类似于我这里,给了个编译参数

DBGFLAGS= -gdwarf,而arm-linux-gcc不识别,导致报出此问题。

转载请注明:在路上 » 【记录】cc1: error: invalid option `abi=apcs-gnu’

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.172 seconds, using 22.07MB memory