On 05/16/14 16:59, Nigel Croxon wrote:
> This patch breaks compiling on new GCC.
> https://sourceforge.net/p/gnu-efi/bugs/7/

1. My earlier analysis and patch was wrong, so it's good that Nigel
reverted it.

I had missed the fact that on __GNUC__, "efistdarg.h" includes the
system-wide <stdarg.h>. The open-coded va_*() macros are not used at all.

This does match the non-EFIAPI variadic functions (eg. DbgPrint()), so
gnu-efi is fine, and I was wrong. Sorry about that.

2. The error is in Ludovic's program; I can reproduce it and also fix
it. Quote:

EFI_STATUS
EFIAPI
efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
...

The problem is "EFIAPI". You *must not* add EFIAPI to efi_main() *in
gnu-efi*. The compiling/linking magic that gnu-efi does for applications
automatically takes care of it, and it is thrown off if you specify
EFIAPI manually for efi_main(). Don't do that.

This is in fact documented. See README.gnuefi:

> The GNU EFI build environment allows to write EFI applications as
> described in Intel's EFI documentation, except for two differences:
>
>  - The EFI application's entry point is always called "efi_main".  The
>    declaration of this routine is:
>
>     EFI_STATUS efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab);
>
> [...]

No EFIAPI. If you check the rest of the applications in apps/ -- no
EFIAPI on efi_main(), ever.

After removing EFIAPI from Ludovic's app, it works as expected for me
(invoked from UEFI shell on fresh OVMF).

One strange point is that the D_ERROR output (via DEBUG()) seems to
overwrite the Print(L"c\n") output on the serial console, except when it
happens at the bottom of the screen. Not sure why that happens, but it
doesn't crash.

Laszlo

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to