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). 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 cortex-m设备裸机代码的经验,以及Linux内核,uBoot和Beaglebone Black(BBB)的应用程序(更多特色ARM与MMU,生活在摇滚之下)。因为对我来说,cortex-m代码应该使用arm-none-eabi-gcc编译(因为没有操作系统),BBB的应用程序代码应该用arm-linux-gnueabi-gcc编译(因为那里)是一个操作系统,可以进行系统调用,程序加载器和可以使用的共享对象。
What I don't understand is why uBoot and the kernel also should be compiled with arm-linux-gnueabi-gcc. In my mind, uBoot at least, is a bare metal program with no fancy OS to account for. This has been bugging me for sometime, but I can't find an answer. Is there anyone out there that can enlighten me?
我不明白为什么uBoot和内核也应该用arm-linux-gnueabi-gcc编译。在我看来,uBoot至少是一个裸机程序,没有花哨的操作系统来解释。这一直困扰着我,但我找不到答案。那里有没有人可以开导我?
1 个解决方案
#1
0
U-Boot was designed to mirror the Linux design philosophy as much as possible. It uses the same configuration system, general directory structure, etc. It shares some APIs with Linux - see the include/linux directory. 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.
U-Boot旨在尽可能地反映Linux设计理念。它使用相同的配置系统,通用目录结构等。它与Linux共享一些API - 请参阅include / linux目录。正如上面提到的那样,ABI兼容性在这一点上并不重要,但是使用Linux编译器在U-Boot上并不合乎逻辑。
#1
0
U-Boot was designed to mirror the Linux design philosophy as much as possible. It uses the same configuration system, general directory structure, etc. It shares some APIs with Linux - see the include/linux directory. 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.
U-Boot旨在尽可能地反映Linux设计理念。它使用相同的配置系统,通用目录结构等。它与Linux共享一些API - 请参阅include / linux目录。正如上面提到的那样,ABI兼容性在这一点上并不重要,但是使用Linux编译器在U-Boot上并不合乎逻辑。