mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-01-01 13:58:06 +00:00
efivar: Backport patches to remove double const decls
Helps fixing build with gcc 7 Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
parent
67595636e9
commit
dd5b81adff
|
|
@ -0,0 +1,44 @@
|
|||
From 29a2dea16113b5a8e51de46437c6a9f7426c5867 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 6 Feb 2017 14:28:19 -0500
|
||||
Subject: [PATCH 1/2] Remove some extra "const" that gcc complains about.
|
||||
|
||||
One of these days I'll get these right.
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
src/include/efivar/efiboot-loadopt.h | 4 ++--
|
||||
src/loadopt.c | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/include/efivar/efiboot-loadopt.h b/src/include/efivar/efiboot-loadopt.h
|
||||
index 07db5c4..efc29c6 100644
|
||||
--- a/src/include/efivar/efiboot-loadopt.h
|
||||
+++ b/src/include/efivar/efiboot-loadopt.h
|
||||
@@ -32,8 +32,8 @@ extern ssize_t efi_loadopt_create(uint8_t *buf, ssize_t size,
|
||||
|
||||
extern efidp efi_loadopt_path(efi_load_option *opt, ssize_t limit)
|
||||
__attribute__((__nonnull__ (1)));
|
||||
-extern const unsigned char const * efi_loadopt_desc(efi_load_option *opt,
|
||||
- ssize_t limit)
|
||||
+extern const unsigned char * efi_loadopt_desc(efi_load_option *opt,
|
||||
+ ssize_t limit)
|
||||
__attribute__((__visibility__ ("default")))
|
||||
__attribute__((__nonnull__ (1)));
|
||||
extern uint32_t efi_loadopt_attrs(efi_load_option *opt)
|
||||
diff --git a/src/loadopt.c b/src/loadopt.c
|
||||
index 64e333f..ec50722 100644
|
||||
--- a/src/loadopt.c
|
||||
+++ b/src/loadopt.c
|
||||
@@ -336,7 +336,7 @@ teardown(void)
|
||||
|
||||
__attribute__((__nonnull__ (1)))
|
||||
__attribute__((__visibility__ ("default")))
|
||||
-const unsigned char const *
|
||||
+const unsigned char *
|
||||
efi_loadopt_desc(efi_load_option *opt, ssize_t limit)
|
||||
{
|
||||
if (last_desc) {
|
||||
--
|
||||
2.12.2
|
||||
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
From 31e655d2b5f66e772d9714422b7332bbaa60d2e6 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 6 Feb 2017 14:41:58 -0500
|
||||
Subject: [PATCH 2/2] New gcc version, new way symbol versioning breaks.
|
||||
|
||||
Apparently I get to redo this every time there's a compiler release.
|
||||
Yaaaaaay.
|
||||
|
||||
Anyway, the current method is to define the two compat things from the
|
||||
land before time as @libefivar.so.0 symbols and list them there in the
|
||||
link map. Then we have the real one defined with another name, and set
|
||||
as efi_set_variable@@LIBEFIVAR_0.24. Then to make there actually be a
|
||||
efi_set_variable symbol to link against, we create it as a weak alias.
|
||||
|
||||
This is all completely absurd.
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
---
|
||||
src/lib.c | 17 ++++++++++++-----
|
||||
1 file changed, 12 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/lib.c b/src/lib.c
|
||||
index 6a9b392..afa7d94 100644
|
||||
--- a/src/lib.c
|
||||
+++ b/src/lib.c
|
||||
@@ -49,7 +49,7 @@ _efi_set_variable(efi_guid_t guid, const char *name, uint8_t *data,
|
||||
{
|
||||
return ops->set_variable(guid, name, data, data_size, attributes, 0600);
|
||||
}
|
||||
-__asm__(".symver _efi_set_variable,_efi_set_variable@");
|
||||
+__asm__(".symver _efi_set_variable,_efi_set_variable@libefivar.so.0");
|
||||
|
||||
int
|
||||
__attribute__((__nonnull__ (2, 3)))
|
||||
@@ -59,17 +59,24 @@ _efi_set_variable_variadic(efi_guid_t guid, const char *name, uint8_t *data,
|
||||
{
|
||||
return ops->set_variable(guid, name, data, data_size, attributes, 0600);
|
||||
}
|
||||
-__asm__(".symver _efi_set_variable_variadic,efi_set_variable@");
|
||||
+__asm__(".symver _efi_set_variable_variadic,efi_set_variable@libefivar.so.0");
|
||||
|
||||
int
|
||||
__attribute__((__nonnull__ (2, 3)))
|
||||
__attribute__((__visibility__ ("default")))
|
||||
-efi_set_variable(efi_guid_t guid, const char *name, uint8_t *data,
|
||||
- size_t data_size, uint32_t attributes, mode_t mode)
|
||||
+_efi_set_variable_mode(efi_guid_t guid, const char *name, uint8_t *data,
|
||||
+ size_t data_size, uint32_t attributes, mode_t mode)
|
||||
{
|
||||
return ops->set_variable(guid, name, data, data_size, attributes, mode);
|
||||
}
|
||||
-__asm__(".symver efi_set_variable,efi_set_variable@@LIBEFIVAR_0.24");
|
||||
+__asm__(".symver _efi_set_variable_mode,efi_set_variable@@LIBEFIVAR_0.24");
|
||||
+
|
||||
+int
|
||||
+__attribute__((__nonnull__ (2, 3)))
|
||||
+__attribute__((__visibility__ ("default")))
|
||||
+efi_set_variable(efi_guid_t guid, const char *name, uint8_t *data,
|
||||
+ size_t data_size, uint32_t attributes, mode_t mode)
|
||||
+ __attribute((weak, alias ("_efi_set_variable_mode")));
|
||||
|
||||
int
|
||||
__attribute__((__nonnull__ (2, 3)))
|
||||
--
|
||||
2.12.2
|
||||
|
||||
|
|
@ -16,6 +16,8 @@ SRCREV = "963cb2e5adc145fe00717f94e382f2973f80e753"
|
|||
SRC_URI = "git://github.com/rhinstaller/efivar.git \
|
||||
file://0002-disable-static-build.patch \
|
||||
file://allow-multi-definitions-for-native.patch \
|
||||
file://0001-Remove-some-extra-const-that-gcc-complains-about.patch \
|
||||
file://0002-New-gcc-version-new-way-symbol-versioning-breaks.patch \
|
||||
"
|
||||
SRC_URI_append_class-target = " file://0001-efivar-fix-for-cross-compile.patch \
|
||||
file://0003-efivar-fix-for-cross-compile.patch \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user