diff options
| -rw-r--r-- | meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch | 53 | ||||
| -rw-r--r-- | meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb | 34 |
2 files changed, 87 insertions, 0 deletions
diff --git a/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch b/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch new file mode 100644 index 0000000000..ac345f2752 --- /dev/null +++ b/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch | |||
| @@ -0,0 +1,53 @@ | |||
| 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') | ||
diff --git a/meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb b/meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb new file mode 100644 index 0000000000..2165b42293 --- /dev/null +++ b/meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | SUMMARY = "EFI executable for fwupd" | ||
| 2 | LICENSE = "LGPL-2.1+" | ||
| 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" | ||
| 4 | |||
| 5 | SRC_URI = "git://github.com/fwupd/fwupd-efi;protocol=https;branch=main \ | ||
| 6 | file://cc.patch" | ||
| 7 | SRCREV = "fee1b8f6473cb403b8ae7a56961ba0557e3f3efa" | ||
| 8 | S = "${WORKDIR}/git" | ||
| 9 | |||
| 10 | DEPENDS = "gnu-efi" | ||
| 11 | |||
| 12 | COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux" | ||
| 13 | |||
| 14 | inherit meson | ||
| 15 | |||
| 16 | # These should be configured as needed | ||
| 17 | SBAT_DISTRO_ID ?= "${DISTRO}" | ||
| 18 | SBAT_DISTRO_SUMMARY ?= "${DISTRO_NAME}" | ||
| 19 | SBAT_DISTRO_URL ?= "" | ||
| 20 | |||
| 21 | EXTRA_OEMESON += "-Defi-cc="${@meson_array('CC', d)}" \ | ||
| 22 | -Defi-ld='${HOST_PREFIX}ld' \ | ||
| 23 | -Defi-objcopy='${OBJCOPY}' \ | ||
| 24 | -Defi-includedir=${STAGING_INCDIR}/efi \ | ||
| 25 | -Defi-libdir=${STAGING_LIBDIR} \ | ||
| 26 | -Defi_sbat_distro_id='${SBAT_DISTRO_ID}' \ | ||
| 27 | -Defi_sbat_distro_summary='${SBAT_DISTRO_SUMMARY}' \ | ||
| 28 | -Defi_sbat_distro_url='${SBAT_DISTRO_URL}' \ | ||
| 29 | -Defi_sbat_distro_pkgname='${PN}' \ | ||
| 30 | -Defi_sbat_distro_version='${PV}'\ | ||
| 31 | " | ||
| 32 | |||
| 33 | # The compile assumes GCC at present | ||
| 34 | TOOLCHAIN = "gcc" | ||
