Patchwork [meta-fsl-ppc] coreutils: fix the segfault issue of dd on e500v2 targets

login
register
mail settings
Submitter Zhenhua Luo
Date Aug. 19, 2013, 9:16 a.m.
Message ID <1376903815-27758-1-git-send-email-zhenhua.luo@freescale.com>
Download mbox | patch
Permalink /patch/55967/
State Accepted
Headers show

Comments

Zhenhua Luo - Aug. 19, 2013, 9:16 a.m.
Since double-float is disabled for e500v2 targets build due to ICE
of gcc-4.8.1, accordingly %Ld format of sprintf is disabled.

Address Bug 4910 - [p1022ds]urandom: segmentation fault

Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
---
 recipes-core/coreutils/coreutils_8.21.bbappend     |    4 +++
 .../coreutils-fix-dd-segfault-for-e500v2.patch     |   37 ++++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 recipes-core/coreutils/coreutils_8.21.bbappend
 create mode 100644 recipes-core/coreutils/files/coreutils-fix-dd-segfault-for-e500v2.patch

Patch

diff --git a/recipes-core/coreutils/coreutils_8.21.bbappend b/recipes-core/coreutils/coreutils_8.21.bbappend
new file mode 100644
index 0000000..37d3ce2
--- /dev/null
+++ b/recipes-core/coreutils/coreutils_8.21.bbappend
@@ -0,0 +1,4 @@ 
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI_append_e500v2 = " file://coreutils-fix-dd-segfault-for-e500v2.patch \
+"
diff --git a/recipes-core/coreutils/files/coreutils-fix-dd-segfault-for-e500v2.patch b/recipes-core/coreutils/files/coreutils-fix-dd-segfault-for-e500v2.patch
new file mode 100644
index 0000000..dbeb9b2
--- /dev/null
+++ b/recipes-core/coreutils/files/coreutils-fix-dd-segfault-for-e500v2.patch
@@ -0,0 +1,37 @@ 
+Upstream-Status: Pending
+
+Fix the segmentation fault issue when using dd on e500v2 targets,
+use %f instead of $Lf, since single-float is used for e500v2 due to
+an ICE of gcc-4.8.1.
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
+
+--- coreutils-8.21/lib/human.c.orig	2013-08-16 05:17:24.466225177 -0500
++++ coreutils-8.21/lib/human.c	2013-08-16 05:17:52.007225123 -0500
+@@ -228,7 +228,7 @@
+ 
+     if (! (opts & human_autoscale))
+       {
+-        sprintf (buf, "%.0Lf", adjust_value (inexact_style, damt));
++        sprintf (buf, "%.0f", adjust_value (inexact_style, damt));
+         buflen = strlen (buf);
+         nonintegerlen = 0;
+       }
+@@ -246,7 +246,7 @@
+ 
+         damt /= e;
+ 
+-        sprintf (buf, "%.1Lf", adjust_value (inexact_style, damt));
++        sprintf (buf, "%.1f", adjust_value (inexact_style, damt));
+         buflen = strlen (buf);
+         nonintegerlen = decimal_pointlen + 1;
+ 
+@@ -254,7 +254,7 @@
+             || ((opts & human_suppress_point_zero)
+                 && buf[buflen - 1] == '0'))
+           {
+-            sprintf (buf, "%.0Lf",
++            sprintf (buf, "%.0f",
+                      adjust_value (inexact_style, damt * 10) / 10);
+             buflen = strlen (buf);
+             nonintegerlen = 0;