Skip to contentSkip to conversation

fix python md5/sha checksum incorrect on qemu86-64 with corei7-64 as DEFAULTTUNE

PATCH In review Hongxu Jia 3 participants 8 messages Dec 2, 2015 – Dec 8, 2015

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover fix python md5/sha checksum incorrect on qemu86-64 with corei7-64 as DEFAULTTUNE

The following changes since commit 698c74c373110ed081a7586e21d4a27b8b44c89b:

libsdl: remove redundant configure_tweak patch (2015-12-01 21:32:15 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-python
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-python

Hongxu Jia (1):
python: gcc optimization level 2

 ...001-configure.ac-gcc-optimization-level-2.patch | 40 ++++++++++++++++++++++
 meta/recipes-devtools/python/python_2.7.9.bb       |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python/0001-configure.ac-gcc-optimization-level-2.patch
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 python: gcc optimization level 2

The qemu didn't support '-march=corei7 -mtune=corei7' and gcc optimization level 3 '-O3' very well, in which the /usr/lib64/python2.7/test/test_md5.py and /usr/lib64/python2.7/test/test_sha.py failed.

So we use gcc optimization level 2 to instead.

YOCTO [# 8747]

---
 ...001-configure.ac-gcc-optimization-level-2.patch | 40 ++++++++++++++++++++++
 meta/recipes-devtools/python/python_2.7.9.bb       |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python/0001-configure.ac-gcc-optimization-level-2.patch
meta/recipes-devtools/python/python/0001-configure.ac-gcc-optimization-level-2.patch new file +40 -0
new file mode 100644
index 0000000..f760403
@@ -0,0 +1,40 @@
+From 55520995fa6c72f6a93a7ccc8503167f359bc63d Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Mon, 30 Nov 2015 06:25:08 -0500
+Subject: [PATCH] configure.ac: gcc optimization level 2
+
+The qemu didn't support '-march=corei7 -mtune=corei7' and
+gcc optimization level 3 '-O3' very well, in which the
+/usr/lib64/python2.7/test/test_md5.py and
+/usr/lib64/python2.7/test/test_sha.py failed.
+
+So we use gcc optimization level 2 to instead.
+
+Upstream-Status: Inappropriate [qemu corei7 specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 87a4f02..d3ad673 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1076,11 +1076,11 @@ then
+ 		# debug builds.
+ 		OPT="-g -O0 -Wall $STRICT_PROTO"
+ 	    else
+-		OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
++		OPT="-g $WRAP -O2 -Wall $STRICT_PROTO"
+ 	    fi
+ 	    ;;
+ 	*)
+-	    OPT="-O3 -Wall $STRICT_PROTO"
++	    OPT="-O2 -Wall $STRICT_PROTO"
+ 	    ;;
+ 	esac
+ 	case $ac_sys_system in
+-- 
+1.9.1
+
meta/recipes-devtools/python/python_2.7.9.bb +1 -0
index bc20417..12dd7fa 100644
@@ -26,6 +26,7 @@ SRC_URI += "\
   file://parallel-makeinst-create-bindir.patch \
   file://use_sysroot_ncurses_instead_of_host.patch \
   file://avoid_parallel_make_races_on_pgen.patch \
+  file://0001-configure.ac-gcc-optimization-level-2.patch \
 "
 
 S = "${WORKDIR}/Python-${PV}"
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH 1/1] python: gcc optimization level 2

Quoted 9 lines · Hongxu Jia

The qemu didn't support '-march=corei7 -mtune=corei7' and gcc optimization level 3 '-O3' very well, in which the /usr/lib64/python2.7/test/test_md5.py and /usr/lib64/python2.7/test/test_sha.py failed.

So we use gcc optimization level 2 to instead.

YOCTO [# 8747]

Has anyone decided if this is a bug in the compiler, or the Python code making assumptions that don't hold at -O3?

Ross

author
#3 lore raw

Re: [PATCH 1/1] python: gcc optimization level 2

Quoted 8 lines · Ross

On 2 December 2015 at 05:06, Hongxu Jia <[email protected] <mailto:[email protected]>> wrote:

The qemu didn't support '-march=corei7 -mtune=corei7' and gcc optimization level 3 '-O3' very well, in which the /usr/lib64/python2.7/test/test_md5.py and /usr/lib64/python2.7/test/test_sha.py failed.

Quoted 7 lines

So we use gcc optimization level 2 to instead.

YOCTO [# 8747]

Has anyone decided if this is a bug in the compiler, or the Python code making assumptions that don't hold at -O3?

The root cause is the qemu didn't support gcc optimization level 3 very well.

This fix is a workaround, and I file another defect to trace the root cause.
https://bugzilla.yoctoproject.org/show_bug.cgi?id=8748

//Hongxu

Quoted 1 line

Ross

#4 lore raw

Re: [PATCH 1/1] python: gcc optimization level 2

Quoted 3 lines · Hongxu Jia

The root cause is the qemu didn't support gcc optimization level 3 very well.

Oh, so the problem only appears in qemu if you enable tuning that is known to be broken in qemu? I don't think we should apply the Python workaround to oe-core as everyone will suffer for a configuration that is known to be broken (and isn't enabled in oe-core).

Ross

author
#5 lore raw

Re: [PATCH 1/1] python: gcc optimization level 2

Quoted 8 lines · Ross

On 2 December 2015 at 09:51, Hongxu Jia <[email protected] <mailto:[email protected]>> wrote:

The root cause is the qemu didn't support gcc optimization level 3 very well.

Oh, so the problem only appears in qemu if you enable tuning that is known to be broken in qemu?

Yes, since I tested qemux86/qemux86-64 with default tune, and everything is ok.

Quoted 1 line

I don't think we should apply the Python workaround to oe-core as everyone will suffer for a configuration that is known to be broken (and isn't enabled in oe-core).

Trace the issue costs a lot of time, the original failure was invoking 'smart update' in qemu, and found out the python md5/sha checksum output incorrect, and then found out qemu86-64 with corei7-64 did not support gcc optimization level 3 '-O3' very well [YOCTO #8748]

BTW, boot the same image with virtualbox, everything is ok

//Hongxu

Quoted 2 lines

Ross

#6 lore raw

Re: [PATCH 1/1] python: gcc optimization level 2

Quoted 5 lines · Hongxu Jia

Trace the issue costs a lot of time, the original failure was invoking 'smart update' in qemu, and found out the python md5/sha checksum output incorrect, and then found out qemu86-64 with corei7-64 did not support gcc optimization level 3 '-O3' very well [YOCTO #8748]

Sure. So you've found out that Python is broken, but who knows what else is broken?

Ross

#7 lore raw

Re: [PATCH 1/1] python: gcc optimization level 2

In reply to Hongxu Jia
Quoted 12 lines · Hongxu Jia
Quoted 5 lines · Ross

On 2 December 2015 at 09:51, Hongxu Jia <[email protected] <mailto:[email protected]>> wrote:
The root cause is the qemu didn't support gcc optimization level 3 very well.

Oh, so the problem only appears in qemu if you enable tuning that is known to be broken in qemu?

Yes, since I tested qemux86/qemux86-64 with default tune, and everything is ok.

Quoted 9 lines
Quoted 1 line

I don't think we should apply the Python workaround to oe-core as everyone will suffer for a configuration that is known to be broken (and isn't enabled in oe-core).

Trace the issue costs a lot of time, the original failure was invoking 'smart update' in qemu, and found out the python md5/sha checksum output incorrect, and then found out qemu86-64 with corei7-64 did not support gcc optimization level 3 '-O3' very well [YOCTO #8748]

BTW, boot the same image with virtualbox, everything is ok

This is a Qemu bug, So it should be persued in that direction. Secondly, this patch should be applied only for emulator BSPs and not across the board

Quoted 10 lines

//Hongxu

Quoted 2 lines

Ross

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core