diff --git a/meson.build b/meson.build index b575b04dc6..6770deed4f 100644 --- a/meson.build +++ b/meson.build @@ -366,6 +366,8 @@ possible_common_cc_flags = [ '-Werror=implicit-int', '-Werror=incompatible-pointer-types', '-Werror=int-conversion', + '-Werror=missing-declarations', + '-Werror=missing-prototypes', '-Werror=overflow', '-Werror=override-init', '-Werror=return-type', @@ -397,6 +399,8 @@ possible_common_cc_flags = [ '-Wno-error=#warnings', # clang '-Wno-string-plus-int', # clang + '-fdiagnostics-show-option', + '-fno-common', '-fstack-protector', '-fstack-protector-strong', '-fstrict-flex-arrays', @@ -460,10 +464,6 @@ if get_option('mode') == 'release' endif possible_cc_flags = [ - '-Werror=missing-declarations', - '-Werror=missing-prototypes', - '-fdiagnostics-show-option', - '-fno-common', '-fno-strict-aliasing', '-fstrict-flex-arrays=1', '-fvisibility=hidden', diff --git a/src/boot/efi/efi-string.c b/src/boot/efi/efi-string.c index a94e2e4c17..d199410881 100644 --- a/src/boot/efi/efi-string.c +++ b/src/boot/efi/efi-string.c @@ -882,6 +882,10 @@ char16_t *xvasprintf_status(EFI_STATUS status, const char *format, va_list ap) { # undef memcmp # undef memcpy # undef memset +_used_ void *memchr(const void *p, int c, size_t n); +_used_ int memcmp(const void *p1, const void *p2, size_t n); +_used_ void *memcpy(void * restrict dest, const void * restrict src, size_t n); +_used_ void *memset(void *p, int c, size_t n); #else /* And for userspace unit testing we need to give them an efi_ prefix. */ # define memchr efi_memchr @@ -890,7 +894,7 @@ char16_t *xvasprintf_status(EFI_STATUS status, const char *format, va_list ap) { # define memset efi_memset #endif -_used_ void *memchr(const void *p, int c, size_t n) { +void *memchr(const void *p, int c, size_t n) { if (!p || n == 0) return NULL; @@ -902,7 +906,7 @@ _used_ void *memchr(const void *p, int c, size_t n) { return NULL; } -_used_ int memcmp(const void *p1, const void *p2, size_t n) { +int memcmp(const void *p1, const void *p2, size_t n) { const uint8_t *up1 = p1, *up2 = p2; int r; @@ -922,7 +926,7 @@ _used_ int memcmp(const void *p1, const void *p2, size_t n) { return 0; } -_used_ void *memcpy(void * restrict dest, const void * restrict src, size_t n) { +void *memcpy(void * restrict dest, const void * restrict src, size_t n) { if (!dest || !src || n == 0) return dest; @@ -949,7 +953,7 @@ _used_ void *memcpy(void * restrict dest, const void * restrict src, size_t n) { return dest; } -_used_ void *memset(void *p, int c, size_t n) { +void *memset(void *p, int c, size_t n) { if (!p || n == 0) return p; diff --git a/src/boot/efi/log.c b/src/boot/efi/log.c index 879ed766e3..82307516dc 100644 --- a/src/boot/efi/log.c +++ b/src/boot/efi/log.c @@ -89,12 +89,14 @@ void abort(void) { #if defined(__ARM_EABI__) /* These override the (weak) div0 handlers from libgcc as they would otherwise call raise() instead. */ +_used_ _noreturn_ int __aeabi_idiv0(int return_value); +_used_ _noreturn_ long long __aeabi_ldiv0(long long return_value); -_used_ _noreturn_ int __aeabi_idiv0(int return_value) { +int __aeabi_idiv0(int return_value) { panic(u"systemd-boot: Division by zero, halting."); } -_used_ _noreturn_ long long __aeabi_ldiv0(long long return_value) { +long long __aeabi_ldiv0(long long return_value) { panic(u"systemd-boot: Division by zero, halting."); } #endif diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h index 5b4f47a1ae..c321062996 100644 --- a/src/boot/efi/util.h +++ b/src/boot/efi/util.h @@ -172,6 +172,7 @@ void hexdump(const char16_t *prefix, const void *data, size_t size); EFI_SYSTEM_TABLE *ST; \ EFI_BOOT_SERVICES *BS; \ EFI_RUNTIME_SERVICES *RT; \ + EFIAPI EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *system_table); \ EFIAPI EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *system_table) { \ ST = system_table; \ BS = system_table->BootServices; \ diff --git a/src/boot/efi/vmm.c b/src/boot/efi/vmm.c index 60e8a97c43..951b4e3766 100644 --- a/src/boot/efi/vmm.c +++ b/src/boot/efi/vmm.c @@ -10,6 +10,7 @@ #include "proto/device-path.h" #include "string-util-fundamental.h" #include "util.h" +#include "vmm.h" #define QEMU_KERNEL_LOADER_FS_MEDIA_GUID \ { 0x1428f772, 0xb64a, 0x441e, { 0xb8, 0xc3, 0x9e, 0xbd, 0xd7, 0xf8, 0x93, 0xc7 } }