交叉编译:特殊的交叉编译器还是带有选项-march的gcc? [英] Cross compilation: special cross compiler or just gcc with option -march?
问题描述
我需要在Linux机器上为Raspberry PI 3+编译程序,并且代码必须符合c ++ 17标准.官方工具链已过时,缺少c ++ 17编译选项.我现在可以看到两个解决方案:
1)gcc有一个选项-march,在这里进行了描述: https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
2)按照此处的建议安装arm-linux-gbueabi-gcc软件包:解决方案
如果您想要Raspberry Pi的完整Cross Compiler c ++ 17标准,可以尝试使用我最新的预编译/预编译的开源GCC工具链Raspberry Pi以及来自此 Github存储库 的充分说明的文件:>
目前可用的GCC版本如下:
- GCC 6.3.0
- GCC 7.4.0
- GCC 8.2.0
- GCC 8.3.0
并且,受支持的环境:
- 交叉编译器:当前支持所有Linux发行版(x32/x64).
- 本地编译器:支持带有Raspbian OS的所有Raspberry Pi版本/模型.其他操作系统可能会/可能不会.
也是当前支持的语言:
- C ++
- C
- Fortran
I need to compile a program for Raspberry PI 3+ on Linux machine, and code must be compliant with c++17 standard. Official toolchain is outdated and lack c++17 compilation option. Two solutions that I can see right now are:
1) gcc has an option -march, which described here: https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
2) Installing arm-linux-gbueabi-gcc package, as proposed here: Cross-compiling for Raspberry pi with modern gcc
What is the difference between two options? Is there some other possibilities that will work?
If you want full Cross Compiler c++17 standard for your Raspberry Pi, you can try my Latest Pre-Built/Pre-Compiled Open-Sourced GCC Toolchains for Raspberry Pi along with well-documented instructions from this Github Repo:
The GCC versions available as of now are as follows:
- GCC 6.3.0
- GCC 7.4.0
- GCC 8.2.0
- GCC 8.3.0
And, the Supported Environments:
- Cross-Compiler: All Linux Distros (x32/x64) are currently supported.
- Native-Compiler: All Raspberry Pi version/model with Raspbian OS is supported. Other OS may/may-not work.
also the currently Supported Languages are:
- C++
- C
- Fortran
这篇关于交叉编译:特殊的交叉编译器还是带有选项-march的gcc?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!