blob: 6fd2eca941e9733854803841b259e1eb591ac333 [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):
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000023 FWUPD_URL = "https://github.com/fwupd/fwupd-efi"
Andrew Geissler595f6302022-01-24 19:11:47 +000024
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
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000035@@ -187,7 +187,7 @@ o_file5 = custom_target('fwup-sbat.o',
Andrew Geissler595f6302022-01-24 19:11:47 +000036 command : [
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000037 generate_sbat,
Andrew Geissler595f6302022-01-24 19:11:47 +000038 '@OUTPUT@',
39- '--cc', efi_cc,
40+ '--cc', ' '.join(efi_cc),
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000041 '--objcopy', objcopy,
Andrew Geissler595f6302022-01-24 19:11:47 +000042 '--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')
Andrew Geissler595f6302022-01-24 19:11:47 +000052 option('efi-libdir', type : 'string', description : 'path to the EFI lib directory')
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000053 option('efi-ldsdir', type : 'string', description : 'path to the EFI lds directory')