]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Share more C flags
authorJan Janssen <medhefgo@web.de>
Fri, 10 Mar 2023 08:57:50 +0000 (09:57 +0100)
committerJan Janssen <medhefgo@web.de>
Fri, 17 Mar 2023 09:39:32 +0000 (10:39 +0100)
meson.build
src/boot/efi/efi-string.c
src/boot/efi/log.c
src/boot/efi/util.h
src/boot/efi/vmm.c

index b575b04dc6ab07257dd4dc6ae5479f3197f2d40b..6770deed4ff11a41d4e8cc68386d802a50b982eb 100644 (file)
@@ -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',
index a94e2e4c17bb0238b8f744be238f33c42bdd815c..d199410881b0c29060a6384cc29173da238337ed 100644 (file)
@@ -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;
 
index 879ed766e3be506e5da18564e42fbcd89b95652a..82307516dcfa9aa6d1e2f495db3cbe1a44514909 100644 (file)
@@ -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
index 5b4f47a1aef494b478636ac77574fb1c38b713e5..c321062996c5268658badcddbbdd684af4705253 100644 (file)
@@ -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;                                       \
index 60e8a97c43a14a8daea27a4101b8b67aa718a459..951b4e37663196f91097d827acecedc14fdd66d8 100644 (file)
@@ -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 } }