meson: use an array option for efi-cc
authorMike Gilbert <floppym@gentoo.org>
Sun, 30 Sep 2018 19:41:41 +0000 (15:41 -0400)
committerFelipe Sateler <fsateler@debian.org>
Thu, 6 Dec 2018 00:03:34 +0000 (00:03 +0000)
Fixes: https://github.com/systemd/systemd/issues/10211
(cherry picked from commit 595343fb4c99c2679d347ef7c19debfbfed6342e)

Gbp-Pq: Name meson-use-an-array-option-for-efi-cc.patch

meson_options.txt
src/boot/efi/meson.build

index 8f9cfd979270c4a4eb0733bafa768effd860352c..1b78cf0388669befca52b06d14124c0b89c96eb9 100644 (file)
@@ -278,7 +278,7 @@ option('dbus', type : 'combo', choices : ['auto', 'true', 'false'],
 
 option('gnu-efi', type : 'combo', choices : ['auto', 'true', 'false'],
        description : 'gnu-efi support for sd-boot')
-option('efi-cc', type : 'string',
+option('efi-cc', type : 'array',
        description : 'the compiler to use for EFI modules')
 option('efi-ld', type : 'string',
        description : 'the linker to use for EFI modules')
index db47bb7c5dd0a4320bec4229bf1ac50bcf1d4494..04ca02f164cbbe25f27b3a7f7d788a6a42894c0b 100644 (file)
@@ -34,8 +34,8 @@ stub_sources = '''
 
 if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
         efi_cc = get_option('efi-cc')
-        if efi_cc == ''
-                efi_cc = ' '.join(cc.cmd_array())
+        if efi_cc.length() == 0
+                efi_cc = cc.cmd_array()
         endif
         efi_ld = get_option('efi-ld')
         if efi_ld == ''
@@ -57,7 +57,7 @@ if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
 
         efi_libdir = get_option('efi-libdir')
         if efi_libdir == ''
-                cmd = 'cd /usr/lib/$(@0@ -print-multi-os-directory) && pwd'.format(efi_cc)
+                cmd = 'cd /usr/lib/$(@0@ -print-multi-os-directory) && pwd'.format(' '.join(efi_cc))
                 ret = run_command('sh', '-c', cmd)
                 if ret.returncode() == 0
                         efi_libdir = ret.stdout().strip()
@@ -153,7 +153,7 @@ if have_gnu_efi
                 o_file = custom_target(file + '.o',
                                        input : file,
                                        output : file + '.o',
-                                       command : [efi_cc, '-c', '@INPUT@', '-o', '@OUTPUT@']
+                                       command : efi_cc + ['-c', '@INPUT@', '-o', '@OUTPUT@']
                                                  + compile_args,
                                        depend_files : efi_headers)
                 if (common_sources + systemd_boot_sources).contains(file)
@@ -164,7 +164,7 @@ if have_gnu_efi
                 endif
         endforeach
 
-        libgcc_file_name = run_command(efi_cc, '-print-libgcc-file-name').stdout().strip()
+        libgcc_file_name = run_command(efi_cc + ['-print-libgcc-file-name']).stdout().strip()
         systemd_boot_efi_name = 'systemd-boot@0@.efi'.format(EFI_MACHINE_TYPE_NAME)
         stub_efi_name = 'linux@0@.efi.stub'.format(EFI_MACHINE_TYPE_NAME)
         no_undefined_symbols = find_program('no-undefined-symbols.sh')