aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--efi/efi.h15
-rw-r--r--efi/vesa.c4
2 files changed, 16 insertions, 3 deletions
diff --git a/efi/efi.h b/efi/efi.h
index 6472d6ab..c5bd7771 100644
--- a/efi/efi.h
+++ b/efi/efi.h
@@ -4,6 +4,21 @@
#include <core.h>
#include <sys/types.h> /* needed for off_t */
//#include <syslinux/version.h> /* avoid redefinition of __STDC_VERSION__ */
+
+/*
+ * gnu-efi >= 3.0s enables GNU_EFI_USE_MS_ABI by default, which means
+ * that we must also enable it if supported by the compiler. Note that
+ * failing to enable GNU_EFI_USE_MS_ABI if gnu-efi was compiled with
+ * it on will result in undefined references to uefi_call_wrapper().
+ *
+ * The reason we don't attempt to check the version of gnu-efi we're
+ * building against is because there's no harm in turning it on for
+ * older versions - it will just be ignored.
+ */
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
+ #define GNU_EFI_USE_MS_ABI 1
+#endif
+
#include <efi.h>
#include <efilib.h>
#include <efistdarg.h>
diff --git a/efi/vesa.c b/efi/vesa.c
index e3e9e0f7..d259f60a 100644
--- a/efi/vesa.c
+++ b/efi/vesa.c
@@ -33,9 +33,7 @@
#include <sys/fpu.h>
#include <syslinux/video.h>
#include <dprintf.h>
-#include <efi.h>
-#include <efilib.h>
-#include <efistdarg.h>
+#include "efi.h"
/* We use cp865_8x16.psf as the standard font for EFI implementation
* the header file below contains raw data parsed from cp865_8x16.psf
*/