On 9 August 2016 at 12:02, Leif Lindholm <[email protected]> wrote: > On Tue, Aug 09, 2016 at 11:02:55AM +0200, Michael Zimmermann wrote: >> > I use both, and never notice any difference. The primary differences >> > are newlib vs glibc, and in some cases, whether symbols are decorated >> > with a leading _ >> > The actual code generation is more dependent on the default target >> > (i.e., -march/-mthumb for ARM) than bare-metal/hosted. >> >> > I only ever use the native >> > compiler under Linux, or one of the linaro "-linux-" flavours if >> > cross-compiling. >> >> I think that works because edk2 excludes all toolchain libs with -nostdlib >> and fno-builtin. >> I know from other bootloader projects like LK(LittleKernel) which link >> against libgcc that compiling with anything but bare-metal toolchains makes >> the resulting binary un-bootable. > > Sure, but those are effectively bugs in the corresponding projects. > > If they require special options/libraries they should (where possible) > manually configure this, or (where not) exit with an error. >
The problem with libgcc on AArch64 is that it is usually compiled with the small code model, requiring 4 KB section alignment (up until recently at least), and without -mstrict-align. In general, projects that contain C code that should be able to execute with the MMU off should steer clear of toolchain supplied target libraries. -- Ard. _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

