1 http://bugs.gentoo.org/353816
2 http://sourceware.org/ml/libc-alpha/2011-02/msg00015.html
4 From 7da767805f0a7301c0c719a6c0fd51d87e193c22 Mon Sep 17 00:00:00 2001
5 From: Mike Frysinger <vapier@gentoo.org>
6 Date: Sun, 6 Feb 2011 12:39:08 -0500
7 Subject: [PATCH] memcpy-ssse3: enable chk symbols in static builds
9 Building static apps on i686/x86_64 systems which use memmove such as:
12 main(int argc, char **argv) { memmove(buf, buf + argc, argc % 4); }
14 Result in linking errors along the lines of:
15 .../libc.a(memmove_chk.o): In function `__memmove_chk':
16 (.text+0x1b4): undefined reference to `__memmove_chk_ssse3_back'
17 .../libc.a(memmove_chk.o): In function `__memmove_chk':
18 (.text+0x1b9): undefined reference to `__memmove_chk_ssse3'
19 collect2: ld returned 1 exit status
21 This is due to the new ssse3 funcs only enabling their chk symbols when
22 being compiled into shared code.
24 URL: https://bugs.gentoo.org/353816
25 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
27 2011-02-06 Mike Frysinger <vapier@gentoo.org>
29 * sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S: Only protect
30 MEMCPY_CHK with USE_AS_BCOPY ifdef check.
31 * sysdeps/i386/i686/multiarch/memcpy-ssse3.S: Likewise.
32 * sysdeps/x86_64/multiarch/memcpy-ssse3.S: Likewise.
33 * sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: Likewise.
35 sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S | 2 +-
36 sysdeps/i386/i686/multiarch/memcpy-ssse3.S | 2 +-
37 sysdeps/x86_64/multiarch/memcpy-ssse3-back.S | 2 +-
38 sysdeps/x86_64/multiarch/memcpy-ssse3.S | 2 +-
39 4 files changed, 4 insertions(+), 4 deletions(-)
41 diff --git a/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S b/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
42 index 48a109c..8e81183 100644
43 --- a/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
44 +++ b/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
45 @@ -110,7 +110,7 @@ __i686.get_pc_thunk.bx:
48 .section .text.ssse3,"ax",@progbits
49 -#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BCOPY
50 +#if !defined USE_AS_BCOPY
54 diff --git a/sysdeps/i386/i686/multiarch/memcpy-ssse3.S b/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
55 index ec9eeb9..f64f8d2 100644
56 --- a/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
57 +++ b/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
58 @@ -110,7 +110,7 @@ __i686.get_pc_thunk.bx:
61 .section .text.ssse3,"ax",@progbits
62 -#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BCOPY
63 +#if !defined USE_AS_BCOPY
67 diff --git a/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S b/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
68 index 48c974e..bdd114a 100644
69 --- a/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
70 +++ b/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
74 .section .text.ssse3,"ax",@progbits
75 -#if defined SHARED && !defined NOT_IN_libc
76 +#if !defined USE_AS_BCOPY
79 jb HIDDEN_JUMPTARGET (__chk_fail)
80 diff --git a/sysdeps/x86_64/multiarch/memcpy-ssse3.S b/sysdeps/x86_64/multiarch/memcpy-ssse3.S
81 index 9a878d3..cd7e45f 100644
82 --- a/sysdeps/x86_64/multiarch/memcpy-ssse3.S
83 +++ b/sysdeps/x86_64/multiarch/memcpy-ssse3.S
87 .section .text.ssse3,"ax",@progbits
88 -#if defined SHARED && !defined NOT_IN_libc
89 +#if !defined USE_AS_BCOPY
92 jb HIDDEN_JUMPTARGET (__chk_fail)