arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone

Blame SOURCES/glibc-rh731837-11.patch

147e83
From 0c36ea57312ce701930b879d49b3f64cead222d8 Mon Sep 17 00:00:00 2001
147e83
From: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
147e83
Date: Wed, 30 Jul 2014 05:48:25 -0500
147e83
Subject: [PATCH] PowerPC: multiarch strncasecmp for PowerPC64
147e83
147e83
commit 1c92d9a0e0be6175915128157036cf138ef64af8
147e83
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
147e83
Date:   Fri Dec 13 14:40:28 2013 -0500
147e83
---
147e83
 sysdeps/powerpc/powerpc64/multiarch/Makefile       |  6 +++-
147e83
 .../powerpc/powerpc64/multiarch/ifunc-impl-list.c  | 15 ++++++++
147e83
 .../powerpc/powerpc64/multiarch/strncase-power7.c  | 24 +++++++++++++
147e83
 sysdeps/powerpc/powerpc64/multiarch/strncase.c     | 41 +++++++++++++++++++++
147e83
 .../powerpc64/multiarch/strncase_l-power7.c        | 25 +++++++++++++
147e83
 sysdeps/powerpc/powerpc64/multiarch/strncase_l.c   | 42 ++++++++++++++++++++++
147e83
 6 files changed, 152 insertions(+), 1 deletion(-)
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strncase.c
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
147e83
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
147e83
index 5e172da..4dca756 100644
147e83
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
147e83
@@ -6,5 +6,9 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
147e83
                   mempcpy-power7 mempcpy-ppc64 memchr-power7 memchr-ppc64 \
147e83
                   memrchr-power7 memrchr-ppc64 rawmemchr-power7 \
147e83
                   rawmemchr-ppc64 strlen-power7 strlen-ppc64 strnlen-power7 \
147e83
-                  strnlen-ppc64 strcasecmp-power7 strcasecmp_l-power7
147e83
+                  strnlen-ppc64 strcasecmp-power7 strcasecmp_l-power7 \
147e83
+                  strncase-power7 strncase_l-power7
147e83
+
147e83
+CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
147e83
+CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
147e83
 endif
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
147e83
index ba78d97..4b8fb22 100644
147e83
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
147e83
@@ -151,5 +151,20 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
147e83
              IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
147e83
                              __strcasecmp_l_ppc))
147e83
 
147e83
+  /* Support sysdeps/powerpc/powerpc64/multiarch/strncase.c.  */
147e83
+  IFUNC_IMPL (i, name, strncasecmp,
147e83
+             IFUNC_IMPL_ADD (array, i, strncasecmp,
147e83
+                             hwcap & PPC_FEATURE_HAS_VSX,
147e83
+                             __strncasecmp_power7)
147e83
+             IFUNC_IMPL_ADD (array, i, strncasecmp, 1, __strncasecmp_ppc))
147e83
+
147e83
+  /* Support sysdeps/powerpc/powerpc64/multiarch/strncase_l.c.  */
147e83
+  IFUNC_IMPL (i, name, strncasecmp_l,
147e83
+             IFUNC_IMPL_ADD (array, i, strncasecmp_l,
147e83
+                             hwcap & PPC_FEATURE_HAS_VSX,
147e83
+                             __strncasecmp_l_power7)
147e83
+             IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1,
147e83
+                             __strncasecmp_l_ppc))
147e83
+
147e83
   return i;
147e83
 }
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c
147e83
new file mode 100644
147e83
index 0000000..9c5dbab
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase-power7.c
147e83
@@ -0,0 +1,24 @@
147e83
+/* Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+#include <string.h>
147e83
+
147e83
+#define __strncasecmp __strncasecmp_power7
147e83
+
147e83
+extern __typeof (strncasecmp) __strncasecmp_power7 attribute_hidden;
147e83
+
147e83
+#include <string/strncase.c>
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase.c
147e83
new file mode 100644
147e83
index 0000000..05eba7c
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase.c
147e83
@@ -0,0 +1,41 @@
147e83
+/* Multiple versions of strncasecmp
147e83
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+#ifndef NOT_IN_libc
147e83
+# include <string.h>
147e83
+# define strncasecmp __strncasecmp_ppc
147e83
+extern __typeof (__strncasecmp) __strncasecmp_ppc attribute_hidden;
147e83
+extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
147e83
+#endif
147e83
+
147e83
+#include <string/strncase.c>
147e83
+#undef strncasecmp
147e83
+
147e83
+#ifndef NOT_IN_libc
147e83
+# include <shlib-compat.h>
147e83
+# include "init-arch.h"
147e83
+
147e83
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
147e83
+   ifunc symbol properly.  */
147e83
+extern __typeof (__strncasecmp) __libc_strncasecmp;
147e83
+libc_ifunc (__libc_strncasecmp,
147e83
+	     (hwcap & PPC_FEATURE_HAS_VSX)
147e83
+             ? __strncasecmp_power7
147e83
+             : __strncasecmp_ppc);
147e83
+weak_alias (__libc_strncasecmp, strncasecmp)
147e83
+#endif
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
147e83
new file mode 100644
147e83
index 0000000..8c8cd8d
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
147e83
@@ -0,0 +1,25 @@
147e83
+/* Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+#include <string.h>
147e83
+
147e83
+#define __strncasecmp_l __strncasecmp_l_power7
147e83
+#define USE_IN_EXTENDED_LOCALE_MODEL    1
147e83
+
147e83
+extern __typeof (strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
147e83
+
147e83
+#include <string/strncase.c>
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
147e83
new file mode 100644
147e83
index 0000000..4014269
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
147e83
@@ -0,0 +1,42 @@
147e83
+/* Multiple versions of strncasecmp_l
147e83
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
147e83
+   This file is part of the GNU C Library.
147e83
+
147e83
+   The GNU C Library is free software; you can redistribute it and/or
147e83
+   modify it under the terms of the GNU Lesser General Public
147e83
+   License as published by the Free Software Foundation; either
147e83
+   version 2.1 of the License, or (at your option) any later version.
147e83
+
147e83
+   The GNU C Library is distributed in the hope that it will be useful,
147e83
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
+   Lesser General Public License for more details.
147e83
+
147e83
+   You should have received a copy of the GNU Lesser General Public
147e83
+   License along with the GNU C Library; if not, see
147e83
+   <http://www.gnu.org/licenses/>.  */
147e83
+
147e83
+#ifndef NOT_IN_libc
147e83
+# include <string.h>
147e83
+# define strncasecmp_l __strncasecmp_l_ppc
147e83
+extern __typeof (__strncasecmp_l) __strncasecmp_l_ppc attribute_hidden;
147e83
+extern __typeof (__strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
147e83
+#endif
147e83
+
147e83
+#include <string/strncase_l.c>
147e83
+#undef strncasecmp_l
147e83
+
147e83
+#ifndef NOT_IN_libc
147e83
+# include <shlib-compat.h>
147e83
+# include "init-arch.h"
147e83
+
147e83
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
147e83
+   ifunc symbol properly.  */
147e83
+extern __typeof (__strncasecmp_l) __libc_strncasecmp_l;
147e83
+libc_ifunc (__libc_strncasecmp_l,
147e83
+	     (hwcap & PPC_FEATURE_HAS_VSX)
147e83
+             ? __strncasecmp_l_power7
147e83
+             : __strncasecmp_l_ppc);
147e83
+
147e83
+weak_alias (__libc_strncasecmp_l, strncasecmp_l)
147e83
+#endif
147e83
-- 
147e83
1.8.3.1
147e83