summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-06-11 18:41:35 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-15 09:53:38 +0100
commit3220095b56d0d55b71ef8a37b8f287c0c2f0ac22 (patch)
treeaba3b411e46dd14947956ccaa6720bc96e568388 /meta/recipes-bsp
parentf457f358dfc05dea8e3a7e5add56e22a2cea2a73 (diff)
downloadpoky-3220095b56d0d55b71ef8a37b8f287c0c2f0ac22.tar.gz
efivar: Upgrade to tip of trunk
Drop all the patches accepted upstream Additional important changes it fixes build with lld linker Following changes are brought over from trunk * 90e88b2 Allow -a to create a non-existent variable * 9306e0b Allow passing of hex values to -A * 328f584 Allow overriding PKG_CONFIG * cfd686d Revamp efi_well_known_* variable handling * 914c686 Use off_t instead of off64_t * dd901c1 Fix IPv4 and IPv6 Device Path printing * c4138d0 efidp_ipv6_addr: fix gateway size * bfe9a6b format_ipv6_addr_helper(): fix bad port-printing conditional * 7c39722 format_ipv6_addr_helper: fix dp_type usage * 9a5e710 File device paths: don't print "File(" or ")" * bc65d63 Fix glibc 2.36 build (mount.h conflicts) * 1f24726 LLD: fix detection and remove not needed workarounds * 01de743 Set LC_ALL=C to force English output from ld * 26ad685 Adjust dependency for libefivar and libefiboot objects * ca48d39 src/Makefile: build util.c separately for makeguids * b23aba1 Remove deprecated --add-needed linker flag * 6be2cb1 Fix invalid free in main() * df09b47 efisecdb: do not free optarg * cece3ff efisecdb: fix build with musl libc * aab4e9b Fix the -march issue for riscv64 * 15622b7 Avoid format error on i686 * 28789d1 Add `extern "C"` to headers for easier use by C++ * 197a087 Add -T workaround for GNU ld 2.36 (From OE-Core rev: 4df808c616f847d90203582fd950a49bb8360dd0) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp')
-rw-r--r--meta/recipes-bsp/efivar/efivar/0001-Fix-glibc-2.36-build-mount.h-conflicts.patch60
-rw-r--r--meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch30
-rw-r--r--meta/recipes-bsp/efivar/efivar/0001-Use-off_t-instead-of-off64_t.patch39
-rw-r--r--meta/recipes-bsp/efivar/efivar/0001-src-Makefile-build-util.c-separately-for-makeguids.patch38
-rw-r--r--meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch184
-rw-r--r--meta/recipes-bsp/efivar/efivar_38.bb8
6 files changed, 2 insertions, 357 deletions
diff --git a/meta/recipes-bsp/efivar/efivar/0001-Fix-glibc-2.36-build-mount.h-conflicts.patch b/meta/recipes-bsp/efivar/efivar/0001-Fix-glibc-2.36-build-mount.h-conflicts.patch
deleted file mode 100644
index 28dadabe6b..0000000000
--- a/meta/recipes-bsp/efivar/efivar/0001-Fix-glibc-2.36-build-mount.h-conflicts.patch
+++ /dev/null
@@ -1,60 +0,0 @@
1From 7b0e7ba674321ec1ddd6b9cbb419e5fb44f88bb3 Mon Sep 17 00:00:00 2001
2From: Robbie Harwood <rharwood@redhat.com>
3Date: Thu, 28 Jul 2022 16:11:24 -0400
4Subject: [PATCH] Fix glibc 2.36 build (mount.h conflicts)
5
6glibc has decided that sys/mount.h and linux/mount.h are no longer
7usable at the same time. This broke the build, since linux/fs.h itself
8includes linux/mount.h. For now, fix the build by only including
9sys/mount.h where we need it.
10
11See-also: https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
12Resolves: #227
13
14Upstream-Status: Backport [https://github.com/rhboot/efivar/commit/bc65d63ebf8fe6ac8a099ff15ca200986dba1565]
15Signed-off-by: Robbie Harwood <rharwood@redhat.com>
16---
17 src/gpt.c | 1 +
18 src/linux.c | 1 +
19 src/util.h | 1 -
20 3 files changed, 2 insertions(+), 1 deletion(-)
21
22diff --git a/src/gpt.c b/src/gpt.c
23index 1eda049..21413c3 100644
24--- a/src/gpt.c
25+++ b/src/gpt.c
26@@ -17,6 +17,7 @@
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30+#include <sys/mount.h>
31 #include <sys/param.h>
32 #include <sys/stat.h>
33 #include <sys/utsname.h>
34diff --git a/src/linux.c b/src/linux.c
35index 47e45ae..1780816 100644
36--- a/src/linux.c
37+++ b/src/linux.c
38@@ -20,6 +20,7 @@
39 #include <stdbool.h>
40 #include <stdio.h>
41 #include <sys/ioctl.h>
42+#include <sys/mount.h>
43 #include <sys/socket.h>
44 #include <sys/sysmacros.h>
45 #include <sys/types.h>
46diff --git a/src/util.h b/src/util.h
47index 3300666..1e67e44 100644
48--- a/src/util.h
49+++ b/src/util.h
50@@ -23,7 +23,6 @@
51 #include <stdio.h>
52 #include <string.h>
53 #include <sys/ioctl.h>
54-#include <sys/mount.h>
55 #include <sys/stat.h>
56 #include <sys/types.h>
57 #include <tgmath.h>
58--
592.37.1
60
diff --git a/meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch b/meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch
deleted file mode 100644
index 7e63df578e..0000000000
--- a/meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 085f027e9e9f1478f68ddda705f83b244ee3bd88 Mon Sep 17 00:00:00 2001
2From: Robbie Harwood <rharwood@redhat.com>
3Date: Mon, 18 Apr 2022 13:08:18 -0400
4Subject: [PATCH] Fix invalid free in main()
5
6data is allocated by mmap() in prepare_data().
7
8Resolves: #173
9Signed-off-by: Robbie Harwood <rharwood@redhat.com>
10Upstream-Status: Backport
11Link: https://github.com/rhboot/efivar/commit/6be2cb1c0139ac177e754b0767abf1ca1533847f
12Signed-off-by: Grygorii Tertychnyi <grygorii.tertychnyi@leica-geosystems.com>
13
14---
15 src/efivar.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/src/efivar.c b/src/efivar.c
19index 5cd1eb2bc73c..09f85edd0a38 100644
20--- a/src/efivar.c
21+++ b/src/efivar.c
22@@ -633,7 +633,7 @@ int main(int argc, char *argv[])
23 if (sz < 0)
24 err(1, "Could not import data from \"%s\"", infile);
25
26- free(data);
27+ munmap(data, data_size);
28 data = NULL;
29 data_size = 0;
30
diff --git a/meta/recipes-bsp/efivar/efivar/0001-Use-off_t-instead-of-off64_t.patch b/meta/recipes-bsp/efivar/efivar/0001-Use-off_t-instead-of-off64_t.patch
deleted file mode 100644
index f47a457386..0000000000
--- a/meta/recipes-bsp/efivar/efivar/0001-Use-off_t-instead-of-off64_t.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From 1eb0fa531301a5045af1b020fc093c4fcfd38680 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 14 Dec 2022 16:55:51 -0800
4Subject: [PATCH] Use off_t instead of off64_t
5
6Pass _FILE_OFFSET_BITS=64 to ensure 64bit off_t
7
8Upstream-Status: Submitted [https://github.com/rhboot/efivar/pull/237]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/error.c | 2 +-
12 src/include/defaults.mk | 1 +
13 2 files changed, 2 insertions(+), 1 deletion(-)
14
15diff --git a/src/error.c b/src/error.c
16index fcbba0d..9530e22 100644
17--- a/src/error.c
18+++ b/src/error.c
19@@ -191,7 +191,7 @@ dbglog_write(void *cookie, const char *buf, size_t size)
20 }
21
22 static int
23-dbglog_seek(void *cookie UNUSED, off64_t *offset, int whence)
24+dbglog_seek(void *cookie UNUSED, off_t *offset, int whence)
25 {
26 FILE *log = efi_errlog ? efi_errlog : stderr;
27 int rc;
28diff --git a/src/include/defaults.mk b/src/include/defaults.mk
29index 632b155..95be8be 100644
30--- a/src/include/defaults.mk
31+++ b/src/include/defaults.mk
32@@ -34,6 +34,7 @@ CPPFLAGS ?=
33 override _CPPFLAGS := $(CPPFLAGS)
34 override CPPFLAGS = $(_CPPFLAGS) -DLIBEFIVAR_VERSION=$(VERSION) \
35 -D_GNU_SOURCE \
36+ -D_FILE_OFFSET_BITS=64 \
37 -I$(TOPDIR)/src/include/
38 CFLAGS ?= $(OPTIMIZE) $(DEBUGINFO) $(WARNINGS) $(ERRORS)
39 CFLAGS_GCC ?= -specs=$(TOPDIR)/src/include/gcc.specs \
diff --git a/meta/recipes-bsp/efivar/efivar/0001-src-Makefile-build-util.c-separately-for-makeguids.patch b/meta/recipes-bsp/efivar/efivar/0001-src-Makefile-build-util.c-separately-for-makeguids.patch
deleted file mode 100644
index 02781eb67d..0000000000
--- a/meta/recipes-bsp/efivar/efivar/0001-src-Makefile-build-util.c-separately-for-makeguids.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From 80f11fcb46f6b52e13501cb323ca1a849c3f6e88 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Tue, 18 Jan 2022 11:53:41 +0100
4Subject: [PATCH] src/Makefile: build util.c separately for makeguids
5
6util.c needs to be built twice when cross-compiling:
7for the build machine to be able to link with
8makeguids which then runs during the same build,
9and then for the actual target.
10
11Upstream-Status: Submitted [https://github.com/rhboot/efivar/pull/203]
12Signed-off-by: Alexander Kanavin <alex@linutronix.de>
13---
14 src/Makefile | 5 ++++-
15 1 file changed, 4 insertions(+), 1 deletion(-)
16
17diff --git a/src/Makefile b/src/Makefile
18index 0e423c4..b10051b 100644
19--- a/src/Makefile
20+++ b/src/Makefile
21@@ -28,10 +28,13 @@ EFIVAR_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(EFIVAR_SOURCES)))
22 EFISECDB_SOURCES = efisecdb.c guid-symbols.c secdb-dump.c util.c
23 EFISECDB_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(EFISECDB_SOURCES)))
24 GENERATED_SOURCES = include/efivar/efivar-guids.h guid-symbols.c
25-MAKEGUIDS_SOURCES = makeguids.c util.c
26+MAKEGUIDS_SOURCES = makeguids.c util-makeguids.c
27 MAKEGUIDS_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(MAKEGUIDS_SOURCES)))
28 MAKEGUIDS_OUTPUT = $(GENERATED_SOURCES) guids.lds
29
30+util-makeguids.c :
31+ cp util.c util-makeguids.c
32+
33 ALL_SOURCES=$(LIBEFISEC_SOURCES) $(LIBEFIBOOT_SOURCES) $(LIBEFIVAR_SOURCES) \
34 $(MAKEGUIDS_SOURCES) $(GENERATED_SOURCES) $(EFIVAR_SOURCES) \
35 $(sort $(wildcard include/efivar/*.h))
36--
372.20.1
38
diff --git a/meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch b/meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch
deleted file mode 100644
index ec5b285a06..0000000000
--- a/meta/recipes-bsp/efivar/efivar/efisecdb-fix-build-with-musl-libc.patch
+++ /dev/null
@@ -1,184 +0,0 @@
1From cece3ffd5be2f8641eb694513f2b73e5eb97ffd3 Mon Sep 17 00:00:00 2001
2From: Natanael Copa <ncopa@alpinelinux.org>
3Date: Fri, 28 Jan 2022 12:13:30 +0100
4Subject: [PATCH] efisecdb: fix build with musl libc
5
6Refactor code to use POSIX atexit(3) instead of the GNU specific
7on_exit(3).
8
9Resolves: #197
10Resolves: #202
11Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
12
13Upstream-Status: Backport
14https://github.com/rhboot/efivar/commit/cece3ffd5be2f8641eb694513f2b73e5eb97ffd3
15
16Signed-off-by: Davide Gardenal <davide.gardenal@huawei.com>
17---
18 src/compiler.h | 2 --
19 src/efisecdb.c | 68 +++++++++++++++++++-------------------------------
20 2 files changed, 26 insertions(+), 44 deletions(-)
21
22diff --git a/src/compiler.h b/src/compiler.h
23index e2f18f0b..d95fb014 100644
24--- a/src/compiler.h
25+++ b/src/compiler.h
26@@ -7,8 +7,6 @@
27 #ifndef COMPILER_H_
28 #define COMPILER_H_
29
30-#include <sys/cdefs.h>
31-
32 /* GCC version checking borrowed from glibc. */
33 #if defined(__GNUC__) && defined(__GNUC_MINOR__)
34 # define GNUC_PREREQ(maj,min) \
35diff --git a/src/efisecdb.c b/src/efisecdb.c
36index f8823737..6bd5ad90 100644
37--- a/src/efisecdb.c
38+++ b/src/efisecdb.c
39@@ -25,6 +25,10 @@
40 extern char *optarg;
41 extern int optind, opterr, optopt;
42
43+static efi_secdb_t *secdb = NULL;
44+static list_t infiles;
45+static list_t actions;
46+
47 struct hash_param {
48 char *name;
49 efi_secdb_type_t algorithm;
50@@ -187,12 +191,11 @@ add_action(list_t *list, action_type_t action_type, const efi_guid_t *owner,
51 }
52
53 static void
54-free_actions(int status UNUSED, void *actionsp)
55+free_actions(void)
56 {
57- list_t *actions = (list_t *)actionsp;
58 list_t *pos, *tmp;
59
60- for_each_action_safe(pos, tmp, actions) {
61+ for_each_action_safe(pos, tmp, &actions) {
62 action_t *action = list_entry(pos, action_t, list);
63
64 list_del(&action->list);
65@@ -202,12 +205,11 @@ free_actions(int status UNUSED, void *actionsp)
66 }
67
68 static void
69-free_infiles(int status UNUSED, void *infilesp)
70+free_infiles(void)
71 {
72- list_t *infiles = (list_t *)infilesp;
73 list_t *pos, *tmp;
74
75- for_each_ptr_safe(pos, tmp, infiles) {
76+ for_each_ptr_safe(pos, tmp, &infiles) {
77 ptrlist_t *entry = list_entry(pos, ptrlist_t, list);
78
79 list_del(&entry->list);
80@@ -216,27 +218,12 @@ free_infiles(int status UNUSED, void *infilesp)
81 }
82
83 static void
84-maybe_free_secdb(int status UNUSED, void *voidp)
85+maybe_free_secdb(void)
86 {
87- efi_secdb_t **secdbp = (efi_secdb_t **)voidp;
88-
89- if (secdbp == NULL || *secdbp == NULL)
90+ if (secdb == NULL)
91 return;
92
93- efi_secdb_free(*secdbp);
94-}
95-
96-static void
97-maybe_do_unlink(int status, void *filep)
98-{
99- char **file = (char **)filep;
100-
101- if (status == 0)
102- return;
103- if (file == NULL || *file == NULL)
104- return;
105-
106- unlink(*file);
107+ efi_secdb_free(secdb);
108 }
109
110 static void
111@@ -323,15 +310,6 @@ parse_input_files(list_t *infiles, char **outfile, efi_secdb_t **secdb,
112 return status;
113 }
114
115-/*
116- * These need to be static globals so that they're not on main's stack when
117- * on_exit() fires.
118- */
119-static efi_secdb_t *secdb = NULL;
120-static list_t infiles;
121-static list_t actions;
122-static char *outfile = NULL;
123-
124 int
125 main(int argc, char *argv[])
126 {
127@@ -351,6 +329,7 @@ main(int argc, char *argv[])
128 bool do_sort_data = false;
129 bool sort_descending = false;
130 int status = 0;
131+ char *outfile = NULL;
132
133 const char sopts[] = ":aAc:dfg:h:i:Lo:rs:t:v?";
134 const struct option lopts[] = {
135@@ -376,10 +355,9 @@ main(int argc, char *argv[])
136 INIT_LIST_HEAD(&infiles);
137 INIT_LIST_HEAD(&actions);
138
139- on_exit(free_actions, &actions);
140- on_exit(free_infiles, &infiles);
141- on_exit(maybe_free_secdb, &secdb);
142- on_exit(maybe_do_unlink, &outfile);
143+ atexit(free_actions);
144+ atexit(free_infiles);
145+ atexit(maybe_free_secdb);
146
147 /*
148 * parse the command line.
149@@ -587,24 +565,30 @@ main(int argc, char *argv[])
150 outfd = open(outfile, flags, 0600);
151 if (outfd < 0) {
152 char *tmpoutfile = outfile;
153- if (errno == EEXIST)
154- outfile = NULL;
155+ if (errno != EEXIST)
156+ unlink(outfile);
157 err(1, "could not open \"%s\"", tmpoutfile);
158 }
159
160 rc = ftruncate(outfd, 0);
161- if (rc < 0)
162+ if (rc < 0) {
163+ unlink(outfile);
164 err(1, "could not truncate output file \"%s\"", outfile);
165+ }
166
167 void *output;
168 size_t size = 0;
169 rc = efi_secdb_realize(secdb, &output, &size);
170- if (rc < 0)
171+ if (rc < 0) {
172+ unlink(outfile);
173 secdb_err(1, "could not realize signature list");
174+ }
175
176 rc = write(outfd, output, size);
177- if (rc < 0)
178+ if (rc < 0) {
179+ unlink(outfile);
180 err(1, "could not write signature list");
181+ }
182
183 close(outfd);
184 xfree(output);
diff --git a/meta/recipes-bsp/efivar/efivar_38.bb b/meta/recipes-bsp/efivar/efivar_38.bb
index 5523329699..87a1e665ca 100644
--- a/meta/recipes-bsp/efivar/efivar_38.bb
+++ b/meta/recipes-bsp/efivar/efivar_38.bb
@@ -9,13 +9,9 @@ COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
9 9
10SRC_URI = "git://github.com/rhinstaller/efivar.git;branch=main;protocol=https \ 10SRC_URI = "git://github.com/rhinstaller/efivar.git;branch=main;protocol=https \
11 file://0001-docs-do-not-build-efisecdb-manpage.patch \ 11 file://0001-docs-do-not-build-efisecdb-manpage.patch \
12 file://0001-src-Makefile-build-util.c-separately-for-makeguids.patch \
13 file://efisecdb-fix-build-with-musl-libc.patch \
14 file://0001-Fix-invalid-free-in-main.patch \
15 file://0001-Fix-glibc-2.36-build-mount.h-conflicts.patch \
16 file://0001-Use-off_t-instead-of-off64_t.patch \
17 " 12 "
18SRCREV = "1753149d4176ebfb2b135ac0aaf79340bf0e7a93" 13SRCREV = "90e88b221e8bc60dc50f3246051369b8f580c0d0"
14PV .= "+39+git${SRCPV}"
19 15
20S = "${WORKDIR}/git" 16S = "${WORKDIR}/git"
21 17