00db10
From c86e89a09d187da3aca1ee7ff9bfee4957fe70ff Mon Sep 17 00:00:00 2001
00db10
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
00db10
Date: Tue, 28 Jul 2015 15:34:25 -0300
00db10
Subject: [PATCH] powerpc: Fix strstr/power7 build
00db10
00db10
This patch fixes the strstr build with --disable-multi-arch option.
00db10
The optimization calls the __strstr_ppc symbol, which always build
00db10
for multiarch config but not if it is disable.  This patch fixes it
00db10
by adding the default C implementation object with the expected
00db10
symbol name.
00db10
00db10
	* sysdeps/powerpc/powerpc64/power7/Makefile [$(subdir) = string]
00db10
	(sysdep_routines): Add strstr-ppc64.
00db10
	* sysdeps/powerpc/powerpc64/power7/strstr-ppc64.c: New file.
00db10
00db10
(cherry picked from commit 357bb400f1b25e48e265fd55b5996328d2a8c142)
00db10
---
00db10
 ChangeLog                                       |  6 ++++++
00db10
 sysdeps/powerpc/powerpc64/power7/Makefile       |  1 +
00db10
 sysdeps/powerpc/powerpc64/power7/strstr-ppc64.c | 27 +++++++++++++++++++++++++
00db10
 3 files changed, 34 insertions(+)
00db10
 create mode 100644 sysdeps/powerpc/powerpc64/power7/strstr-ppc64.c
00db10
00db10
diff --git a/ChangeLog b/ChangeLog
00db10
index 8e98192..d70df5c 100644
00db10
diff --git a/sysdeps/powerpc/powerpc64/power7/Makefile b/sysdeps/powerpc/powerpc64/power7/Makefile
00db10
index 40aacfa..89a2296 100644
00db10
--- a/sysdeps/powerpc/powerpc64/power7/Makefile
00db10
+++ b/sysdeps/powerpc/powerpc64/power7/Makefile
00db10
@@ -5,6 +5,7 @@ CFLAGS-rtld.c += -mno-vsx
00db10
 endif
00db10
 
00db10
 ifeq ($(subdir),string)
00db10
+sysdep_routines += strstr-ppc64
00db10
 CFLAGS-strncase.c += -funroll-loops
00db10
 CFLAGS-strncase_l.c += -funroll-loops
00db10
 endif
00db10
diff --git a/sysdeps/powerpc/powerpc64/power7/strstr-ppc64.c b/sysdeps/powerpc/powerpc64/power7/strstr-ppc64.c
00db10
new file mode 100644
00db10
index 0000000..bbab92d
00db10
--- /dev/null
00db10
+++ b/sysdeps/powerpc/powerpc64/power7/strstr-ppc64.c
00db10
@@ -0,0 +1,27 @@
00db10
+/* Optimized strstr implementation for PowerPC64/POWER7.
00db10
+   Copyright (C) 2015 Free Software Foundation, Inc.
00db10
+   This file is part of the GNU C Library.
00db10
+
00db10
+   The GNU C Library is free software; you can redistribute it and/or
00db10
+   modify it under the terms of the GNU Lesser General Public
00db10
+   License as published by the Free Software Foundation; either
00db10
+   version 2.1 of the License, or (at your option) any later version.
00db10
+
00db10
+   The GNU C Library is distributed in the hope that it will be useful,
00db10
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00db10
+   Lesser General Public License for more details.
00db10
+
00db10
+   You should have received a copy of the GNU Lesser General Public
00db10
+   License along with the GNU C Library; if not, see
00db10
+   <http://www.gnu.org/licenses/>.  */
00db10
+
00db10
+#include <string.h>
00db10
+
00db10
+#define STRSTR __strstr_ppc
00db10
+#undef libc_hidden_builtin_def
00db10
+#define libc_hidden_builtin_def(__name)
00db10
+
00db10
+extern __typeof (strstr) __strstr_ppc attribute_hidden;
00db10
+
00db10
+#include <string/strstr.c>
00db10
-- 
00db10
2.1.0
00db10