blob: ac345f275206c5138341ff484d338b1c6865b6cb [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001Change the efi-cc argument to take an array, so that we can pass compiler flags
2such as --sysroot.
3
4In the long term changing the fwupd-efi build to use the standard Meson
5CC/LD/etc would be the preferred fix.
6
7Upstream-Status: Inappropriate [better fix in progress]
8Signed-off-by: Ross Burton <ross.burton@arm.com>
9
10diff --git a/efi/generate_sbat.py b/efi/generate_sbat.py
11index e42b365..4831a48 100755
12--- a/efi/generate_sbat.py
13+++ b/efi/generate_sbat.py
14@@ -7,6 +7,7 @@
15 #
16 # pylint: disable=missing-docstring, invalid-name
17
18+import shlex
19 import subprocess
20 import sys
21 import argparse
22@@ -19,7 +20,7 @@ def _generate_sbat(args):
23 FWUPD_URL = "https://github.com/fwupd/fwupd"
24
25 subprocess.run(
26- [args.cc, "-x", "c", "-c", "-o", args.outfile, "/dev/null"], check=True
27+ shlex.split(args.cc) + ["-x", "c", "-c", "-o", args.outfile, "/dev/null"], check=True
28 )
29
30 # not specified
31diff --git a/efi/meson.build b/efi/meson.build
32index 68ea4aa..dcf0d43 100644
33--- a/efi/meson.build
34+++ b/efi/meson.build
35@@ -184,7 +184,7 @@ o_file5 = custom_target('fwup-sbat.o',
36 command : [
37 join_paths(meson.current_source_dir(), 'generate_sbat.py'),
38 '@OUTPUT@',
39- '--cc', efi_cc,
40+ '--cc', ' '.join(efi_cc),
41 '--objcopy', efi_objcopy,
42 '--project-name', meson.project_name(),
43 '--project-version', meson.project_version(),
44diff --git a/meson_options.txt b/meson_options.txt
45index d869cd2..17ef7fb 100644
46--- a/meson_options.txt
47+++ b/meson_options.txt
48@@ -1,4 +1,4 @@
49-option('efi-cc', type : 'string', value : 'gcc', description : 'the compiler to use for EFI modules')
50+option('efi-cc', type : 'array', value : ['gcc'], description : 'the compiler to use for EFI modules')
51 option('efi-ld', type : 'string', value : 'ld', description : 'the linker to use for EFI modules')
52 option('efi-objcopy', type : 'string', value : 'objcopy', description : 'the objcopy utility to use for EFI modules')
53 option('efi-libdir', type : 'string', description : 'path to the EFI lib directory')