summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-bsp
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2017-10-29 12:14:41 -0700
committerArmin Kuster <akuster808@gmail.com>2018-03-01 16:10:37 -0800
commitaaf6d267143e11dabe78faa06ab913b4f203ad69 (patch)
tree26202308f85820a715b0a935b5b90753771ab5aa /meta-oe/recipes-bsp
parent17f9ce803e2be64eea218a091e664f0b1d1a3081 (diff)
downloadmeta-openembedded-aaf6d267143e11dabe78faa06ab913b4f203ad69.tar.gz
efivar: move to recipes-bsp
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-bsp')
-rw-r--r--meta-oe/recipes-bsp/efivar/efivar/0001-efivar-dp.h-Add-Wunknown-attributes-when-using-clang.patch32
-rw-r--r--meta-oe/recipes-bsp/efivar/efivar/0001-efivar-fix-for-cross-compile.patch35
-rw-r--r--meta-oe/recipes-bsp/efivar/efivar/0001-makeguids-Do-not-use-__bswap_constant_-16-32-macros.patch37
-rw-r--r--meta-oe/recipes-bsp/efivar/efivar/0003-efivar-fix-for-cross-compile.patch44
-rw-r--r--meta-oe/recipes-bsp/efivar/efivar/0004-fix-unknow-option-for-gold-linker.patch35
-rw-r--r--meta-oe/recipes-bsp/efivar/efivar/allow-multi-definitions-for-native.patch23
-rw-r--r--meta-oe/recipes-bsp/efivar/efivar/fix-compile-failure-with-host-gcc-4.6.patch42
-rw-r--r--meta-oe/recipes-bsp/efivar/efivar/musl-strndupa.patch17
-rw-r--r--meta-oe/recipes-bsp/efivar/efivar_0.31.bb50
9 files changed, 315 insertions, 0 deletions
diff --git a/meta-oe/recipes-bsp/efivar/efivar/0001-efivar-dp.h-Add-Wunknown-attributes-when-using-clang.patch b/meta-oe/recipes-bsp/efivar/efivar/0001-efivar-dp.h-Add-Wunknown-attributes-when-using-clang.patch
new file mode 100644
index 000000000..1b8815e9d
--- /dev/null
+++ b/meta-oe/recipes-bsp/efivar/efivar/0001-efivar-dp.h-Add-Wunknown-attributes-when-using-clang.patch
@@ -0,0 +1,32 @@
1From 3d43c5efdb632da5d7387dcadce4e87b83929c64 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 24 Aug 2017 15:54:47 -0700
4Subject: [PATCH] efivar-dp.h: Add -Wunknown-attributes when using clang
5
6change !dp check to a comparision against NULL to silent clang warning
7nonnull parameter 'dp' will evaluate to 'true' on first encounter
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/include/efivar/efivar-dp.h | 12 +++++++-----
12 1 file changed, 7 insertions(+), 5 deletions(-)
13
14Index: git/src/include/efivar/efivar-dp.h
15===================================================================
16--- git.orig/src/include/efivar/efivar-dp.h
17+++ git/src/include/efivar/efivar-dp.h
18@@ -783,9 +783,14 @@ extern int efidp_append_instance(const_e
19 * though older or other compilers might just ignore that attribute if they
20 * don't support it. Ugh.
21 */
22+#pragma GCC diagnostic push
23 #if defined(__GNUC__) && __GNUC__ >= 6
24 #pragma GCC diagnostic ignored "-Wnonnull-compare"
25 #endif
26+#if defined(__clang__)
27+#pragma GCC diagnostic ignored "-Wunknown-attributes"
28+#pragma GCC diagnostic ignored "-Wpointer-bool-conversion"
29+#endif
30
31 static inline int16_t
32 __attribute__((__artificial__))
diff --git a/meta-oe/recipes-bsp/efivar/efivar/0001-efivar-fix-for-cross-compile.patch b/meta-oe/recipes-bsp/efivar/efivar/0001-efivar-fix-for-cross-compile.patch
new file mode 100644
index 000000000..6f6ca6475
--- /dev/null
+++ b/meta-oe/recipes-bsp/efivar/efivar/0001-efivar-fix-for-cross-compile.patch
@@ -0,0 +1,35 @@
1From 9a3c480af653b37e62d1be04d49fe7a60a80168f Mon Sep 17 00:00:00 2001
2From: Kai Kang <kai.kang@windriver.com>
3Date: Fri, 25 Sep 2015 18:14:31 +0800
4Subject: [PATCH 1/2] efivar: fix for cross compile
5
6It builds and calls elf file makeguids to generate a header file which
7doesn't work for cross compile. Fix it.
8
9Signed-off-by: Kai Kang <kai.kang@windriver.com>
10
11Upstream-Status: Pending
12Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
13
14---
15 src/Makefile | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/src/Makefile b/src/Makefile
19index 5fc7887..1829d22 100644
20--- a/src/Makefile
21+++ b/src/Makefile
22@@ -29,8 +29,8 @@ all : deps $(TARGETS)
23 ./guid-symbols.c : include/efivar/efivar-guids.h
24 ./guids.bin : include/efivar/efivar-guids.h
25 ./names.bin : include/efivar/efivar-guids.h
26-include/efivar/efivar-guids.h : makeguids guids.txt
27- ./makeguids guids.txt guids.bin names.bin \
28+include/efivar/efivar-guids.h : guids.txt
29+ makeguids guids.txt guids.bin names.bin \
30 guid-symbols.c include/efivar/efivar-guids.h
31
32 makeguids : CPPFLAGS+=-DEFIVAR_BUILD_ENVIRONMENT
33--
342.4.3
35
diff --git a/meta-oe/recipes-bsp/efivar/efivar/0001-makeguids-Do-not-use-__bswap_constant_-16-32-macros.patch b/meta-oe/recipes-bsp/efivar/efivar/0001-makeguids-Do-not-use-__bswap_constant_-16-32-macros.patch
new file mode 100644
index 000000000..73a772186
--- /dev/null
+++ b/meta-oe/recipes-bsp/efivar/efivar/0001-makeguids-Do-not-use-__bswap_constant_-16-32-macros.patch
@@ -0,0 +1,37 @@
1From 98b33d4193998687aa3a78c097f7bd4c393e0c85 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 15 Jul 2017 00:29:42 -0700
4Subject: [PATCH] makeguids: Do not use __bswap_constant_{16|32} macros
5
6not available on musl
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 src/makeguids.c | 8 ++++----
11 1 file changed, 4 insertions(+), 4 deletions(-)
12
13diff --git a/src/makeguids.c b/src/makeguids.c
14index da2f5f7..daf821a 100644
15--- a/src/makeguids.c
16+++ b/src/makeguids.c
17@@ -155,13 +155,13 @@ main(int argc, char *argv[])
18 #if BYTE_ORDER == BIG_ENDIAN\n\
19 #define cpu_to_be32(n) (n)\n\
20 #define cpu_to_be16(n) (n)\n\
21-#define cpu_to_le32(n) (__bswap_constant_32(n))\n\
22-#define cpu_to_le16(n) (__bswap_constant_16(n))\n\
23+#define cpu_to_le32(n) ((uint32_t) ((n)>>24 | (n)>>8&0xff00 | (n)<<8&0xff0000 | (n)<<24))\n\
24+#define cpu_to_le16(n) ((uint16_t) ((n)<<8 | (n)>>8))\n\
25 #else\n\
26 #define cpu_to_le32(n) (n)\n\
27 #define cpu_to_le16(n) (n)\n\
28-#define cpu_to_be32(n) (__bswap_constant_32(n))\n\
29-#define cpu_to_be16(n) (__bswap_constant_16(n))\n\
30+#define cpu_to_be32(n) ((uint32_t) ((n)>>24 | (n)>>8&0xff00 | (n)<<8&0xff0000 | (n)<<24))\n\
31+#define cpu_to_be16(n) ((uint16_t) ((n)<<8 | (n)>>8))\n\
32 #endif\n\
33 """);
34
35--
362.13.3
37
diff --git a/meta-oe/recipes-bsp/efivar/efivar/0003-efivar-fix-for-cross-compile.patch b/meta-oe/recipes-bsp/efivar/efivar/0003-efivar-fix-for-cross-compile.patch
new file mode 100644
index 000000000..3f43f2a93
--- /dev/null
+++ b/meta-oe/recipes-bsp/efivar/efivar/0003-efivar-fix-for-cross-compile.patch
@@ -0,0 +1,44 @@
1From 7ead29ca6bb5e280ae07551cc3521281ecf73682 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Sat, 7 May 2016 02:06:47 -0400
4Subject: [PATCH] Makefile: fix efivar.pc not found
5
6It fixes efivar.pc not found:
7...
8| install -d -m 755 efivar/0.23-r0/image/usr/lib/pkgconfig/
9| install -m 644 efivar.pc efivar/0.23-r0/image/usr/lib/pkgconfig/
10; install -m 644 efiboot.pc efivar/0.23-r0/image/usr/lib/pkgconfig/
11;
12| install: cannot stat 'efivar.pc': No such file or directory
13| install: cannot stat 'efiboot.pc': No such file or directory
14| make[1]: *** [install] Error 1
15| make[1]: Leaving directory `efivar/0.23-r0/git/src'
16| make: *** [install] Error 2
17| ERROR: oe_runmake failed
18...
19
20Upstream-Status: Pending
21
22Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
23---
24 src/Makefile | 4 +++-
25 1 file changed, 3 insertions(+), 1 deletion(-)
26
27diff --git a/src/Makefile b/src/Makefile
28index c7a0ca3..ad9c427 100644
29--- a/src/Makefile
30+++ b/src/Makefile
31@@ -78,7 +78,9 @@ install : all
32 ln -fs $(x).$(VERSION) $(DESTDIR)$(libdir)/$(x).$(MAJOR_VERSION);\
33 ln -fs $(x).$(VERSION) $(DESTDIR)$(libdir)/$(x); )
34 $(INSTALL) -d -m 755 $(DESTDIR)$(PCDIR)
35- $(foreach x, $(PCTARGETS), $(INSTALL) -m 644 $(x) $(DESTDIR)$(PCDIR) ;)
36+ $(foreach x, $(PCTARGETS), $(INSTALL) -m 644 $(TOPDIR)/src/$(x).in $(DESTDIR)$(PCDIR)/$(x) ;\
37+ sed -i -e "s:@@LIBDIR@@:$(libdir):g" -e "s:@@VERSION@@:$(VERSION):g" \
38+ $(DESTDIR)$(PCDIR)/$(x); )
39 $(INSTALL) -d -m 755 $(DESTDIR)$(includedir)/efivar
40 $(foreach x, $(wildcard $(TOPDIR)/src/include/efivar/*.h), $(INSTALL) -m 644 $(x) $(DESTDIR)$(includedir)/efivar/$(notdir $(x));)
41 $(INSTALL) -d -m 755 $(DESTDIR)$(bindir)
42--
432.8.1
44
diff --git a/meta-oe/recipes-bsp/efivar/efivar/0004-fix-unknow-option-for-gold-linker.patch b/meta-oe/recipes-bsp/efivar/efivar/0004-fix-unknow-option-for-gold-linker.patch
new file mode 100644
index 000000000..96d0c6b3b
--- /dev/null
+++ b/meta-oe/recipes-bsp/efivar/efivar/0004-fix-unknow-option-for-gold-linker.patch
@@ -0,0 +1,35 @@
1From b3d35e7dd27a755df5acbe050837885914dbb28b Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Tue, 10 May 2016 11:34:50 -0400
4Subject: [PATCH] fix unknow option for gold linker
5
6- Revert the following patch, since oe-core work with gcc 5
7...
8commit 3055a3797f16693dfdd855fa68bc57fd900dc408
9Author: Peter Jones <pjones@redhat.com>
10Date: Mon Feb 15 14:15:40 2016 -0500
11
12 Make gcc.specs work with gcc 6 / binutils 2.26
13
14 Apparently binutils 2.26 gets real picky about "ld -PIC" vs "ld -fPIC".
15
16 Signed-off-by: Peter Jones <pjones@redhat.com>
17...
18
19- Remove unknown option '--add-needed'
20
21Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
22---
23 gcc.specs | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26Index: git/gcc.specs
27===================================================================
28--- git.orig/gcc.specs
29+++ git/gcc.specs
30@@ -14,4 +14,4 @@
31 + %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now}
32
33 *link:
34-+ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
35++ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
diff --git a/meta-oe/recipes-bsp/efivar/efivar/allow-multi-definitions-for-native.patch b/meta-oe/recipes-bsp/efivar/efivar/allow-multi-definitions-for-native.patch
new file mode 100644
index 000000000..87f555509
--- /dev/null
+++ b/meta-oe/recipes-bsp/efivar/efivar/allow-multi-definitions-for-native.patch
@@ -0,0 +1,23 @@
1Upstream-Status: Pending
2
3It fails to create .so file when build efivar-native:
4
5| lib.o:(*IND*+0x0): multiple definition of `efi_set_variable'
6| lib.o:lib.c:(.text+0xa0): first defined here
7
8Add link option '-z muldefs' to fix it.
9
10Signed-off-by: Kai Kang <kai.kang@windriver.com>
11---
12diff --git a/Make.rules b/Make.rules
13index d9c0609..874bce0 100644
14--- a/Make.rules
15+++ b/Make.rules
16@@ -20,6 +20,7 @@ include $(TOPDIR)/Make.version
17 $(CCLD) $(ccldflags) $(CPPFLAGS) $(SOFLAGS) \
18 -Wl,-soname,$@.$(MAJOR_VERSION) \
19 -Wl,--version-script=$(MAP) \
20+ -Wl,-z,muldefs \
21 -o $@ $^ $(LDLIBS)
22
23 %.o : %.c
diff --git a/meta-oe/recipes-bsp/efivar/efivar/fix-compile-failure-with-host-gcc-4.6.patch b/meta-oe/recipes-bsp/efivar/efivar/fix-compile-failure-with-host-gcc-4.6.patch
new file mode 100644
index 000000000..e3fa2e1c1
--- /dev/null
+++ b/meta-oe/recipes-bsp/efivar/efivar/fix-compile-failure-with-host-gcc-4.6.patch
@@ -0,0 +1,42 @@
1From 1361225abbaba878960f970df39a4570bbc39553 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Thu, 26 May 2016 21:50:01 -0400
4Subject: [PATCH] fix compile failure with older host gcc (<=4.6)
5
6While host gcc version is 4.6.3 in ubuntu 1204, it
7did not recognize -std=gnu11 and -Wmaybe-uninitialized.
8
9While host gcc version is 4.4.7 in centos6, it
10did not recognize -std=gnu11, -Wmaybe-uninitialized,
11and -flto.
12
13For native build, use -std=gnu99 to replace -std=gnu11,
14and directly remove -Wmaybe-uninitialized and -flto.
15
16Upstream-Status: Pending
17
18Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
19---
20 gcc.specs | 4 ++--
21 1 file changed, 2 insertions(+), 2 deletions(-)
22
23Index: git/gcc.specs
24===================================================================
25--- git.orig/gcc.specs
26+++ git/gcc.specs
27@@ -2,13 +2,13 @@
28 + -D_GNU_SOURCE
29
30 *efivar_cpp_options:
31- -Werror -Wall -std=gnu11 -Wextra
32+ -Werror -Wall -std=gnu99 -Wextra
33
34 *cpp_options:
35 + %(efivar_cpp_options)
36
37 *cc1_options:
38-+ %(efivar_cpp_options) -Wmaybe-uninitialized -fno-merge-constants -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}}
39++ %(efivar_cpp_options) -fno-merge-constants -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}}
40
41 *self_spec:
42 + %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now}
diff --git a/meta-oe/recipes-bsp/efivar/efivar/musl-strndupa.patch b/meta-oe/recipes-bsp/efivar/efivar/musl-strndupa.patch
new file mode 100644
index 000000000..fc8f8c8b2
--- /dev/null
+++ b/meta-oe/recipes-bsp/efivar/efivar/musl-strndupa.patch
@@ -0,0 +1,17 @@
1Taken from void linux
2
3Index: git/src/linux.c
4===================================================================
5--- git.orig/src/linux.c
6+++ git/src/linux.c
7@@ -40,6 +40,10 @@
8 #include <efivar.h>
9 #include <efiboot.h>
10
11+#if !defined(__GLIBC__)
12+#define strndupa(x,s) strncpy(alloca(strlen(x)+1),x,s)
13+#endif
14+
15 #include "dp.h"
16 #include "linux.h"
17 #include "util.h"
diff --git a/meta-oe/recipes-bsp/efivar/efivar_0.31.bb b/meta-oe/recipes-bsp/efivar/efivar_0.31.bb
new file mode 100644
index 000000000..9d4cdc97b
--- /dev/null
+++ b/meta-oe/recipes-bsp/efivar/efivar_0.31.bb
@@ -0,0 +1,50 @@
1SUMMARY = "Tools to manipulate UEFI variables"
2DESCRIPTION = "efivar provides a simple command line interface to the UEFI variable facility"
3HOMEPAGE = "https://github.com/rhinstaller/efivar"
4
5LICENSE = "LGPLv2.1"
6LIC_FILES_CHKSUM = "file://COPYING;md5=6626bb1e20189cfa95f2c508ba286393"
7
8DEPENDS = "popt"
9DEPENDS_append_class-target = " efivar-native"
10
11inherit pkgconfig
12
13COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
14
15SRCREV = "11324799c68193116e1dd5f94b416591bd324f90"
16SRC_URI = "git://github.com/rhinstaller/efivar.git \
17 file://allow-multi-definitions-for-native.patch \
18 file://0001-makeguids-Do-not-use-__bswap_constant_-16-32-macros.patch \
19 file://musl-strndupa.patch \
20 file://0001-efivar-dp.h-Add-Wunknown-attributes-when-using-clang.patch \
21 "
22SRC_URI_append_class-target = " file://0001-efivar-fix-for-cross-compile.patch \
23 file://0003-efivar-fix-for-cross-compile.patch \
24 ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'file://0004-fix-unknow-option-for-gold-linker.patch', '', d)} \
25 "
26SRC_URI_append_class-native = " file://fix-compile-failure-with-host-gcc-4.6.patch \
27 "
28
29S = "${WORKDIR}/git"
30
31# Setting CROSS_COMPILE breaks pkgconfig, so just set AR
32EXTRA_OEMAKE = "AR=${TARGET_PREFIX}gcc-ar"
33
34do_compile_prepend() {
35 sed -i -e s:-Werror::g ${S}/gcc.specs
36}
37
38do_compile_class-native() {
39 oe_runmake -C src makeguids
40}
41
42do_install() {
43 oe_runmake install DESTDIR=${D}
44}
45
46do_install_class-native() {
47 install -D -m 0755 ${B}/src/makeguids ${D}${bindir}/makeguids
48}
49
50BBCLASSEXTEND = "native"