new file mode 100644
@@ -0,0 +1,23 @@
+From 4c8f95fedecbc590eb7cd98aaf97912fa36b8f2e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 7 Jun 2024 23:58:36 -0700
+Subject: [PATCH] efi/generate_binary.py: Use env to detect python3
+
+This enables python3 from native sysroot correctly
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ efi/generate_binary.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/efi/generate_binary.py b/efi/generate_binary.py
+index 443472a..a4611bb 100755
+--- a/efi/generate_binary.py
++++ b/efi/generate_binary.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/env python3
+ #
+ # Copyright (C) 2021 Javier Martinez Canillas <javierm@redhat.com>
+ # Copyright (C) 2021 Richard Hughes <richard@hughsie.com>
deleted file mode 100644
@@ -1,53 +0,0 @@
-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-efi"
-
- 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
-@@ -187,7 +187,7 @@ o_file5 = custom_target('fwup-sbat.o',
- command : [
- generate_sbat,
- '@OUTPUT@',
-- '--cc', efi_cc,
-+ '--cc', ' '.join(efi_cc),
- '--objcopy', 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-libdir', type : 'string', description : 'path to the EFI lib directory')
- option('efi-ldsdir', type : 'string', description : 'path to the EFI lds directory')
similarity index 61%
rename from meta-oe/recipes-bsp/fwupd/fwupd-efi_1.3.bb
rename to meta-oe/recipes-bsp/fwupd/fwupd-efi_1.6.bb
@@ -3,23 +3,23 @@ LICENSE = "LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
SRC_URI = "git://github.com/fwupd/fwupd-efi;protocol=https;branch=main \
- file://cc.patch"
-SRCREV = "36ce593f58e391cca43fd388824496ff98d83480"
+ file://0001-efi-generate_binary.py-Use-env-to-detect-python3.patch"
+
+SRCREV = "58a2928f778278ab1f7f8fcddbab81ba587a8962"
S = "${WORKDIR}/git"
-DEPENDS = "gnu-efi"
+DEPENDS = "gnu-efi python3-pefile-native"
COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
-inherit meson
+inherit meson pkgconfig python3native
# These should be configured as needed
SBAT_DISTRO_ID ?= "${DISTRO}"
SBAT_DISTRO_SUMMARY ?= "${DISTRO_NAME}"
SBAT_DISTRO_URL ?= ""
-EXTRA_OEMESON += "-Defi-cc="${@meson_array('CC', d)}" \
- -Defi-ld='${HOST_PREFIX}ld' \
+EXTRA_OEMESON += "\
-Defi-includedir=${STAGING_INCDIR}/efi \
-Defi-libdir=${STAGING_LIBDIR} \
-Defi_sbat_distro_id='${SBAT_DISTRO_ID}' \
@@ -31,3 +31,9 @@ EXTRA_OEMESON += "-Defi-cc="${@meson_array('CC', d)}" \
# The compile assumes GCC at present
TOOLCHAIN = "gcc"
+
+# Multiple errors like below with gcc14
+#| ../git/efi/fwupdate.c:611:20: error: passing argument 5 of 'fwup_log' from incompatible pointer type [-Wincompatible-pointer-types]
+#| 611 | fwup_debug(L"n_updates: %d", n_updates);
+#| | ^~~~~~~~~~~~~~~~
+TOOLCHAIN_OPTIONS += "-Wno-error=incompatible-pointer-types"
Drop cc settings patch this code piece has been removed upstream Add a patch to use native python Disable incompatible-pointer-types warning as error with gcc-14 Signed-off-by: Khem Raj <raj.khem@gmail.com> --- ..._binary.py-Use-env-to-detect-python3.patch | 23 ++++++++ meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch | 53 ------------------- .../{fwupd-efi_1.3.bb => fwupd-efi_1.6.bb} | 18 ++++--- 3 files changed, 35 insertions(+), 59 deletions(-) create mode 100644 meta-oe/recipes-bsp/fwupd/fwupd-efi/0001-efi-generate_binary.py-Use-env-to-detect-python3.patch delete mode 100644 meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch rename meta-oe/recipes-bsp/fwupd/{fwupd-efi_1.3.bb => fwupd-efi_1.6.bb} (61%)