[OE-core] [PATCH] rpm: disable stack protector in popt

Ross Burton ross.burton at intel.com
Tue Mar 1 14:58:24 UTC 2016


The stack protector flags in the internal popt can cause link problems with rpm,
so disable them.

Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 .../rpm/rpm/popt-no-stack-protector.patch          | 27 ++++++++++++++++++++++
 meta/recipes-devtools/rpm/rpm_5.4.16.bb            |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 meta/recipes-devtools/rpm/rpm/popt-no-stack-protector.patch

diff --git a/meta/recipes-devtools/rpm/rpm/popt-no-stack-protector.patch b/meta/recipes-devtools/rpm/rpm/popt-no-stack-protector.patch
new file mode 100644
index 0000000..10fc6b1
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/popt-no-stack-protector.patch
@@ -0,0 +1,27 @@
+Disable the stack protector in popt as it causes problems with rpm is built
+without the stack protector.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton at intel.com>
+
+diff --git a/popt/configure.ac b/popt/configure.ac
+index ba70368..cf9a44d 100755
+--- a/popt/configure.ac
++++ b/popt/configure.ac
+@@ -123,7 +123,6 @@ AS_IF([test "x$popt_gcc_warnings" = xyes],
+   popt_CFLAGS_ADD([-Wjump-misses-init],[POPT_CFLAGS])
+   popt_CFLAGS_ADD([-Wno-format-nonliteral],[POPT_CFLAGS])
+   popt_CFLAGS_ADD([-Wframe-larger-than=$MAX_STACK_SIZE],[POPT_CFLAGS])
+-  popt_CFLAGS_ADD([-fstack-protector-all],[POPT_CFLAGS])
+   popt_CFLAGS_ADD([-fasynchronous-unwind-tables],[POPT_CFLAGS])
+   popt_CFLAGS_ADD([-fdiagnostics-show-option],[POPT_CFLAGS])
+   popt_CFLAGS_ADD([-funit-at-a-time],[POPT_CFLAGS])
+@@ -203,7 +202,7 @@ AC_SUBST([POPT_LDFLAGS])
+ # -fno-delete-null-pointer as the kernel does http://patchwork.kernel.org/patch/36060/
+ # GNU GCC (usually "gcc")
+ AS_IF([test "x$GCC" != x],
+- [ for c in -fno-delete-null-pointer-checks -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector -fexceptions
++ [ for c in -fno-delete-null-pointer-checks -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
+    do
+   	popt_CFLAGS_ADD([$c], [POPT_CFLAGS])
+    done
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.16.bb b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
index 4ca0997..7065c0f 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.16.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
@@ -129,6 +129,7 @@ SRC_URI += " \
 	   file://rpm-syck-fix-gram.patch \
 	   file://rpm-rpmdb-grammar.patch \
 	   file://rpm-disable-blaketest.patch \
+           file://popt-no-stack-protector.patch \
 "
 
 SRC_URI_append_libc-musl = "\
-- 
2.7.0




More information about the Openembedded-core mailing list