简体   繁体   English

为什么在编译Linux内核和uBoot时使用arm-linux-gnueabi-gcc而不是arm-none-eabi-gcc?

[英]Why arm-linux-gnueabi-gcc and not arm-none-eabi-gcc when compiling Linux kernel and uBoot?

I have some experience compiling bare metal code for ARM cortex-m devices as well as the Linux kernal, uBoot, and applications for the Beaglebone Black (BBB) (more featured ARM with MMU, for those living under a rock). 我有一些为ARM cortex-m设备以及Linux内核,uBoot和Beaglebone Black(BBB)的应用程序编写裸机代码的经验(对于生活在岩石下的人来说,ARM的功能更强)。 It makes since to me that the cortex-m code should be compiled using arm-none-eabi-gcc (as there is no OS) and the application code for the BBB should be compiled with arm-linux-gnueabi-gcc (as there is an OS, for which system calls can be made and program loaders and shared objects that can be utilized). 因为对我来说,应该使用arm-none-eabi-gcc(因为没有操作系统)来编译cortex-m代码,并且应该使用arm-linux-gnueabi-gcc(因为那里有代码)来编译BBB的应用程序代码是一个OS,可以对其进行系统调用以及可以使用程序加载器和共享库。

What I don't understand is why uBoot and the kernel also should be compiled with arm-linux-gnueabi-gcc. 我不明白的是为什么uBoot和内核也应该使用arm-linux-gnueabi-gcc进行编译。 In my mind, uBoot at least, is a bare metal program with no fancy OS to account for. 在我看来,至少uBoot是一个无人问津的裸机程序。 This has been bugging me for sometime, but I can't find an answer. 这一直困扰着我一段时间,但是我找不到答案。 Is there anyone out there that can enlighten me? 有没有人可以启发我?

U-Boot was designed to mirror the Linux design philosophy as much as possible. U-Boot旨在尽可能地反映Linux设计理念。 It uses the same configuration system, general directory structure, etc. It shares some APIs with Linux - see the include/linux directory. 它使用相同的配置系统,常规目录结构等。它与Linux共享一些API-请参见include / linux目录。 As the comments above mention, the ABI compatibility doesn't matter at this point, but using a Linux compiler isn't philosophically inappropriate for U-Boot. 正如上面的评论所提到的,ABI兼容性在这一点上并不重要,但是从理论上讲,使用Linux编译器对于U-Boot来说并不适合。

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

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