aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2016-05-30 03:39:23 -0400
committerMartin Jansa <Martin.Jansa@gmail.com>2016-06-08 14:55:24 +0200
commit0cce9fee049c3186cd07d791f602ada52e5afbc9 (patch)
tree34989061bd0cb1683650f983a04966810fb5a7df
parent25f31a59529a7df6895cd0df16a5b4541af86b33 (diff)
downloadmeta-openembedded-contrib-0cce9fee049c3186cd07d791f602ada52e5afbc9.tar.gz
efivar-native: fix compile failure with older host gcc (<=4.6)
While host gcc version is 4.6.3 in ubuntu 1204, it did not recognize -std=gnu11 and -Wmaybe-uninitialized. While host gcc version is 4.4.7 in centos6, it did not recognize -std=gnu11, -Wmaybe-uninitialized, and -flto. For native build, use -std=gnu99 to replace -std=gnu11, and directly remove -Wmaybe-uninitialized and -flto. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-extended/efivar/efivar/fix-compile-failure-with-host-gcc-4.6.patch45
-rw-r--r--meta-oe/recipes-extended/efivar/efivar_0.23.bb2
2 files changed, 47 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/efivar/efivar/fix-compile-failure-with-host-gcc-4.6.patch b/meta-oe/recipes-extended/efivar/efivar/fix-compile-failure-with-host-gcc-4.6.patch
new file mode 100644
index 0000000000..1c68a29344
--- /dev/null
+++ b/meta-oe/recipes-extended/efivar/efivar/fix-compile-failure-with-host-gcc-4.6.patch
@@ -0,0 +1,45 @@
+From 1361225abbaba878960f970df39a4570bbc39553 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 26 May 2016 21:50:01 -0400
+Subject: [PATCH] fix compile failure with older host gcc (<=4.6)
+
+While host gcc version is 4.6.3 in ubuntu 1204, it
+did not recognize -std=gnu11 and -Wmaybe-uninitialized.
+
+While host gcc version is 4.4.7 in centos6, it
+did not recognize -std=gnu11, -Wmaybe-uninitialized,
+and -flto.
+
+For native build, use -std=gnu99 to replace -std=gnu11,
+and directly remove -Wmaybe-uninitialized and -flto.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc.specs | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc.specs b/gcc.specs
+index 0d4bbda..3802ca6 100644
+--- a/gcc.specs
++++ b/gcc.specs
+@@ -2,13 +2,13 @@
+ + -D_GNU_SOURCE
+
+ *efivar_cpp_options:
+- -Werror -Wall -std=gnu11 -Wextra
++ -Werror -Wall -std=gnu99 -Wextra
+
+ *cpp_options:
+ + %(efivar_cpp_options)
+
+ *cc1_options:
+-+ %(efivar_cpp_options) -Wmaybe-uninitialized -fno-merge-constants -flto -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}}
+++ %(efivar_cpp_options) -fno-merge-constants -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}}
+
+ *self_spec:
+ + %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now}
+--
+2.8.1
+
diff --git a/meta-oe/recipes-extended/efivar/efivar_0.23.bb b/meta-oe/recipes-extended/efivar/efivar_0.23.bb
index 6e9a51fc95..046cad974a 100644
--- a/meta-oe/recipes-extended/efivar/efivar_0.23.bb
+++ b/meta-oe/recipes-extended/efivar/efivar_0.23.bb
@@ -14,6 +14,8 @@ SRC_URI_append_class-target = " file://0001-efivar-fix-for-cross-compile.patch \
file://0003-efivar-fix-for-cross-compile.patch \
file://0004-fix-unknow-option-for-gold-linker.patch \
"
+SRC_URI_append_class-native = " file://fix-compile-failure-with-host-gcc-4.6.patch \
+ "
S = "${WORKDIR}/git"