]> code.ossystems Code Review - openembedded-core.git/commitdiff
glibc: Fix __memcpy_chk on non-SSE2 CPUs
authorAndre McCurdy <armccurdy@gmail.com>
Tue, 2 Jun 2015 01:06:44 +0000 (18:06 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 28 Jun 2015 08:41:58 +0000 (09:41 +0100)
Backport from upstream glibc:

  https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=132a1328eccd20621b77f7810eebbeec0a1af187

Note that the fix is only required when glibc is built for i686/multiarch,
so is not applicable in the default oe-core x86 configuration (which builds
glibc for i586 and therefore does not include SSE2 optimised memcpy etc).

(From OE-Core rev: e643b9bc4c459ea8b59573cf67f2494388e7a377)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/glibc/glibc/Fix-__memcpy_chk-on-non-SSE2-CPUs.patch [new file with mode: 0644]
meta/recipes-core/glibc/glibc_2.21.bb

diff --git a/meta/recipes-core/glibc/glibc/Fix-__memcpy_chk-on-non-SSE2-CPUs.patch b/meta/recipes-core/glibc/glibc/Fix-__memcpy_chk-on-non-SSE2-CPUs.patch
new file mode 100644 (file)
index 0000000..2e768bb
--- /dev/null
@@ -0,0 +1,36 @@
+From 132a1328eccd20621b77f7810eebbeec0a1af187 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Tue, 10 Feb 2015 03:22:58 +0000
+Subject: [PATCH] Fix __memcpy_chk on non-SSE2 CPUs
+
+In commit 8b4416d, the 1: jump label in __mempcpy_chk was accidentally
+moved.  This resulted in failures of mempcpy on CPU without SSE2.
+
+Upstream-Status: Backport
+
+  https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=132a1328eccd20621b77f7810eebbeec0a1af187
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+---
+ sysdeps/i386/i686/multiarch/mempcpy_chk.S | 4 ++--
+ 3 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/sysdeps/i386/i686/multiarch/mempcpy_chk.S b/sysdeps/i386/i686/multiarch/mempcpy_chk.S
+index 207b648..b6fa202 100644
+--- a/sysdeps/i386/i686/multiarch/mempcpy_chk.S
++++ b/sysdeps/i386/i686/multiarch/mempcpy_chk.S
+@@ -36,8 +36,8 @@ ENTRY(__mempcpy_chk)
+       cmpl    $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
+       jne     1f
+       call    __init_cpu_features
+-      leal    __mempcpy_chk_ia32@GOTOFF(%ebx), %eax
+-1:    testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
++1:    leal    __mempcpy_chk_ia32@GOTOFF(%ebx), %eax
++      testl   $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+       jz      2f
+       leal    __mempcpy_chk_sse2_unaligned@GOTOFF(%ebx), %eax
+       testl   $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx)
+-- 
+1.9.1
+
index d2be7310451c448267eabe0efc6d25521f001fde..a0b2f2dee8145e8bde34308f886b5d0877148cbb 100644 (file)
@@ -27,6 +27,7 @@ SRC_URI = "git://sourceware.org/git/glibc.git;branch=${BRANCH} \
            file://0001-yes-within-the-path-sets-wrong-config-variables.patch \
            file://elf-Makefile-fix-a-typo.patch \
            file://makesyscall.patch \
+           file://Fix-__memcpy_chk-on-non-SSE2-CPUs.patch \
            ${EGLIBCPATCHES} \
            ${CVEPATCHES} \
           "