关于The C compiler "arm-none-eabi-gcc" is not able to compile a simple test program. 的错误自省...
在 GCC ARM Embedded
https://launchpad.net/gcc-arm-embedded/
上面下载了个arm-none-eabi-gcc
用cmake 编译时
#指定C交叉编译器,必须配置
#或交叉编译器使用绝对地址
SET(CMAKE_C_COMPILER "/disk2/gcc-arm-none-eabi-4.8.3/bin/arm-none-eabi-gcc") #指定C++交叉编译器
SET(CMAKE_CXX_COMPILER "/disk2/gcc-arm-none-eabi-4.8.3/bin/arm-none-eabi-g++")
一直报错:
The C compiler "/disk2/gcc-arm-none-eabi-4.8.3/bin/arm-none-eabi-gcc" is
not able to compile a simple test program. Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /disk2/gcc-arm-none-eabi-4.8./bin/arm-none-eabi-gcc
Build flags:
Id flags: The output was: /disk2/gcc-arm-none-eabi-4.8./bin/../lib/gcc/arm-none-eabi/4.8./../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2: error: ld returned exit status Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /disk2/gcc-arm-none-eabi-4.8./bin/arm-none-eabi-g++
Build flags:
Id flags: The output was:
baidu 半天,的结果是
** semihosting
If you need semihosting, linking like:
$ arm-none-eabi-gcc --specs=rdimon.specs $(OTHER_LINK_OPTIONS) ** non-semihosting/retarget
If you are using retarget, linking like:
$ arm-none-eabi-gcc --specs=nosys.specs $(OTHER_LINK_OPTIONS
加上 --specs=nosys.specs 还是报错.
当时就觉得这个
Thread model: single 与原来4.5版本的
Thread model: posix 不一致有些奇怪.
root@debian:/disk2/gcc-arm-none-eabi-4.8./bin# arm-none-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/usr/arm-linux-g++_4.5.1/4.5./bin/../libexec/gcc/arm-none-linux-gnueabi/4.5./lto-wrapper
Target: arm-none-linux-gnueabi
Configured with: /work/toolchain/build/src/gcc-4.5./configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-none-linux-gnueabi --prefix=/opt/FriendlyARM/toolschain/4.5. --with-sysroot=/opt/FriendlyARM/toolschain/4.5./arm-none-linux-gnueabi/sys-root --enable-languages=c,c++ --disable-multilib --with-cpu=arm1176jzf-s --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=softfp --with-pkgversion=ctng-1.8.-FA --with-bugurl=http://www.arm9.net/ --disable-sjlj-exceptions --enable-__cxa_atexit --disable-libmudflap --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-gmp=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-mpfr=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-ppl=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-cloog=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-mpc=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-libelf=/work/toolchain/build/arm-none-linux-gnueabi/build/static --enable-threads=posix --with-local-prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/sys-root --disable-nls --enable-symvers=gnu --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.5. (ctng-1.8.-FA)
root@debian:/disk2/gcc-arm-none-eabi-4.8./bin# ./arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=./arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/disk2/gcc-arm-none-eabi-4.8./bin/../lib/gcc/arm-none-eabi/4.8./lto-wrapper
Target: arm-none-eabi
Configured with: /home/build/work/GCC---build/src/gcc/configure --target=arm-none-eabi --prefix=/home/build/work/GCC---build/install-native --libexecdir=/home/build/work/GCC---build/install-native/lib --infodir=/home/build/work/GCC---build/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC---build/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC---build/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC---build/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build/work/GCC---build/install-native/arm-none-eabi --build=i686-linux-gnu --host=i686-linux-gnu --with-gmp=/home/build/work/GCC---build/build-native/host-libs/usr --with-mpfr=/home/build/work/GCC---build/build-native/host-libs/usr --with-mpc=/home/build/work/GCC---build/build-native/host-libs/usr --with-isl=/home/build/work/GCC---build/build-native/host-libs/usr --with-cloog=/home/build/work/GCC---build/build-native/host-libs/usr --with-libelf=/home/build/work/GCC---build/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m,armv7-r
Thread model: single
gcc version 4.8. (release) [ARM/embedded-4_8-branch revision ] (GNU Tools for ARM Embedded Processors)
root@debian:/disk2/gcc-arm-none-eabi-4.8./bin# ^C
无意在
http://www.veryarm.com/296.html
上面看见
1、arm-none-eabi-gcc
(ARM architecture,no vendor,not target an operating system,complies with the ARM EABI)
用于编译 ARM 架构的裸机系统(包括 ARM Linux 的 boot、kernel,不适用编译 Linux 应用 Application),一般适合 ARM7、Cortex-M 和 Cortex-R 内核的芯片使用,所以不支持那些跟操作系统关系密切的函数,比如fork(2),他使用的是 newlib 这个专用于嵌入式系统的C库。
2、arm-none-linux-gnueabi-gcc
(ARM architecture, no vendor, creates binaries that run on the Linux operating system, and uses the GNU EABI)
主要用于基于ARM架构的Linux系统,可用于编译 ARM 架构的 u-boot、Linux内核、linux应用等。arm-none-linux-gnueabi基于GCC,使用Glibc库,经过 Codesourcery 公司优化过推出的编译器。arm-none-linux-gnueabi-xxx 交叉编译工具的浮点运算非常优秀。一般ARM9、ARM11、Cortex-A 内核,带有 Linux 操作系统的会用到。
3、arm-eabi-gcc
Android ARM 编译器。
4、armcc
ARM 公司推出的编译工具,功能和 arm-none-eabi 类似,可以编译裸机程序(u-boot、kernel),但是不能编译 Linux 应用程序。armcc一般和ARM开发工具一起,Keil MDK、ADS、RVDS和DS-5中的编译器都是armcc,所以 armcc 编译器都是收费的(爱国版除外,呵呵~~)。
5、arm-none-uclinuxeabi-gcc 和 arm-none-symbianelf-gcc
arm-none-uclinuxeabi 用于uCLinux,使用Glibc。
arm-none-symbianelf 用于symbian,没用过,不知道C库是什么 。
才慌然 呆了...
后在
http://www.veryarm.com/arm-none-linux-gnueabi-gcc#linux
上下载 了最近的
arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar
编译成功.
最新版本:
root@debian:/disk2/arm-2014.05# ./bin/arm-none-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=./bin/arm-none-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/disk2/arm-2014.05/bin/../libexec/gcc/arm-none-linux-gnueabi/4.8./lto-wrapper
Target: arm-none-linux-gnueabi
Configured with: /scratch/maciej/arm-linux-2014.05-rel/src/gcc-4.8-2014.05/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 --enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fverbose-asm} %{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} -D__CS_SOURCERYGXX_MAJ__=2014 -D__CS_SOURCERYGXX_MIN__=5 -D__CS_SOURCERYGXX_REV__=29' --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery CodeBench Lite 2014.05-29' --with-bugurl=https://sourcery.mentor.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/libc --with-gmp=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-mpfr=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-mpc=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-isl=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-cloog=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --disable-libgomp --disable-libitm --enable-libatomic --disable-libssp --enable-poison-system-directories --with-build-time-tools=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/bin SED=sed
Thread model: posix
gcc version 4.8. (prerelease) (Sourcery CodeBench Lite 2014.05-)
root@debian:/disk2/arm-2014.05# cd ..
以此小记。
关于The C compiler "arm-none-eabi-gcc" is not able to compile a simple test program. 的错误自省...的更多相关文章
- coreseek 在gcc 4.9+ 上编译不通过 [sphinxexpr.o] Error 1 错误解决方案
这几天玩hhvm,把gcc环境都装到4.9了,然后编译coreseek的时候就出问题,google一大圈,貌似捕风捉影看到一些信息说是gcc4.7+的c++作用域必须用this->去引用,这里整 ...
- arm 交叉编译时 gcc 的 Options
https://sourceware.org/binutils/docs/as/ARM-Options.html https://gcc.gnu.org/onlinedocs/gcc-4.5.3/gc ...
- Linux学习笔记2_mysql安装
查看文件内容的命令有很多:cat, tac, more, less, head, tail, nl. cat由第一行开始显示档案内容:tac从最后一行开始显示,可以看出tac是cat的倒着写:more ...
- Linux之mysql安装
查看文件内容的命令有很多:cat, tac, more, less, head, tail, nl. cat由第一行开始显示档案内容:tac从最后一行开始显示,可以看出tac是cat的倒着写:more ...
- CAFFE在win10+VS2017下的安装笔记
老版的caffe在BVLC的github上已经找不到,如果要想下载老版caffe可以下载微软的caffe版本:https://github.com/Microsoft/caffe 网上的大多安装caf ...
- Mingw编译DLib
Mingw编译DLib 因为机器上安装了qt-opensource-windows-x86-mingw530-5.8.0,所以准备使用其自带的mingw530来编译DLib使用. 因为DLib使用CM ...
- cmake的一个编译报错
在一台新搭建的服务器上执行cmake的时候,报了如下错误: $ cmake ./ -- The C compiler identification is unknown -- The CXX comp ...
- Andriod学习笔记3:Mac 平台下搭建 CLion 集成开发环境
1. 安装Xcode 通过App store或者下载安装Xcode. 安装完成之后,最好启动一下Xcode,否则可能会报"Error:The C compiler "/usr/bi ...
- 编译哈工大语言技术平台云LTP(C++)源码及LTP4J(Java)源码
转自:编译哈工大语言技术平台云LTP(C++)源码及LTP4J(Java)源码 JDK:java version “1.8.0_31”Java(TM) SE Runtime Environment ( ...
随机推荐
- DataTable常用代码
构建DataTable DataTable dtUserInfo = new DataTable("UserInfo"); dtUserInfo.Columns.Add(" ...
- 一段SQL
如何将会计分录流水合并成会计分录,环境oracle 11g,代码如下: 表: CREATE TABLE "DEMO_VCH" ("SET_NO" BYTE), ...
- WPF之命名空间和资源
1.参考: https://msdn.microsoft.com/zh-cn/library/ms747086(v=vs.110).aspx http://www.cnblogs.com/cww201 ...
- Content-disposition
今天查看Struts2的文件上传部分 发现有个例子开头打印的信息中有Content-Disposition,一时好奇,所以了解了一下.顺便学习一下文件上传所需要的注意事项. Content-dispo ...
- log4net 添加日志
1. 在config里配置一下 <configSections> <section name="log4net" type="System.Co ...
- ABAP 出库单打印 产品 A搭A A搭B显示方式
*&---------------------------------------------------------------------* *& Report *& ...
- ABAP READ TABLE语句注意
READ TABLE 后注意判断 sy-subrc 是否等于0
- ubuntu 配置VPN
1. sudo apt-get install pptpd 2. 修改/etc/pptpd.conf , vi /etc/pptpd.conf 找到#localip 192.168.0.1和#re ...
- linux c/c++
string 字符串操作 操作数的都是 ( char * )型,操作数必须是指向字符串的指针("a"),不能是字符('a'),操作时不考虑末尾的'\0'. size_t strle ...
- APM程序分析-ArduCopter.cpp
该文件是APM的主文件. #define SCHED_TASK(func, rate_hz, max_time_micros) SCHED_TASK_CLASS(Copter, &copter ...