diff options
author | Dan Streetman <ddstreet@canonical.com> | 2019-08-13 06:45:04 -0400 |
---|---|---|
committer | Dan Streetman <ddstreet@canonical.com> | 2019-08-15 16:36:10 -0400 |
commit | 82a0fb328e6fd0dbe14223bd290fc88d13fd5a4d (patch) | |
tree | 9664d5e669b43fc4c2844868721e8280817f4498 /src/boot/efi/shim.c | |
parent | 9841802955e043733a31a68120c40e8c15804fa6 (diff) | |
download | systemd-82a0fb328e6fd0dbe14223bd290fc88d13fd5a4d.tar.gz |
src/boot/efi/shim: elide __attribute__((sysv_abi)) on non-intel archs
This attribute is x86-only, so when building on non-intel archs it
generates a compiler warning. When building with -Werror this turns
into an error, so only include the attribute on intel archs.
Diffstat (limited to 'src/boot/efi/shim.c')
-rw-r--r-- | src/boot/efi/shim.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/boot/efi/shim.c b/src/boot/efi/shim.c index 9e072d294f..8db27547cc 100644 --- a/src/boot/efi/shim.c +++ b/src/boot/efi/shim.c @@ -14,14 +14,20 @@ #include "util.h" #include "shim.h" +#if defined(__x86_64__) || defined(__i386__) +#define __sysv_abi__ __attribute__((sysv_abi)) +#else +#define __sysv_abi__ +#endif + struct ShimLock { - EFI_STATUS __attribute__((sysv_abi)) (*shim_verify) (VOID *buffer, UINT32 size); + EFI_STATUS __sysv_abi__ (*shim_verify) (VOID *buffer, UINT32 size); /* context is actually a struct for the PE header, but it isn't needed so void is sufficient just do define the interface * see shim.c/shim.h and PeHeader.h in the github shim repo */ - EFI_STATUS __attribute__((sysv_abi)) (*generate_hash) (VOID *data, UINT32 datasize, VOID *context, UINT8 *sha256hash, UINT8 *sha1hash); + EFI_STATUS __sysv_abi__ (*generate_hash) (VOID *data, UINT32 datasize, VOID *context, UINT8 *sha256hash, UINT8 *sha1hash); - EFI_STATUS __attribute__((sysv_abi)) (*read_header) (VOID *data, UINT32 datasize, VOID *context); + EFI_STATUS __sysv_abi__ (*read_header) (VOID *data, UINT32 datasize, VOID *context); }; static const EFI_GUID simple_fs_guid = SIMPLE_FILE_SYSTEM_PROTOCOL; |