Why arm-linux-gnueabi-gcc and not arm-none-eabi-gcc when compiling Linux kernel and uBoot?
Asked Answered
H

1

11

I have some experience compiling bare metal code for ARM cortex-m devices as well as the Linux kernel, uBoot, and applications for the Beaglebone Black (BBB) (more featured ARM with MMU, for those living under a rock). It makes sense 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 can be utilized).

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?

Horntail answered 7/11, 2015 at 18:13 Comment(5)
Where did you learn this "uBoot [sic] and the kernel also should be compiled with arm-linux-gnueabi-gcc"? I've seen U-Boot and the Linux kernel compiled with the same toolchain (e.g. in Buildroot) presumably because of convenience. But I typically use a baremetal toolchain for bootloaders such as U-Boot (i.e. I build two toolchains).Chism
I just assumed from examples such as this. Are you saying that uBoot can actually be compiled with either? What about the kernel?Horntail
When compiling .c into .o, the ABI you choose affects which registers are used for parameters, stack-layout etc. When linking the .o into an executable, the ABI have a default linker script and helper objects. But both the kernel and probably u-boot provides their own linker scripts etc, so the ABI for this step is not so importantLucknow
This question has been answered here : #38957180Sjoberg
@JoshuaDeWeese processors.ti.wiki.com EOL. Link dead. Archive here.Bast
S
-2

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.

Summary answered 16/11, 2017 at 17:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.