简体   繁体   English

GNU ARM Embedded Toolchain 和普通 gcc/g++ 与裸机 ARM 架构之间的区别

[英]Difference between the GNU ARM Embedded Toolchain and normal gcc/g++ with bare metal ARM architecture

First time poster long time lurker.第一次海报长期潜伏。

So I have been using the GNU ARM Embedded Toolchain for a while and compiling my embedded C++ code using arm-none-eabi-g++, because it is what we did in my embedded systems university courses.所以我一直在使用GNU ARM 嵌入式工具链并使用 arm-none-eabi-g++ 编译我的嵌入式 C++ 代码,因为这是我们在嵌入式系统大学课程中所做的。 For my computer science courses we used just g++ to compile C++ code.对于我的计算机科学课程,我们仅使用 g++ 来编译 C++ 代码。 I have been poking around the GCC manual and found that there are ARM architecture compilation options for GCC.我一直在寻找GCC手册,发现GCC有ARM架构编译选项 My question is what is the difference between using arm-none-eabi-g++ binary provided by ARM and g++ with the -mcpu=cortex-m4 -march=armv7 compile option for cross-compiling?我的问题是使用 ARM 和g++提供的arm-none-eabi-g++二进制文件与-mcpu=cortex-m4 -march=armv7编译选项进行交叉编译有什么区别? It appears you can cross-compile for ARM using gcc (gcc that comes with Ubuntu) and I have been hard pressed so far to find a straight answer to this question on the internet.看来您可以使用 gcc(Ubuntu 附带的 gcc)交叉编译 ARM,到目前为止,我一直很难在互联网上找到这个问题的直接答案。

I think I figured it out.我想我明白了。 So using GCC you can build a cross compiler and an associated toolchain.因此,使用 GCC 您可以构建交叉编译器和关联的工具链。 ARM built their own cross compiler and put it up for people to use as the "Official GNU ARM Embedded Toolchain". ARM 构建了自己的交叉编译器,并将其作为“官方 GNU ARM 嵌入式工具链”供人们使用。 It's basically a meta "I used the compiler to build the compiler problem".它基本上是一个元“我使用编译器来构建编译器问题”。 The options -mcpu=cortex-m4 -march=armv7 I was seeing was for targeting architectures when building GCC, not to be when compiling.我看到的选项-mcpu=cortex-m4 -march=armv7是在构建 GCC 时针对架构,而不是在编译时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM