在 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. 的错误自省...的更多相关文章

  1. coreseek 在gcc 4.9+ 上编译不通过 [sphinxexpr.o] Error 1 错误解决方案

    这几天玩hhvm,把gcc环境都装到4.9了,然后编译coreseek的时候就出问题,google一大圈,貌似捕风捉影看到一些信息说是gcc4.7+的c++作用域必须用this->去引用,这里整 ...

  2. arm 交叉编译时 gcc 的 Options

    https://sourceware.org/binutils/docs/as/ARM-Options.html https://gcc.gnu.org/onlinedocs/gcc-4.5.3/gc ...

  3. Linux学习笔记2_mysql安装

    查看文件内容的命令有很多:cat, tac, more, less, head, tail, nl. cat由第一行开始显示档案内容:tac从最后一行开始显示,可以看出tac是cat的倒着写:more ...

  4. Linux之mysql安装

    查看文件内容的命令有很多:cat, tac, more, less, head, tail, nl. cat由第一行开始显示档案内容:tac从最后一行开始显示,可以看出tac是cat的倒着写:more ...

  5. CAFFE在win10+VS2017下的安装笔记

    老版的caffe在BVLC的github上已经找不到,如果要想下载老版caffe可以下载微软的caffe版本:https://github.com/Microsoft/caffe 网上的大多安装caf ...

  6. Mingw编译DLib

    Mingw编译DLib 因为机器上安装了qt-opensource-windows-x86-mingw530-5.8.0,所以准备使用其自带的mingw530来编译DLib使用. 因为DLib使用CM ...

  7. cmake的一个编译报错

    在一台新搭建的服务器上执行cmake的时候,报了如下错误: $ cmake ./ -- The C compiler identification is unknown -- The CXX comp ...

  8. Andriod学习笔记3:Mac 平台下搭建 CLion 集成开发环境

    1. 安装Xcode 通过App store或者下载安装Xcode. 安装完成之后,最好启动一下Xcode,否则可能会报"Error:The C compiler "/usr/bi ...

  9. 编译哈工大语言技术平台云LTP(C++)源码及LTP4J(Java)源码

    转自:编译哈工大语言技术平台云LTP(C++)源码及LTP4J(Java)源码 JDK:java version “1.8.0_31”Java(TM) SE Runtime Environment ( ...

随机推荐

  1. PHPSTORM设置新建PHP文件头部注释

    1.选择 File|setting 2.在Editor|File and Code Templates,见下图标记更改即可

  2. mysql 性能优化方向

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...

  3. VC++/MFC 最常用宏和指令

    1.#include指令  包含指定的文件,最基本的最熟悉的指令,编程中不得不用,包含库文件用双尖括号,包含自定义头文件用双引号. 2.#define指令   预定义,通常用它来定义常量(包括无参量与 ...

  4. Latex中插入C语言代码

    Latex是一个文本排版的语言,能排版出各种我们想要的效果.而且用代码排版的优点是易于修改板式,因此在文本内容的排版时,Latex应用十分广泛. 当我们需要在Latex中插入代码时,就需要用到 \us ...

  5. bat命令总结

    1.复制文件 copy cd.dll %windir%\system32 2.复制文件夹 /s 复制目录和子目录,除了空的. /e复制目录和子目录,包括空的. xcopy %dir%\template ...

  6. $stateProvider

    在你的应用中大多数状态都有与其相关联的 url,路由控制不是设计完成 state 之后的事后想法,而是开始开发时就应该考虑的问题. 这里是如何设置一个基本url. 12345 $stateProvid ...

  7. IBM Z上邮件服务器的配置相关内容

    https://www.ibm.com/support/knowledgecenter/SSLTBW_1.13.0/com.ibm.zos.r13.halz002/sen.htm#sen 每次搜太费劲 ...

  8. C#运算符号

    double x=5.1e3;// 5.1乘以10 的3次方. x就是 5100 //注 :  5.1e+3=5.1e3=5.1e03=5.1e+03 double y=5.1e-3;// 5.1乘以 ...

  9. string,stringbuilder,stringbuffer用法

    总结:1.如果要操作少量的数据用 = String   ==================================>字符串常量2.单线程操作字符串缓冲区 下操作大量数据 = Strin ...

  10. CSS中的rem的换算

    rem好像也是一个相对大小的值,它是相对于根元素<html>,比如假设,我们设置html的字体大小的值为 html{font-size: 87.5%;}(也就是14px,这是twentyt ...