1
0
mirror of https://github.com/systemd/systemd synced 2024-07-08 20:15:55 +00:00

meson: Share more C flags

This commit is contained in:
Jan Janssen 2023-03-10 09:57:50 +01:00
parent f64f82aa8d
commit 0b482b37f9
5 changed files with 18 additions and 10 deletions

View 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',

View 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;

View 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

View 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; \

View 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 } }