summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--patches/09_fix-link-without-avx.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/patches/09_fix-link-without-avx.patch b/patches/09_fix-link-without-avx.patch
new file mode 100644
index 0000000..df9b78f
--- /dev/null
+++ b/patches/09_fix-link-without-avx.patch
@@ -0,0 +1,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,