aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch
blob: ac345f275206c5138341ff484d338b1c6865b6cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Change the efi-cc argument to take an array, so that we can pass compiler flags
such as --sysroot.

In the long term changing the fwupd-efi build to use the standard Meson
CC/LD/etc would be the preferred fix.

Upstream-Status: Inappropriate [better fix in progress]
Signed-off-by: Ross Burton <ross.burton@arm.com>

diff --git a/efi/generate_sbat.py b/efi/generate_sbat.py
index e42b365..4831a48 100755
--- a/efi/generate_sbat.py
+++ b/efi/generate_sbat.py
@@ -7,6 +7,7 @@
 #
 # pylint: disable=missing-docstring, invalid-name
 
+import shlex
 import subprocess
 import sys
 import argparse
@@ -19,7 +20,7 @@ def _generate_sbat(args):
     FWUPD_URL = "https://github.com/fwupd/fwupd"
 
     subprocess.run(
-        [args.cc, "-x", "c", "-c", "-o", args.outfile, "/dev/null"], check=True
+        shlex.split(args.cc) + ["-x", "c", "-c", "-o", args.outfile, "/dev/null"], check=True
     )
 
     # not specified
diff --git a/efi/meson.build b/efi/meson.build
index 68ea4aa..dcf0d43 100644
--- a/efi/meson.build
+++ b/efi/meson.build
@@ -184,7 +184,7 @@ o_file5 = custom_target('fwup-sbat.o',
                         command : [
                           join_paths(meson.current_source_dir(), 'generate_sbat.py'),
                           '@OUTPUT@',
-                          '--cc', efi_cc,
+                          '--cc', ' '.join(efi_cc),
                           '--objcopy', efi_objcopy,
                           '--project-name', meson.project_name(),
                           '--project-version', meson.project_version(),
diff --git a/meson_options.txt b/meson_options.txt
index d869cd2..17ef7fb 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,4 @@
-option('efi-cc', type : 'string', value : 'gcc', description : 'the compiler to use for EFI modules')
+option('efi-cc', type : 'array', value : ['gcc'], description : 'the compiler to use for EFI modules')
 option('efi-ld', type : 'string', value : 'ld', description : 'the linker to use for EFI modules')
 option('efi-objcopy', type : 'string', value : 'objcopy', description : 'the objcopy utility to use for EFI modules')
 option('efi-libdir', type : 'string', description : 'path to the EFI lib directory')