Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross compilation: special cross compiler or just gcc with option -march?

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?

like image 272
stackoverflower Avatar asked Nov 07 '22 01:11

stackoverflower


1 Answers

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
like image 153
abhiTronix Avatar answered Nov 13 '22 17:11

abhiTronix