Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | Change the efi-cc argument to take an array, so that we can pass compiler flags |
| 2 | such as --sysroot. |
| 3 | |
| 4 | In the long term changing the fwupd-efi build to use the standard Meson |
| 5 | CC/LD/etc would be the preferred fix. |
| 6 | |
| 7 | Upstream-Status: Inappropriate [better fix in progress] |
| 8 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
| 9 | |
| 10 | diff --git a/efi/generate_sbat.py b/efi/generate_sbat.py |
| 11 | index 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 |
| 31 | diff --git a/efi/meson.build b/efi/meson.build |
| 32 | index 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(), |
| 44 | diff --git a/meson_options.txt b/meson_options.txt |
| 45 | index 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') |