summaryrefslogtreecommitdiffstats
path: root/patches/09_fix-link-without-avx.patch
blob: df9b78f14ccd92ef33591aa39f4beb771ddd359c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Description: Fix ld.so linking with HAVE_AVX_SUPPORT disabled
 sysdeps/x86_64/multiarch/ifunc-impl-list.c unconditionally uses *_avx symbols,
 but sysdeps/x86_64/multiarch/strcmp.S conditionally defines them.
 .
 This results in the following link error when a compiler without -mavx support
 is detected by sysdeps/x86_64/configure:
 .
     gcc   -shared -static-libgcc [...] -o /usr/src/eglibc_2.17~r22751+sip1-1/tmp/libcbuild/libc.so [...] -lgcc 
     /usr/src/eglibc_2.17~r22751+sip1-1/tmp/libcbuild/libc_pic.os: In function `__libc_ifunc_impl_list':
     /usr/src/eglibc_2.17~r22751+sip1-1/tmp/src/libc/misc/../sysdeps/x86_64/multiarch/ifunc-impl-list.c:96: undefined reference to `__strcasecmp_avx'
     /usr/bin/ld: /usr/src/eglibc_2.17~r22751+sip1-1/tmp/libcbuild/libc_pic.os: relocation R_X86_64_PC32 against undefined hidden symbol `__strcasecmp_avx' can not be used when making a shared object
     /usr/bin/ld: final link failed: Bad value
     collect2: error: ld returned 1 exit status
     make[2]: *** [/usr/src/eglibc_2.17~r22751+sip1-1/tmp/libcbuild/libc.so] Error 1
     make[2]: Leaving directory `/usr/src/eglibc_2.17~r22751+sip1-1/tmp/src/libc'
     make[1]: *** [all] Error 2
     make[1]: Leaving directory `/usr/src/eglibc_2.17~r22751+sip1-1/tmp/libcbuild'
     make: *** [build-libc] Error 2

diff -Naur src.orig/libc/sysdeps/x86_64/multiarch/ifunc-impl-list.c src/libc/sysdeps/x86_64/multiarch/ifunc-impl-list.c
--- src.orig/libc/sysdeps/x86_64/multiarch/ifunc-impl-list.c	2012-10-25 13:18:12.000000000 -0400
+++ src/libc/sysdeps/x86_64/multiarch/ifunc-impl-list.c	2013-06-26 15:44:53.310685644 -0400
@@ -94,8 +94,10 @@
 
   /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S.  */
   IFUNC_IMPL (i, name, strcasecmp,
+#ifdef HAVE_AVX_SUPPORT
 	      IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_AVX,
 			      __strcasecmp_avx)
+#endif
 	      IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_SSE4_2,
 			      __strcasecmp_sse42)
 	      IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_SSSE3,
@@ -104,8 +106,10 @@
 
   /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S.  */
   IFUNC_IMPL (i, name, strcasecmp_l,
+#ifdef HAVE_AVX_SUPPORT
 	      IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_AVX,
 			      __strcasecmp_l_avx)
+#endif
 	      IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_SSE4_2,
 			      __strcasecmp_l_sse42)
 	      IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_SSSE3,
@@ -151,8 +155,10 @@
 
   /* Support sysdeps/x86_64/multiarch/strncase_l.S.  */
   IFUNC_IMPL (i, name, strncasecmp,
+#ifdef HAVE_AVX_SUPPORT
 	      IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_AVX,
 			      __strncasecmp_avx)
+#endif
 	      IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_SSE4_2,
 			      __strncasecmp_sse42)
 	      IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_SSSE3,
@@ -162,8 +168,10 @@
 
   /* Support sysdeps/x86_64/multiarch/strncase_l.S.  */
   IFUNC_IMPL (i, name, strncasecmp_l,
+#ifdef HAVE_AVX_SUPPORT
 	      IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_AVX,
 			      __strncasecmp_l_avx)
+#endif
 	      IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_SSE4_2,
 			      __strncasecmp_l_sse42)
 	      IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_SSSE3,