From: Simon Glass Date: Mon, 18 Jun 2018 08:08:19 -0600 Subject: [U-Boot] [PATCH v8 14/30] efi: Don't build sandbox with __attribute__((ms_abi)) In-Reply-To: <20180618140835.195901-1-sjg@chromium.org> References: <20180618140835.195901-1-sjg@chromium.org> Message-ID: <20180618140835.195901-15-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de There appears to be a bug [1] in gcc when using varargs with this attribute. Disable it for sandbox so that functions which use that can work correctly, such as install_multiple_protocol_interfaces(). [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70955 Signed-off-by: Simon Glass --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None include/efi.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/include/efi.h b/include/efi.h index e30a3c51c6..930ea74abe 100644 --- a/include/efi.h +++ b/include/efi.h @@ -19,11 +19,22 @@ #include #include -#if CONFIG_EFI_STUB_64BIT || (!defined(CONFIG_EFI_STUB) && defined(__x86_64__)) -/* EFI uses the Microsoft ABI which is not the default for GCC */ -#define EFIAPI __attribute__((ms_abi)) +#ifdef CONFIG_SANDBOX +/* + * Avoid using EFIAPI due to this bug: + * + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70955 + * + * This affects efi_install_multiple_protocol_interfaces(). + */ +# define EFIAPI #else -#define EFIAPI asmlinkage +# if CONFIG_EFI_STUB_64BIT || (!defined(CONFIG_EFI_STUB) && defined(__x86_64__)) +/* EFI uses the Microsoft ABI which is not the default for GCC */ +# define EFIAPI __attribute__((ms_abi)) +# else +# define EFIAPI asmlinkage +# endif #endif struct efi_device_path; -- 2.18.0.rc1.244.gcf134e6275-goog