From: Jan Janssen Date: Sat, 11 Dec 2021 12:47:21 +0000 (+0100) Subject: meson: Fix gnu-efi detection for clang X-Git-Tag: v250-rc3~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3af5a8c613fb4e6d6f637d244e84e1376b7bd1d3;p=thirdparty%2Fsystemd.git meson: Fix gnu-efi detection for clang The gnu-efi headers emit some warnings in clang when not compiled with -ffreestanding. This is normally not an issue for has_header_symbol() unless meson is run with CFLAGS="-Werror". Note that this differs from the --werror option, which does not get passed to clang. Work around this by adding some compile args to the has_header_symbol() invocation. --- diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index d92fe0e5ec9..66d660aad57 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -33,6 +33,7 @@ if efi_arch.length() == 0 endif if not cc.has_header_symbol('efi.h', 'EFI_IMAGE_MACHINE_X64', + args: ['-nostdlib', '-ffreestanding', '-fshort-wchar'], include_directories: include_directories(efi_incdir, efi_incdir / efi_arch[1])) if get_option('gnu-efi') == 'true'