summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-04-24 11:44:21 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2017-04-26 20:14:15 +0200
commitdd5b81adff4b2e6d189b67684446aaac8b504d8b (patch)
tree60f4762e648ac34b96792744e5b9a0f001c1fa48
parent67595636e983d09386a7cda34d7c2312c65c07c1 (diff)
downloadmeta-openembedded-dd5b81adff4b2e6d189b67684446aaac8b504d8b.tar.gz
efivar: Backport patches to remove double const decls
Helps fixing build with gcc 7 Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-extended/efivar/efivar/0001-Remove-some-extra-const-that-gcc-complains-about.patch44
-rw-r--r--meta-oe/recipes-extended/efivar/efivar/0002-New-gcc-version-new-way-symbol-versioning-breaks.patch66
-rw-r--r--meta-oe/recipes-extended/efivar/efivar_0.24.bb2
3 files changed, 112 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/efivar/efivar/0001-Remove-some-extra-const-that-gcc-complains-about.patch b/meta-oe/recipes-extended/efivar/efivar/0001-Remove-some-extra-const-that-gcc-complains-about.patch
new file mode 100644
index 000000000..4ae8cb90f
--- /dev/null
+++ b/meta-oe/recipes-extended/efivar/efivar/0001-Remove-some-extra-const-that-gcc-complains-about.patch
@@ -0,0 +1,44 @@
1From 29a2dea16113b5a8e51de46437c6a9f7426c5867 Mon Sep 17 00:00:00 2001
2From: Peter Jones <pjones@redhat.com>
3Date: Mon, 6 Feb 2017 14:28:19 -0500
4Subject: [PATCH 1/2] Remove some extra "const" that gcc complains about.
5
6One of these days I'll get these right.
7
8Signed-off-by: Peter Jones <pjones@redhat.com>
9---
10 src/include/efivar/efiboot-loadopt.h | 4 ++--
11 src/loadopt.c | 2 +-
12 2 files changed, 3 insertions(+), 3 deletions(-)
13
14diff --git a/src/include/efivar/efiboot-loadopt.h b/src/include/efivar/efiboot-loadopt.h
15index 07db5c4..efc29c6 100644
16--- a/src/include/efivar/efiboot-loadopt.h
17+++ b/src/include/efivar/efiboot-loadopt.h
18@@ -32,8 +32,8 @@ extern ssize_t efi_loadopt_create(uint8_t *buf, ssize_t size,
19
20 extern efidp efi_loadopt_path(efi_load_option *opt, ssize_t limit)
21 __attribute__((__nonnull__ (1)));
22-extern const unsigned char const * efi_loadopt_desc(efi_load_option *opt,
23- ssize_t limit)
24+extern const unsigned char * efi_loadopt_desc(efi_load_option *opt,
25+ ssize_t limit)
26 __attribute__((__visibility__ ("default")))
27 __attribute__((__nonnull__ (1)));
28 extern uint32_t efi_loadopt_attrs(efi_load_option *opt)
29diff --git a/src/loadopt.c b/src/loadopt.c
30index 64e333f..ec50722 100644
31--- a/src/loadopt.c
32+++ b/src/loadopt.c
33@@ -336,7 +336,7 @@ teardown(void)
34
35 __attribute__((__nonnull__ (1)))
36 __attribute__((__visibility__ ("default")))
37-const unsigned char const *
38+const unsigned char *
39 efi_loadopt_desc(efi_load_option *opt, ssize_t limit)
40 {
41 if (last_desc) {
42--
432.12.2
44
diff --git a/meta-oe/recipes-extended/efivar/efivar/0002-New-gcc-version-new-way-symbol-versioning-breaks.patch b/meta-oe/recipes-extended/efivar/efivar/0002-New-gcc-version-new-way-symbol-versioning-breaks.patch
new file mode 100644
index 000000000..737b78b01
--- /dev/null
+++ b/meta-oe/recipes-extended/efivar/efivar/0002-New-gcc-version-new-way-symbol-versioning-breaks.patch
@@ -0,0 +1,66 @@
1From 31e655d2b5f66e772d9714422b7332bbaa60d2e6 Mon Sep 17 00:00:00 2001
2From: Peter Jones <pjones@redhat.com>
3Date: Mon, 6 Feb 2017 14:41:58 -0500
4Subject: [PATCH 2/2] New gcc version, new way symbol versioning breaks.
5
6Apparently I get to redo this every time there's a compiler release.
7Yaaaaaay.
8
9Anyway, the current method is to define the two compat things from the
10land before time as @libefivar.so.0 symbols and list them there in the
11link map. Then we have the real one defined with another name, and set
12as efi_set_variable@@LIBEFIVAR_0.24. Then to make there actually be a
13efi_set_variable symbol to link against, we create it as a weak alias.
14
15This is all completely absurd.
16
17Signed-off-by: Peter Jones <pjones@redhat.com>
18---
19 src/lib.c | 17 ++++++++++++-----
20 1 file changed, 12 insertions(+), 5 deletions(-)
21
22diff --git a/src/lib.c b/src/lib.c
23index 6a9b392..afa7d94 100644
24--- a/src/lib.c
25+++ b/src/lib.c
26@@ -49,7 +49,7 @@ _efi_set_variable(efi_guid_t guid, const char *name, uint8_t *data,
27 {
28 return ops->set_variable(guid, name, data, data_size, attributes, 0600);
29 }
30-__asm__(".symver _efi_set_variable,_efi_set_variable@");
31+__asm__(".symver _efi_set_variable,_efi_set_variable@libefivar.so.0");
32
33 int
34 __attribute__((__nonnull__ (2, 3)))
35@@ -59,17 +59,24 @@ _efi_set_variable_variadic(efi_guid_t guid, const char *name, uint8_t *data,
36 {
37 return ops->set_variable(guid, name, data, data_size, attributes, 0600);
38 }
39-__asm__(".symver _efi_set_variable_variadic,efi_set_variable@");
40+__asm__(".symver _efi_set_variable_variadic,efi_set_variable@libefivar.so.0");
41
42 int
43 __attribute__((__nonnull__ (2, 3)))
44 __attribute__((__visibility__ ("default")))
45-efi_set_variable(efi_guid_t guid, const char *name, uint8_t *data,
46- size_t data_size, uint32_t attributes, mode_t mode)
47+_efi_set_variable_mode(efi_guid_t guid, const char *name, uint8_t *data,
48+ size_t data_size, uint32_t attributes, mode_t mode)
49 {
50 return ops->set_variable(guid, name, data, data_size, attributes, mode);
51 }
52-__asm__(".symver efi_set_variable,efi_set_variable@@LIBEFIVAR_0.24");
53+__asm__(".symver _efi_set_variable_mode,efi_set_variable@@LIBEFIVAR_0.24");
54+
55+int
56+__attribute__((__nonnull__ (2, 3)))
57+__attribute__((__visibility__ ("default")))
58+efi_set_variable(efi_guid_t guid, const char *name, uint8_t *data,
59+ size_t data_size, uint32_t attributes, mode_t mode)
60+ __attribute((weak, alias ("_efi_set_variable_mode")));
61
62 int
63 __attribute__((__nonnull__ (2, 3)))
64--
652.12.2
66
diff --git a/meta-oe/recipes-extended/efivar/efivar_0.24.bb b/meta-oe/recipes-extended/efivar/efivar_0.24.bb
index 602fd81b4..877ca9045 100644
--- a/meta-oe/recipes-extended/efivar/efivar_0.24.bb
+++ b/meta-oe/recipes-extended/efivar/efivar_0.24.bb
@@ -16,6 +16,8 @@ SRCREV = "963cb2e5adc145fe00717f94e382f2973f80e753"
16SRC_URI = "git://github.com/rhinstaller/efivar.git \ 16SRC_URI = "git://github.com/rhinstaller/efivar.git \
17 file://0002-disable-static-build.patch \ 17 file://0002-disable-static-build.patch \
18 file://allow-multi-definitions-for-native.patch \ 18 file://allow-multi-definitions-for-native.patch \
19 file://0001-Remove-some-extra-const-that-gcc-complains-about.patch \
20 file://0002-New-gcc-version-new-way-symbol-versioning-breaks.patch \
19" 21"
20SRC_URI_append_class-target = " file://0001-efivar-fix-for-cross-compile.patch \ 22SRC_URI_append_class-target = " file://0001-efivar-fix-for-cross-compile.patch \
21 file://0003-efivar-fix-for-cross-compile.patch \ 23 file://0003-efivar-fix-for-cross-compile.patch \