fwupd-efi: Upgrade to 1.6

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>
This commit is contained in:
Khem Raj 2024-06-08 00:09:39 -07:00
parent 395e9075ac
commit 10fc3fa15f
No known key found for this signature in database
GPG Key ID: BB053355919D3314
3 changed files with 35 additions and 59 deletions

View File

@ -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>

View File

@ -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')

View File

@ -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"