From 01d81c126b1383d8ab858f43395b304e178feed1 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Thu, 16 Jun 2022 21:53:30 +0200 Subject: [PATCH] meson: Reorder cflags for sd-boot Currently, -Wall and -Wextra override previously passed flags like -Wno-unused-parameter. This reorders them to be passed before any optional flags. -Wsign-compare is part of -Wextra and therefore dropped. -nostdlib is a link-stage flag and dropped as it is already part of efi_ldflags. --- src/boot/efi/meson.build | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index 1e42f8b08e..52e2a71a7c 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -174,32 +174,30 @@ efi_config_h = configure_file( output : 'efi_config.h', configuration : efi_conf) -efi_cflags = cc.get_supported_arguments( +efi_cflags = [ + '-DGNU_EFI_USE_MS_ABI', + '-DSD_BOOT', + '-ffreestanding', + '-fshort-wchar', + '-fvisibility=hidden', + '-I', fundamental_path, + '-I', meson.current_source_dir(), + '-include', efi_config_h, + '-include', version_h, + '-isystem', efi_incdir / efi_arch[1], + '-isystem', efi_incdir, + '-std=gnu11', + '-Wall', + '-Wextra', +] + cc.get_supported_arguments( basic_disabled_warnings + possible_common_cc_flags + [ '-fno-stack-protector', '-fno-strict-aliasing', '-fpic', '-fwide-exec-charset=UCS2', - '-Wall', - '-Wextra', - '-Wsign-compare', ] -) + [ - '-nostdlib', - '-std=gnu11', - '-ffreestanding', - '-fshort-wchar', - '-fvisibility=hidden', - '-isystem', efi_incdir, - '-isystem', efi_incdir / efi_arch[1], - '-I', fundamental_path, - '-I', meson.current_source_dir(), - '-DSD_BOOT', - '-DGNU_EFI_USE_MS_ABI', - '-include', efi_config_h, - '-include', version_h, -] +) efi_cflags += cc.get_supported_arguments({ 'ia32': ['-mno-sse', '-mno-mmx'],