[oe-commits] Ting Liu : strace: fix 64 bit process detection

git at git.openembedded.org git at git.openembedded.org
Fri Jul 18 23:09:49 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: 72a4e7202f42f7ae4b6c1ca9a769c3604bb28524
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=72a4e7202f42f7ae4b6c1ca9a769c3604bb28524

Author: Ting Liu <b28495 at freescale.com>
Date:   Wed Jul 16 17:38:11 2014 +0800

strace: fix 64 bit process detection

Signed-off-by: Ting Liu <b28495 at freescale.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 .../strace-fix-64-bit-process-detection.patch      | 34 ++++++++++++++++++++++
 meta/recipes-devtools/strace/strace_4.8.bb         |  1 +
 2 files changed, 35 insertions(+)

diff --git a/meta/recipes-devtools/strace/strace-4.8/strace-fix-64-bit-process-detection.patch b/meta/recipes-devtools/strace/strace-4.8/strace-fix-64-bit-process-detection.patch
new file mode 100644
index 0000000..a6579df
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace-4.8/strace-fix-64-bit-process-detection.patch
@@ -0,0 +1,34 @@
+powerpc64: fix 64-bit process detection on embedded
+
+* syscall.c (get_scno) [POWERPC64]: Fix 64-bit process detection
+on embedded powerpc.
+
+Upstream-Status: Backport
+
+Signed-off-by: James Yang <james.yang at freescale.com>
+Signed-off-by: Dmitry V. Levin <ldv at altlinux.org>
+
+diff --git a/syscall.c.orig b/syscall.c
+index 7efee0e..72d9453 100644
+--- a/syscall.c.orig
++++ b/syscall.c
+@@ -1207,11 +1207,14 @@ get_scno(struct tcb *tcp)
+ 	/* Check for 64/32 bit mode. */
+ 	if (upeek(tcp, sizeof(unsigned long)*PT_MSR, &val) < 0)
+ 		return -1;
+-	/* SF is bit 0 of MSR */
+-	if (val < 0)
+-		currpers = 0;
+-	else
+-		currpers = 1;
++
++	/*
++	 * Check for 64/32 bit mode.
++	 * Embedded implementations covered by Book E extension of PPC use
++	 * bit 0 (CM) of 32-bit Machine state register (MSR).
++	 * Other implementations use bit 0 (SF) of 64-bit MSR.
++	 */
++	currpers = (val & 0x8000000080000000) ? 0 : 1;
+ 	update_personality(tcp, currpers);
+ # endif
+ #elif defined(AVR32)
diff --git a/meta/recipes-devtools/strace/strace_4.8.bb b/meta/recipes-devtools/strace/strace_4.8.bb
index 71563d4..d954c37 100644
--- a/meta/recipes-devtools/strace/strace_4.8.bb
+++ b/meta/recipes-devtools/strace/strace_4.8.bb
@@ -8,6 +8,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.xz \
            file://git-version-gen \
            file://strace-add-configure-options.patch \
            file://Makefile-ptest.patch \
+           file://strace-fix-64-bit-process-detection.patch \
            file://run-ptest \
           "
 



More information about the Openembedded-commits mailing list