]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #13317 from ddstreet/werror
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 16 Aug 2019 08:19:09 +0000 (10:19 +0200)
committerGitHub <noreply@github.com>
Fri, 16 Aug 2019 08:19:09 +0000 (10:19 +0200)
Fix build warnings, so Ubuntu CI can pass --werror to meson

src/boot/efi/linux.c
src/boot/efi/meson.build
src/boot/efi/shim.c

index 5b623f4b71e20b8ad4df82be24a3c0bdcf77a2b4..00a3551e09a1f9256e5615bc935bc0de945dfb64 100644 (file)
@@ -6,24 +6,24 @@
 #include "linux.h"
 #include "util.h"
 
-#ifdef __x86_64__
-typedef VOID(*handover_f)(VOID *image, EFI_SYSTEM_TABLE *table, struct boot_params *params);
-static VOID linux_efi_handover(EFI_HANDLE image, struct boot_params *params) {
-        handover_f handover;
-
-        asm volatile ("cli");
-        handover = (handover_f)((UINTN)params->hdr.code32_start + 512 + params->hdr.handover_offset);
-        handover(image, ST, params);
-}
+#ifdef __i386__
+#define __regparm0__ __attribute__((regparm(0)))
 #else
-typedef VOID(*handover_f)(VOID *image, EFI_SYSTEM_TABLE *table, struct boot_params *params) __attribute__((regparm(0)));
+#define __regparm0__
+#endif
+
+typedef VOID(*handover_f)(VOID *image, EFI_SYSTEM_TABLE *table, struct boot_params *params) __regparm0__;
 static VOID linux_efi_handover(EFI_HANDLE image, struct boot_params *params) {
         handover_f handover;
+        UINTN start = (UINTN)params->hdr.code32_start;
 
-        handover = (handover_f)((UINTN)params->hdr.code32_start + params->hdr.handover_offset);
+#ifdef __x86_64__
+        asm volatile ("cli");
+        start += 512;
+#endif
+        handover = (handover_f)(start + params->hdr.handover_offset);
         handover(image, ST, params);
 }
-#endif
 
 EFI_STATUS linux_exec(EFI_HANDLE *image,
                       CHAR8 *cmdline, UINTN cmdline_len,
index dfec97028b452487277ba5dbc49488cc2ab71168..b8fd5105d0437571b3391f718f8efbae6023bf4d 100644 (file)
@@ -135,6 +135,9 @@ if have_gnu_efi
                 compile_args += ['-mno-sse',
                                  '-mno-mmx']
         endif
+        if get_option('werror') == true
+                compile_args += ['-Werror']
+        endif
 
         efi_ldflags = ['-T',
                        join_paths(efi_ldsdir, arch_lds),
index 9e072d294f9764dfa2e5bc7b03fb8fae0099b417..8db27547cca3f24ee88291d95a0fd689b4aae8b3 100644 (file)
 #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;