简体   繁体   English

为 Raspberry Pi 选择交叉编译器

[英]Selecting cross compiler for Raspberry Pi

Looking for cross compiler that could help me build application for Raspberry Pi on my Ubuntu 20.04 machine.寻找可以帮助我在 Ubuntu 20.04 机器上构建 Raspberry Pi 应用程序的交叉编译器。 I found official tools on Github and I suppose that folder arm-bcm2708 contains cross compilers:在 Github 上找到了官方工具,我想文件夹arm-bcm2708包含交叉编译器:

arm-bcm2708hardfp-linux-gnueabi
arm-bcm2708-linux-gnueabi
arm-linux-gnueabihf -> arm-rpi-4.9.3-linux-gnueabihf
arm-rpi-4.9.3-linux-gnueabihf
gcc-linaro-arm-linux-gnueabihf-raspbian
gcc-linaro-arm-linux-gnueabihf-raspbian-x64

I'm confused what directories names is trying to tell me?我很困惑目录名称试图告诉我什么? I know following words:我知道以下单词:

arm - processor type used on Pi
bcm2708 - processor model used on pi
gnueabi - cross-compiler for armel architecture (you can build binary for ARM on PC)
linaro - company that creates multimedia for ARM
4.9.3 - I suppose is GCC compiler version (why it is so old?)

Which of compilers I should use for my Pi3 and Pi4?我应该为我的 Pi3 和 Pi4 使用哪个编译器?

You can use one of the toolchains provided by ARM for your RPI3/4.您可以使用ARM 为您的 RPI3/4 提供的工具链之一。 If you are running a 32 bit Linux on your RPI3/4, use one of the arm-none-linux-gnueabihf toolchains, if use are running a 64 bit Linux on your RPI3/4, use one of the aarch64-none-linux-gnu one.如果您在 RPI3/4 上运行 32 位 Linux,请使用arm-none-linux-gnueabihf工具链之一,如果在 RPI3/4 上运行 64 位 ZEDC9F0A5A5D57797BF68E3736474linux3831Z,请使用其中一个aarch64-none-linux-gnu一。

Both 10.2 and 9.2 versions of the two toolchains are working fine on my own Ubuntu 20.04.1 LTS x86_64 system.这两个工具链的 10.2 和 9.2 版本在我自己的 Ubuntu 20.04.1 LTS x86_64 系统上运行良好。 Of course, you can cross-compile programs with the arm-none-linux-gnueabihf toolchain and run them on the 64 bit Linux running on your RPI3/4 as well.当然,您可以使用arm-none-linux-gnueabihf工具链交叉编译程序,并在 RPI3/4 上运行的 64 位 Linux 上运行它们。

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

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