]> code.ossystems Code Review - meta-freescale.git/commitdiff
coreutils: fix the segfault issue of dd on e500v2 targets
authorZhenhua Luo <zhenhua.luo@freescale.com>
Mon, 19 Aug 2013 09:16:55 +0000 (09:16 +0000)
committerZhenhua Luo <zhenhua.luo@freescale.com>
Tue, 20 Aug 2013 09:49:32 +0000 (17:49 +0800)
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>
meta-fsl-ppc/recipes-core/coreutils/coreutils_8.21.bbappend [new file with mode: 0644]
meta-fsl-ppc/recipes-core/coreutils/files/coreutils-fix-dd-segfault-for-e500v2.patch [new file with mode: 0644]

diff --git a/meta-fsl-ppc/recipes-core/coreutils/coreutils_8.21.bbappend b/meta-fsl-ppc/recipes-core/coreutils/coreutils_8.21.bbappend
new file mode 100644 (file)
index 0000000..37d3ce2
--- /dev/null
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI_append_e500v2 = " file://coreutils-fix-dd-segfault-for-e500v2.patch \
+"
diff --git a/meta-fsl-ppc/recipes-core/coreutils/files/coreutils-fix-dd-segfault-for-e500v2.patch b/meta-fsl-ppc/recipes-core/coreutils/files/coreutils-fix-dd-segfault-for-e500v2.patch
new file mode 100644 (file)
index 0000000..dbeb9b2
--- /dev/null
@@ -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;