diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index 73f2f69..5296ce7 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -1,35 +1,74 @@
+ifeq (,$(findstring -DMULTI_ARCH,$(sysdep-CPPFLAGS)))
+ifneq (,$(filter %le,$(config-machine)))
+sysdep-CPPFLAGS += -DMULTI_ARCH_POWER8=1
+endif
+endif
+
 ifeq ($(subdir),math)
 # These functions are built both for libc and libm because they're required
 # by printf.  While the libc objects have the prefix s_, the libm ones are
 # prefixed with  m_.
-sysdep_calls := s_copysign-power6 s_copysign-ppc64 \
-		s_finite-power8 s_finite-power7 s_finite-ppc64 \
-		s_finitef-ppc64 \
-		s_isinf-power8 s_isinf-ppc64 \
-		s_isinff-ppc64 s_isinf-power7 \
-		s_isnan-power8 s_isnan-power7 s_isnan-power6x s_isnan-power6 \
-		s_isnan-power5 s_isnan-ppc64 \
-		s_modf-power5+ s_modf-ppc64 \
-		s_modff-power5+ s_modff-ppc64
+sysdep_calls := \
+	s_copysign-power6 \
+	s_finite-power8 \
+	s_isinf-power8 \
+	s_isnan-power8 \
+	s_modf-power5+ \
+	s_modff-power5+
+
+ifeq (,$(findstring -DMULTI_ARCH_POWER8=1,$(sysdep-CPPFLAGS)))
+sysdep_calls += \
+	s_copysign-ppc64 \
+	s_finite-power7 s_finite-ppc64 s_finitef-ppc64 \
+	s_isinf-power7 s_isinf-ppc64 s_isinff-ppc64 \
+	s_isnan-power7 s_isnan-power6x s_isnan-power6 s_isnan-power5 \
+		s_isnan-ppc64 \
+	s_modf-ppc64 \
+	s_modff-ppc64
+endif
 
 sysdep_routines += $(sysdep_calls)
-libm-sysdep_routines += s_llround-power6x \
-			s_llround-power5+ s_llround-ppc64 s_ceil-power5+ \
-			s_ceil-ppc64 s_ceilf-power5+ s_ceilf-ppc64 \
-			s_floor-power5+ s_floor-ppc64 s_floorf-power5+ \
-			s_floorf-ppc64 s_round-power5+ s_round-ppc64 \
-			s_roundf-power5+ s_roundf-ppc64 s_trunc-power5+ \
-			s_trunc-ppc64 s_truncf-power5+ s_truncf-ppc64 \
-			s_llrint-power6x s_llrint-ppc64 \
-			s_logb-power7 s_logbf-power7 \
-			s_logbl-power7 s_logb-ppc64 s_logbf-ppc64 \
-			s_logbl-ppc64 e_hypot-ppc64 \
-			e_hypot-power7 e_hypotf-ppc64 e_hypotf-power7 \
-			s_llrint-power8 s_llround-power8 s_llroundf-ppc64 \
-			e_expf-power8 e_expf-ppc64 \
-			s_sinf-ppc64 s_sinf-power8 \
-			s_cosf-ppc64 s_cosf-power8 \
-			$(sysdep_calls:s_%=m_%)
+libm-sysdep_routines += $(sysdep_calls:s_%=m_%) \
+	e_expf-power8 \
+	e_hypot-power7 \
+	e_hypotf-power7 \
+	s_ceil-power5+ \
+	s_ceilf-power5+ \
+	s_cosf-power8 \
+	s_floor-power5+ \
+	s_floorf-power5+ \
+	s_llrint-power8 \
+	s_llround-power8 \
+	s_logb-power7 \
+	s_logbf-power7 \
+	s_logbl-power7 \
+	s_round-power5+ \
+	s_roundf-power5+ \
+	s_sinf-power8 \
+	s_trunc-power5+ \
+	s_truncf-power5+
+
+ifeq (,$(findstring -DMULTI_ARCH_POWER8=1,$(sysdep-CPPFLAGS)))
+libm-sysdep_routines += \
+	e_expf-ppc64 \
+	e_hypot-ppc64 \
+	e_hypotf-ppc64 \
+	s_ceil-ppc64 \
+	s_ceilf-ppc64 \
+	s_cosf-ppc64 \
+	s_floor-ppc64 \
+	s_floorf-ppc64 \
+	s_llrint-power6x s_llrint-ppc64 \
+	s_llround-power6x s_llround-power5+ s_llround-ppc64 s_llroundf-ppc64 \
+	s_logb-ppc64 \
+	s_logbf-ppc64 \
+	s_logbl-ppc64 \
+	s_round-ppc64 \
+	s_roundf-ppc64 \
+	s_sinf-ppc64 \
+	s_trunc-ppc64 \
+	s_truncf-ppc64
+endif
 
 CFLAGS-s_logbf-power7.c = -mcpu=power7
 CFLAGS-s_logbl-power7.c = -mcpu=power7
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S
index c0c3adc..928236f 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#undef strong_alias
-#define strong_alias(a, b)
+#ifndef MULTI_ARCH_POWER8
+# undef strong_alias
+# define strong_alias(a, b)
 
-#define __ieee754_expf __ieee754_expf_power8
+# define __ieee754_expf __ieee754_expf_power8
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/fpu/e_expf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf.c
index 5770936..c738c89 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf.c
@@ -16,9 +16,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include "init-arch.h"
 
 extern __typeof (__ieee754_expf) __ieee754_expf_ppc64 attribute_hidden;
 extern __typeof (__ieee754_expf) __ieee754_expf_power8 attribute_hidden;
@@ -29,3 +30,4 @@ libc_ifunc (__ieee754_expf,
 	    : __ieee754_expf_ppc64);
 
 strong_alias (__ieee754_expf, __expf_finite)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c
index dbe9b33..5e85126 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot-power7.c
@@ -16,4 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypot-power7.c>
+#ifndef MULTI_ARCH_POWER8
+# undef strong_alias
+# define strong_alias(a, b)
+
+# define __ieee754_hypot __ieee754_hypot_power7
+#endif
+
+#include <sysdeps/powerpc/fpu/e_hypot.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c
index 6a3d60a..934d2ec 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypot.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__ieee754_hypot) __ieee754_hypot_ppc64 attribute_hidden;
 extern __typeof (__ieee754_hypot) __ieee754_hypot_power7 attribute_hidden;
@@ -30,3 +31,4 @@ libc_ifunc (__ieee754_hypot,
             : __ieee754_hypot_ppc64);
 
 strong_alias (__ieee754_hypot, __hypot_finite)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c
index 7058486..80e8f4d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf-power7.c
@@ -16,4 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdeps/powerpc/powerpc32/power4/fpu/multiarch/e_hypotf-power7.c>
+#ifndef MULTI_ARCH_POWER8
+# undef strong_alias
+# define strong_alias(a, b)
+
+# define __ieee754_hypotf __ieee754_hypotf_power7
+#endif
+
+#include <sysdeps/powerpc/fpu/e_hypotf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c
index 2c8112d..a728d8e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_hypotf.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__ieee754_hypotf) __ieee754_hypotf_ppc64 attribute_hidden;
 extern __typeof (__ieee754_hypotf) __ieee754_hypotf_power7 attribute_hidden;
@@ -30,3 +31,4 @@ libc_ifunc (__ieee754_hypotf,
             : __ieee754_hypotf_ppc64);
 
 strong_alias (__ieee754_hypotf, __hypotf_finite)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S
index 535298d..7cb0201 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S
@@ -16,15 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <shlib-compat.h>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
 
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a,b,c,d)
+# undef weak_alias
+# define weak_alias(a,b)
+# undef strong_alias
+# define strong_alias(a,b)
+# undef compat_symbol
+# define compat_symbol(a,b,c,d)
 
-#define __ceil __ceil_power5plus
+# define __ceil __ceil_power5plus
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c
index 968e8cb..9a7984d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__ceil) __ceil_ppc64 attribute_hidden;
 extern __typeof (__ceil) __ceil_power5plus attribute_hidden;
@@ -31,10 +32,11 @@ libc_ifunc (__ceil,
 
 weak_alias (__ceil, ceil)
 
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__ceil, __ceill)
 weak_alias (__ceil, ceill)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+# endif
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __ceil, ceill, GLIBC_2_0);
+# endif
 #endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S
index 9ac2771..45548df 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#undef weak_alias
-#define weak_alias(a,b)
+#ifndef MULTI_ARCH_POWER8
+# undef weak_alias
+# define weak_alias(a,b)
 
-#define __ceilf __ceilf_power5plus
+# define __ceilf __ceilf_power5plus
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c
index 7d4a028..2c2444c 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__ceilf) __ceilf_ppc64 attribute_hidden;
 extern __typeof (__ceilf) __ceilf_power5plus attribute_hidden;
@@ -30,3 +31,4 @@ libc_ifunc (__ceilf,
             : __ceilf_ppc64);
 
 weak_alias (__ceilf, ceilf)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S
index 7150c32..92a0438 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S
@@ -16,17 +16,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <shlib-compat.h>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
 
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a, b, c, d)
-#undef hidden_def
-#define hidden_def(name)
+# undef weak_alias
+# define weak_alias(a,b)
+# undef strong_alias
+# define strong_alias(a,b)
+# undef compat_symbol
+# define compat_symbol(a, b, c, d)
+# undef hidden_def
+# define hidden_def(name)
 
-#define __copysign __copysign_power6
+# define __copysign __copysign_power6
+#endif
 
 #include <sysdeps/powerpc/powerpc64/fpu/s_copysign.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c
index 2bfb625..6c35ea5 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c
@@ -16,15 +16,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef MULTI_ARCH_POWER8
 /* Redefine copysign so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias below.  */
-#undef __copysign
-#define __copysign __redirect_copysign
-#include <math.h>
-#include <math_ldbl_opt.h>
-#undef __copysign
-#include <shlib-compat.h>
-#include "init-arch.h"
+# undef __copysign
+# define __copysign __redirect_copysign
+# include <math.h>
+# include <math_ldbl_opt.h>
+# undef __copysign
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__redirect_copysign) __copysign_ppc64 attribute_hidden;
 extern __typeof (__redirect_copysign) __copysign_power6 attribute_hidden;
@@ -38,14 +39,15 @@ libc_ifunc (__libm_copysign,
 strong_alias (__libm_copysign, __copysign)
 weak_alias (__copysign, copysign)
 
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 weak_alias (__copysign,copysignl)
 strong_alias(__copysign,__copysignl)
-#endif
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
 # endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+# if IS_IN (libm)
+#  if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
+#  endif
+# elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
+# endif
 #endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c
index c9be2b6..12a3346 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c
@@ -16,9 +16,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 /* It's safe to use double-precision implementation for single-precision. */
 extern __typeof (__copysignf) __copysign_ppc64 attribute_hidden;
@@ -30,3 +31,4 @@ libc_ifunc (__copysignf,
             : __copysign_ppc64);
 
 weak_alias (__copysignf, copysignf)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S
index 29a59e9..87aca8e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#undef weak_alias
-#define weak_alias(a,b)
+#ifndef MULTI_ARCH_POWER8
+# undef weak_alias
+# define weak_alias(a,b)
 
-#define __cosf __cosf_power8
+# define __cosf __cosf_power8
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c
index acf2a59..ef162a6 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c
@@ -16,9 +16,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__cosf) __cosf_ppc64 attribute_hidden;
 extern __typeof (__cosf) __cosf_power8 attribute_hidden;
@@ -29,3 +30,4 @@ libc_ifunc (__cosf,
 	    : __cosf_ppc64);
 
 weak_alias (__cosf, cosf)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S
index 686aa5a..0b1c5af 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S
@@ -16,17 +16,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <shlib-compat.h>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
 
-#undef hidden_def
-#define hidden_def(name)
-#undef weak_alias
-#define weak_alias(name, alias)
-#undef strong_alias
-#define strong_alias(name, alias)
-#undef compat_symbol
-#define compat_symbol(lib, name, symbol, ver)
+# undef hidden_def
+# define hidden_def(name)
+# undef weak_alias
+# define weak_alias(name, alias)
+# undef strong_alias
+# define strong_alias(name, alias)
+# undef compat_symbol
+# define compat_symbol(lib, name, symbol, ver)
 
-#define __finite __finite_power8
+# define __finite __finite_power8
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
index 7efc84b..6142ca8 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
@@ -16,29 +16,30 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define __finite __redirect___finite
+#ifndef MULTI_ARCH_POWER8
+# define __finite __redirect___finite
 
 /* The following definitions, although not related to the 'double'
    version of 'finite', are required to guarantee macro expansions
    (e.g.: from __finitef to __redirect_finitef) in include/math.h, thus
    compensating for the unintended macro expansions in
    math/bits/mathcalls-helper-functions.h.  */
-#define __finitef __redirect___finitef
-#define __finitel __redirect___finitel
-#define __finitef128 __redirect___finitef128
+# define __finitef __redirect___finitef
+# define __finitel __redirect___finitel
+# define __finitef128 __redirect___finitef128
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__finite) __finite_ppc64 attribute_hidden;
 extern __typeof (__finite) __finite_power7 attribute_hidden;
 extern __typeof (__finite) __finite_power8 attribute_hidden;
-#undef __finite
-#undef __finitef
-#undef __finitel
-#undef __finitef128
+# undef __finite
+# undef __finitef
+# undef __finitel
+# undef __finitef128
 
 libc_ifunc_redirected (__redirect___finite, __finite,
 		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
@@ -49,21 +50,22 @@ libc_ifunc_redirected (__redirect___finite, __finite,
 
 weak_alias (__finite, finite)
 
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__finite, __finitel)
 weak_alias (__finite, finitel)
-#endif
+# endif
 
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+# if IS_IN (libm)
+#  if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
 compat_symbol (libm, finite, finitel, GLIBC_2_0);
-# endif
-# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1)
+#  endif
+#  if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1)
 compat_symbol (libm, __finite, __finitel, GLIBC_2_1);
-# endif
-#else
-# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
+#  endif
+# else
+#  if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
 compat_symbol (libc, __finite, __finitel, GLIBC_2_0);
 compat_symbol (libc, finite, finitel, GLIBC_2_0);
+#  endif
 # endif
 #endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
index cdd7824..ab6e9f1 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c
@@ -16,16 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define __finitef __redirect___finitef
-#include <math.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# define __finitef __redirect___finitef
+# include <math.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__finitef) __finitef_ppc64 attribute_hidden;
 /* The double-precision version also works for single-precision.  */
 extern __typeof (__finitef) __finite_power7 attribute_hidden;
 extern __typeof (__finitef) __finite_power8 attribute_hidden;
-#undef __finitef
+# undef __finitef
 
 libc_ifunc_redirected (__redirect___finitef, __finitef,
 		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
@@ -35,3 +36,4 @@ libc_ifunc_redirected (__redirect___finitef, __finitef,
 			 : __finitef_ppc64);
 
 weak_alias (__finitef, finitef)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S
index 33640b4..3a97f1b 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S
@@ -16,15 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <shlib-compat.h>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
 
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a,b,c,d)
+# undef weak_alias
+# define weak_alias(a,b)
+# undef strong_alias
+# define strong_alias(a,b)
+# undef compat_symbol
+# define compat_symbol(a,b,c,d)
 
-#define __floor __floor_power5plus
+# define __floor __floor_power5plus
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c
index 6ab7a35..37ef5e7 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__floor) __floor_ppc64 attribute_hidden;
 extern __typeof (__floor) __floor_power5plus attribute_hidden;
@@ -31,10 +32,11 @@ libc_ifunc (__floor,
 
 weak_alias (__floor, floor)
 
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__floor, __floorl)
 weak_alias (__floor, floorl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+# endif
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __floor, floorl, GLIBC_2_0);
+# endif
 #endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S
index c7b3065..60ae06e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#undef weak_alias
-#define weak_alias(a,b)
+#ifndef MULTI_ARCH_POWER8
+# undef weak_alias
+# define weak_alias(a,b)
 
-#define __floorf __floorf_power5plus
+# define __floorf __floorf_power5plus
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c
index ee96536..1b4d3ec 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__floorf) __floorf_ppc64 attribute_hidden;
 extern __typeof (__floorf) __floorf_power5plus attribute_hidden;
@@ -30,3 +31,4 @@ libc_ifunc (__floorf,
             : __floorf_ppc64);
 
 weak_alias (__floorf, floorf)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S
index 3545e20..e46af1c 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S
@@ -16,17 +16,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <shlib-compat.h>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
 
-#undef hidden_def
-#define hidden_def(name)
-#undef weak_alias
-#define weak_alias(name, alias)
-#undef strong_alias
-#define strong_alias(name, alias)
-#undef compat_symbol
-#define compat_symbol(lib, name, alias, ver)
+# undef hidden_def
+# define hidden_def(name)
+# undef weak_alias
+# define weak_alias(name, alias)
+# undef strong_alias
+# define strong_alias(name, alias)
+# undef compat_symbol
+# define compat_symbol(lib, name, alias, ver)
 
-#define __isinf __isinf_power8
+# define __isinf __isinf_power8
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
index b79bdd5..d5289f0 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
@@ -16,29 +16,30 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define __isinf __redirect___isinf
+#ifndef MULTI_ARCH_POWER8
+# define __isinf __redirect___isinf
 
 /* The following definitions, although not related to the 'double'
    version of 'isinf', are required to guarantee macro expansions
    (e.g.: from __isinff to __redirect_isinff) in include/math.h, thus
    compensating for the unintended macro expansions in
    math/bits/mathcalls-helper-functions.h.  */
-#define __isinff __redirect___isinff
-#define __isinfl __redirect___isinfl
-#define __isinff128 __redirect___isinff128
+# define __isinff __redirect___isinff
+# define __isinfl __redirect___isinfl
+# define __isinff128 __redirect___isinff128
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__isinf) __isinf_ppc64 attribute_hidden;
 extern __typeof (__isinf) __isinf_power7 attribute_hidden;
 extern __typeof (__isinf) __isinf_power8 attribute_hidden;
-#undef __isinf
-#undef __isinff
-#undef __isinfl
-#undef __isinff128
+# undef __isinf
+# undef __isinff
+# undef __isinfl
+# undef __isinff128
 
 libc_ifunc_redirected (__redirect___isinf, __isinf,
 		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
@@ -49,14 +50,15 @@ libc_ifunc_redirected (__redirect___isinf, __isinf,
 
 weak_alias (__isinf, isinf)
 
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__isinf, __isinfl)
 weak_alias (__isinf, isinfl)
-#endif
+# endif
 
-#if !IS_IN (libm)
-# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
+# if !IS_IN (libm)
+#  if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
 compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
 compat_symbol (libc, isinf, isinfl, GLIBC_2_0);
+#  endif
 # endif
 #endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
index 439e0b8..7d8a2d3 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c
@@ -16,17 +16,18 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define __isinff __redirect___isinff
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# define __isinff __redirect___isinff
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__isinff) __isinff_ppc64 attribute_hidden;
 /* The double-precision version also works for single-precision.  */
 extern __typeof (__isinff) __isinf_power7 attribute_hidden;
 extern __typeof (__isinff) __isinf_power8 attribute_hidden;
-#undef __isinff
+# undef __isinff
 
 libc_ifunc_redirected (__redirect___isinff, __isinff,
 		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
@@ -36,3 +37,4 @@ libc_ifunc_redirected (__redirect___isinff, __isinff,
 			 : __isinff_ppc64);
 
 weak_alias (__isinff, isinff)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S
index db84dc0..f6ccbbe 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S
@@ -16,17 +16,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <shlib-compat.h>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
 
-#undef hidden_def
-#define hidden_def(name)
-#undef weak_alias
-#define weak_alias(name, alias)
-#undef strong_alias
-#define strong_alias(name, alias)
-#undef compat_symbol
-#define compat_symbol(lib, name, symbol, ver)
+# undef hidden_def
+# define hidden_def(name)
+# undef weak_alias
+# define weak_alias(name, alias)
+# undef strong_alias
+# define strong_alias(name, alias)
+# undef compat_symbol
+# define compat_symbol(lib, name, symbol, ver)
 
-#define __isnan __isnan_power8
+# define __isnan __isnan_power8
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
index a8127e8..b9ea291 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
@@ -16,21 +16,22 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define __isnan __redirect___isnan
+#ifndef MULTI_ARCH_POWER8
+# define __isnan __redirect___isnan
 
 /* The following definitions, although not related to the 'double'
    version of 'isnan', are required to guarantee macro expansions
    (e.g.: from __isnanf to __redirect_isnanf) in include/math.h, thus
    compensating for the unintended macro expansions in
    math/bits/mathcalls-helper-functions.h.  */
-#define __isnanf __redirect___isnanf
-#define __isnanl __redirect___isnanl
-#define __isnanf128 __redirect___isnanf128
+# define __isnanf __redirect___isnanf
+# define __isnanl __redirect___isnanl
+# define __isnanf128 __redirect___isnanf128
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__isnan) __isnan_ppc64 attribute_hidden;
 extern __typeof (__isnan) __isnan_power5 attribute_hidden;
@@ -38,10 +39,10 @@ extern __typeof (__isnan) __isnan_power6 attribute_hidden;
 extern __typeof (__isnan) __isnan_power6x attribute_hidden;
 extern __typeof (__isnan) __isnan_power7 attribute_hidden;
 extern __typeof (__isnan) __isnan_power8 attribute_hidden;
-#undef __isnan
-#undef __isnanf
-#undef __isnanl
-#undef __isnanf128
+# undef __isnan
+# undef __isnanf
+# undef __isnanl
+# undef __isnanf128
 
 libc_ifunc_redirected (__redirect___isnan, __isnan,
 		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
@@ -58,14 +59,15 @@ libc_ifunc_redirected (__redirect___isnan, __isnan,
 
 weak_alias (__isnan, isnan)
 
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
-#endif
+# endif
 
-#if !IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+# if !IS_IN (libm)
+#  if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
 compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
+#  endif
 # endif
 #endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c
index 958c373..d4fd10e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c
@@ -16,8 +16,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include "init-arch.h"
 
 /* The double-precision implementation also works for the single one.  */
 extern __typeof (__isnanf) __isnan_ppc64 attribute_hidden;
@@ -42,3 +43,4 @@ libc_ifunc_hidden (__isnanf, __isnanf,
 
 hidden_def (__isnanf)
 weak_alias (__isnanf, isnanf)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S
index 69aed9c8..7633405 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S
@@ -16,15 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <shlib-compat.h>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
 
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a,b,c,d)
+# undef weak_alias
+# define weak_alias(a,b)
+# undef strong_alias
+# define strong_alias(a,b)
+# undef compat_symbol
+# define compat_symbol(a,b,c,d)
 
-#define __llrint __llrint_power8
+# define __llrint __llrint_power8
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c
index 8db494c..8977d29 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c
@@ -16,17 +16,18 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef MULTI_ARCH_POWER8
 /* Redefine lrint/__lrint so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias below.  */
-#define lrint __hidden_lrint
-#define __lrint __hidden___lrint
+# define lrint __hidden_lrint
+# define __lrint __hidden___lrint
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#undef lrint
-#undef __lrint
-#include <shlib-compat.h>
-#include "init-arch.h"
+# include <math.h>
+# include <math_ldbl_opt.h>
+# undef lrint
+# undef __lrint
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__llrint) __llrint_ppc64 attribute_hidden;
 extern __typeof (__llrint) __llrint_power6x attribute_hidden;
@@ -40,21 +41,22 @@ libc_ifunc (__llrint,
             : __llrint_ppc64);
 
 weak_alias (__llrint, llrint)
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__llrint, __llrintl)
 weak_alias (__llrint, llrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+# endif
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
 compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
-#endif
+# endif
 
 /* long has the same width as long long on PowerPC64.  */
 strong_alias (__llrint, __lrint)
 weak_alias (__lrint, lrint)
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__lrint, __lrintl)
 weak_alias (__lrint, lrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+# endif
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
 compat_symbol (libm, __lrint, lrintl, GLIBC_2_1);
+# endif
 #endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c
index 330fe96..96dd545 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c
@@ -15,15 +15,17 @@
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
+
+#ifndef MULTI_ARCH_POWER8
 /* Redefine lrintf/__lrintf so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias below.  */
-#define lrintf __hidden_lrintf
-#define __lrintf __hidden___lrintf
+# define lrintf __hidden_lrintf
+# define __lrintf __hidden___lrintf
 
-#include <math.h>
-#undef lrintf
-#undef __lrintf
-#include "init-arch.h"
+# include <math.h>
+# undef lrintf
+# undef __lrintf
+# include "init-arch.h"
 
 extern __typeof (__llrintf) __llrint_ppc64 attribute_hidden;
 extern __typeof (__llrintf) __llrint_power6x attribute_hidden;
@@ -44,3 +46,4 @@ libc_ifunc (__llrintf,
 weak_alias (__llrintf, llrintf)
 strong_alias (__llrintf, __lrintf)
 weak_alias (__lrintf, lrintf)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S
index d301d7d..72a4957 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S
@@ -16,16 +16,18 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <shlib-compat.h>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
 
-#undef weak_alias
-#define weak_alias(name, alias)
-#undef strong_alias
-#define strong_alias(name, alias)
-#undef compat_symbol
-#define compat_symbol(lib, name, alias, ver)
+# undef weak_alias
+# define weak_alias(name, alias)
+# undef strong_alias
+# define strong_alias(name, alias)
+# undef compat_symbol
+# define compat_symbol(lib, name, alias, ver)
 
-#define __llround __llround_power6x
-#define __lround __lround_power6x
+# define __llround __llround_power6x
+# define __lround __lround_power6x
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S
index 5a2a2a6..a9541ec 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S
@@ -16,15 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <shlib-compat.h>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
 
-#undef weak_alias
-#define weak_alias(name, alias)
-#undef strong_alias
-#define strong_alias(name, alias)
-#undef compat_symbol
-#define compat_symbol(lib, name, alias, ver)
+# undef weak_alias
+# define weak_alias(name, alias)
+# undef strong_alias
+# define strong_alias(name, alias)
+# undef compat_symbol
+# define compat_symbol(lib, name, alias, ver)
 
-#define __llround __llround_power8
+# define __llround __llround_power8
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
index cb1a446..1f906e2 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
@@ -16,13 +16,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define lround __hidden_lround
-#define __lround __hidden___lround
+#ifndef MULTI_ARCH_POWER8
+# define lround __hidden_lround
+# define __lround __hidden___lround
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__llround) __llround_ppc64 attribute_hidden;
 extern __typeof (__llround) __llround_power5plus attribute_hidden;
@@ -40,24 +41,25 @@ libc_ifunc (__llround,
 
 weak_alias (__llround, llround)
 
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 weak_alias (__llround, llroundl)
 strong_alias (__llround, __llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+# endif
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
 compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
 compat_symbol (libm, llround, lroundl, GLIBC_2_1);
-#endif
+# endif
 
 /* long has the same width as long long on PPC64.  */
-#undef lround
-#undef __lround
+# undef lround
+# undef __lround
 strong_alias (__llround, __lround)
 weak_alias (__llround, lround)
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__llround, __llroundl)
 weak_alias (__llround, llroundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+# endif
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
 compat_symbol (libm, __lround, lroundl, GLIBC_2_1);
+# endif
 #endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c
index 1e34b5d..3bfe2c4 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c
@@ -15,15 +15,17 @@
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
+
+#ifndef MULTI_ARCH_POWER8
 /* Redefine lroundf/__lroundf so that the compiler won't complain about
    the type mismatch with the IFUNC selector in strong_alias below.  */
-#define lroundf __hidden_lroundf
-#define __lroundf __hidden___lroundf
+# define lroundf __hidden_lroundf
+# define __lroundf __hidden___lroundf
 
-#include <math.h>
-#undef lroundf
-#undef __lroundf
-#include "init-arch.h"
+# include <math.h>
+# undef lroundf
+# undef __lroundf
+# include "init-arch.h"
 
 extern __typeof (__llroundf) __llroundf_ppc64 attribute_hidden;
 extern __typeof (__llroundf) __llround_power6x attribute_hidden;
@@ -44,3 +46,4 @@ libc_ifunc (__llroundf,
 weak_alias (__llroundf, llroundf)
 strong_alias (__llroundf, __lroundf)
 weak_alias (__lroundf, lroundf)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c
index 73b5e2d..0907fb2 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb-power7.c
@@ -16,4 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb-power7.c>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
+
+# undef weak_alias
+# define weak_alias(a, b)
+# undef strong_alias
+# define strong_alias(a, b)
+# undef compat_symbol
+# define compat_symbol(lib, name, alias, ver)
+
+# define __logb __logb_power7
+#endif
+
+#include <sysdeps/powerpc/power7/fpu/s_logb.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c
index d70919e..c9f412e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__logb) __logb_ppc64 attribute_hidden;
 extern __typeof (__logb) __logb_power7 attribute_hidden;
@@ -31,11 +32,12 @@ libc_ifunc (__logb,
 
 weak_alias (__logb, logb)
 
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__logb, __logbl)
 weak_alias (__logb, logbl)
-#endif
+# endif
 
-#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
 compat_symbol (libm, logb, logbl, GLIBC_2_0);
+# endif
 #endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c
index 02e0431..e04cc06 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf-power7.c
@@ -16,4 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf-power7.c>
+#ifndef MULTI_ARCH_POWER8
+# undef weak_alias
+# define weak_alias(a, b)
+
+# define __logbf __logbf_power7
+#endif
+
+#include <sysdeps/powerpc/power7/fpu/s_logbf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c
index 1cacc8a..deecfcc 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__logbf) __logbf_ppc64 attribute_hidden;
 extern __typeof (__logbf) __logbf_power7 attribute_hidden;
@@ -30,3 +31,4 @@ libc_ifunc (__logbf,
             : __logbf_ppc64);
 
 weak_alias (__logbf, logbf)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c
index 60ec533..fa7201b 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl-power7.c
@@ -16,4 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbl-power7.c>
+#ifndef MULTI_ARCH_POWER8
+# define __logbl __logbl_power7
+#endif
+
+#include <sysdeps/powerpc/power7/fpu/s_logbl.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c
index 63b9c81..49a5ded 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbl.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__logbl) __logbl_ppc64 attribute_hidden;
 extern __typeof (__logbl) __logbl_power7 attribute_hidden;
@@ -30,3 +31,4 @@ libc_ifunc (__logbl,
             : __logbl_ppc64);
 
 long_double_symbol (libm, __logbl, logbl);
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c
index c923f84..6dcd22e 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf-power5+.c
@@ -16,4 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf-power5+.c>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
+
+# undef weak_alias
+# define weak_alias(a,b)
+# undef strong_alias
+# define strong_alias(a,b)
+# undef compat_symbol
+# define compat_symbol(a,b,c,d)
+
+# define __modf __modf_power5plus
+#endif
+
+#include <sysdeps/powerpc/power5+/fpu/s_modf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c
index 3e79b2b..3f8dbde 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__modf) __modf_ppc64 attribute_hidden;
 extern __typeof (__modf) __modf_power5plus attribute_hidden;
@@ -31,14 +32,15 @@ libc_ifunc (__modf,
 
 weak_alias (__modf, modf)
 
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__modf, __modfl)
 weak_alias (__modf, modfl)
-#endif
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __modf, modfl, GLIBC_2_0);
 # endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+# if IS_IN (libm)
+#  if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __modf, modfl, GLIBC_2_0);
+#  endif
+# elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
 compat_symbol (libc, __modf, modfl, GLIBC_2_0);
+# endif
 #endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c
index 22dbf53..1741c9d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff-power5+.c
@@ -16,4 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff-power5+.c>
+#ifndef MULTI_ARCH_POWER8
+# undef weak_alias
+# define weak_alias(a,b)
+
+# define __modff __modff_power5plus
+#endif
+
+#include <sysdeps/powerpc/power5+/fpu/s_modff.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c
index f57939c..b0248a1 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c
@@ -16,8 +16,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include "init-arch.h"
 
 extern __typeof (__modff) __modff_ppc64 attribute_hidden;
 extern __typeof (__modff) __modff_power5plus attribute_hidden;
@@ -28,3 +29,4 @@ libc_ifunc (__modff,
             : __modff_ppc64);
 
 weak_alias (__modff, modff)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S
index e5bcd92..c2f45cd 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S
@@ -16,15 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <shlib-compat.h>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
 
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a,b,c,d)
+# undef weak_alias
+# define weak_alias(a,b)
+# undef strong_alias
+# define strong_alias(a,b)
+# undef compat_symbol
+# define compat_symbol(a,b,c,d)
 
-#define __round __round_power5plus
+# define __round __round_power5plus
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c
index d440f6f..bf6257a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__round) __round_ppc64 attribute_hidden;
 extern __typeof (__round) __round_power5plus attribute_hidden;
@@ -31,10 +32,11 @@ libc_ifunc (__round,
 
 weak_alias (__round, round)
 
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__round, __roundl)
 weak_alias (__round, roundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+# endif
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __round, roundl, GLIBC_2_0);
+# endif
 #endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S
index b8a142e..220adb4 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#undef weak_alias
-#define weak_alias(a,b)
+#ifndef MULTI_ARCH_POWER8
+# undef weak_alias
+# define weak_alias(a,b)
 
-#define __roundf __roundf_power5plus
+# define __roundf __roundf_power5plus
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c
index 09609d3..7d4c85d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__roundf) __roundf_ppc64 attribute_hidden;
 extern __typeof (__roundf) __roundf_power5plus attribute_hidden;
@@ -30,3 +31,4 @@ libc_ifunc (__roundf,
             : __roundf_ppc64);
 
 weak_alias (__roundf, roundf)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S
index aaf80e5..b8bb32a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#undef weak_alias
-#define weak_alias(a, b)
+#ifndef MULTI_ARCH_POWER8
+# undef weak_alias
+# define weak_alias(a, b)
 
-#define __sinf __sinf_power8
+# define __sinf __sinf_power8
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf.c
index 6d7d6ce..3c60a15 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf.c
@@ -16,9 +16,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__sinf) __sinf_ppc64 attribute_hidden;
 extern __typeof (__sinf) __sinf_power8 attribute_hidden;
@@ -29,3 +30,4 @@ libc_ifunc (__sinf,
             : __sinf_ppc64);
 
 weak_alias (__sinf, sinf)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S
index 83ed3c2..6c908db 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S
@@ -16,15 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <shlib-compat.h>
+#ifndef MULTI_ARCH_POWER8
+# include <shlib-compat.h>
 
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a,b,c,d)
+# undef weak_alias
+# define weak_alias(a,b)
+# undef strong_alias
+# define strong_alias(a,b)
+# undef compat_symbol
+# define compat_symbol(a,b,c,d)
 
-#define __trunc __trunc_power5plus
+# define __trunc __trunc_power5plus
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c
index 54844d5..691fb20 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__trunc) __trunc_ppc64 attribute_hidden;
 extern __typeof (__trunc) __trunc_power5plus attribute_hidden;
@@ -31,10 +32,11 @@ libc_ifunc (__trunc,
 
 weak_alias (__trunc, trunc)
 
-#ifdef NO_LONG_DOUBLE
+# ifdef NO_LONG_DOUBLE
 strong_alias (__trunc, __truncl)
 weak_alias (__trunc, truncl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+# endif
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __trunc, truncl, GLIBC_2_0);
+# endif
 #endif
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S
index 7c64ef5..b230d51 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#undef weak_alias
-#define weak_alias(a,b)
+#ifndef MULTI_ARCH_POWER8
+# undef weak_alias
+# define weak_alias(a,b)
 
-#define __truncf __truncf_power5plus
+# define __truncf __truncf_power5plus
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c
index 2c46525..104416f 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c
@@ -16,10 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <math.h>
+# include <math_ldbl_opt.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__truncf) __truncf_ppc64 attribute_hidden;
 extern __typeof (__truncf) __truncf_power5plus attribute_hidden;
@@ -30,3 +31,4 @@ libc_ifunc (__truncf,
             : __truncf_ppc64);
 
 weak_alias (__truncf, truncf)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index dea49ac..badf5a7 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -1,44 +1,88 @@
+ifeq (,$(findstring -DMULTI_ARCH,$(sysdep-CPPFLAGS)))
+ifneq (,$(filter %le,$(config-machine)))
+sysdep-CPPFLAGS += -DMULTI_ARCH_POWER8=1
+endif
+endif
+
 ifeq ($(subdir),string)
-sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
-		   memcpy-power4 memcpy-ppc64 \
-		   memcmp-power8 memcmp-power7 memcmp-power4 memcmp-ppc64 \
-		   memset-power7 memset-power6 memset-power4 \
-		   memset-ppc64 memset-power8 \
-		   mempcpy-power7 mempcpy-ppc64 \
-		   memchr-power8 memchr-power7 memchr-ppc64 \
-		   memrchr-power8 memrchr-power7 memrchr-ppc64 \
-		   rawmemchr-power7 rawmemchr-ppc64 \
-		   strlen-power7 strlen-ppc64 \
-		   strnlen-power8 strnlen-power7 strnlen-ppc64 \
-		   strcasecmp-power7 strcasecmp_l-power7 \
-		   strncase-power7 strncase_l-power7 \
-		   strncmp-power9 strncmp-power8 strncmp-power7 \
-		   strncmp-power4 strncmp-ppc64 \
-		   strchr-power8 strchr-power7 strchr-ppc64 \
-		   strchrnul-power8 strchrnul-power7 strchrnul-ppc64 \
-		   strcpy-power8 strcpy-power7 strcpy-ppc64 stpcpy-power8 \
-		   stpcpy-power7 stpcpy-ppc64 \
-		   strrchr-power8 strrchr-power7 strrchr-ppc64 \
-		   strncat-power8 strncat-power7 strncat-ppc64 \
-		   strncpy-power7 strncpy-ppc64 \
-		   stpncpy-power8 stpncpy-power7 stpncpy-ppc64 \
-		   strcmp-power9 strcmp-power8 strcmp-power7 strcmp-ppc64 \
-		   strcat-power8 strcat-power7 strcat-ppc64 \
-		   memmove-power7 memmove-ppc64 wordcopy-ppc64 bcopy-ppc64 \
-		   strncpy-power8 strstr-power7 strstr-ppc64 \
-		   strspn-power8 strspn-ppc64 strcspn-power8 strcspn-ppc64 \
-		   strlen-power8 strcasestr-power8 strcasestr-ppc64 \
-		   strcasecmp-ppc64 strcasecmp-power8 strncase-ppc64 \
-		   strncase-power8
+sysdep_routines += \
+	memchr-power8 \
+	memcmp-power8 \
+	memcpy-power7 \
+	memmove-power7 \
+	mempcpy-power7 \
+	memrchr-power8 \
+	memset-power8 \
+	rawmemchr-power7 \
+	stpcpy-power8 \
+	stpncpy-power8 \
+	strcasecmp-power8 \
+	strcasecmp_l-power7 \
+	strcasestr-power8 \
+	strcat-power8 \
+	strchr-power8 \
+	strchrnul-power8 \
+	strcmp-power9 strcmp-power8 \
+	strcpy-power8 \
+	strcspn-power8 \
+	strlen-power8 \
+	strncase-power8 \
+	strncase_l-power7 \
+	strncat-power8 \
+	strncmp-power9 strncmp-power8 \
+	strncpy-power8 \
+	strnlen-power8 \
+	strrchr-power8 \
+	strspn-power8 \
+	strstr-power7 strstr-ppc64
+
+ifeq (,$(findstring -DMULTI_ARCH_POWER8=1,$(sysdep-CPPFLAGS)))
+sysdep_routines += \
+	bcopy-ppc64 \
+	memchr-power7 memchr-ppc64 \
+	memcmp-power7 memcmp-power4 memcmp-ppc64 \
+	memcpy-power6 memcpy-power4 memcpy-a2 memcpy-cell memcpy-ppc64 \
+	memmove-ppc64 \
+	mempcpy-ppc64 \
+	memrchr-power7 memrchr-ppc64 \
+	memset-power7 memset-power6 memset-power4 memset-ppc64 \
+	rawmemchr-ppc64 \
+	stpcpy-power7 stpcpy-ppc64 \
+	stpncpy-power7 stpncpy-ppc64 \
+	strcasecmp-power7 strcasecmp-ppc64 \
+	strcasestr-ppc64 \
+	strcat-power7 strcat-ppc64 \
+	strchr-power7 strchr-ppc64 \
+	strchrnul-power7 strchrnul-ppc64 \
+	strcmp-power7 strcmp-ppc64 \
+	strcpy-power7 strcpy-ppc64 \
+	strcspn-ppc64 \
+	strlen-power7 strlen-ppc64 \
+	strncase-power7 strncase-ppc64 \
+	strncat-power7 strncat-ppc64 \
+	strncmp-power7 strncmp-power4 strncmp-ppc64 \
+	strncpy-power7 strncpy-ppc64 \
+	strnlen-power7 strnlen-ppc64 \
+	strrchr-power7 strrchr-ppc64 \
+	strspn-ppc64 \
+	wordcopy-ppc64
+endif
 
 CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
 CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
 endif
 
 ifeq ($(subdir),wcsmbs)
-sysdep_routines += wcschr-power7 wcschr-power6 wcschr-ppc64 \
-		   wcsrchr-power7 wcsrchr-power6 wcsrchr-ppc64 \
-		   wcscpy-power7 wcscpy-power6 wcscpy-ppc64 \
+sysdep_routines += \
+	wcschr-power7 \
+	wcsrchr-power7 \
+	wcscpy-power7
+ifeq (,$(findstring -DMULTI_ARCH_POWER8=1,$(sysdep-CPPFLAGS)))
+sysdep_routines += \
+	wcschr-power6 wcschr-ppc64 \
+	wcsrchr-power6 wcsrchr-ppc64 \
+	wcscpy-power6 wcscpy-ppc64
+endif
 
 CFLAGS-wcschr-power7.c += -mcpu=power7
 CFLAGS-wcschr-power6.c += -mcpu=power6
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bcopy.c b/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
index 05d46e2..1657ff2 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/bcopy.c
@@ -16,8 +16,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <string.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <string.h>
+# include "init-arch.h"
 
 extern __typeof (bcopy) __bcopy_ppc attribute_hidden;
 /* __bcopy_power7 symbol is implemented at memmove-power7.S  */
@@ -27,3 +28,4 @@ libc_ifunc (bcopy,
             (hwcap & PPC_FEATURE_HAS_VSX)
             ? __bcopy_power7
             : __bcopy_ppc);
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bzero.c b/sysdeps/powerpc/powerpc64/multiarch/bzero.c
index 83b224b..a759d79 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/bzero.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/bzero.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <string.h>
 # include <strings.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 6a88536..c04e1db 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -48,7 +48,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   else if (hwcap & PPC_FEATURE_POWER5)
     hwcap |= PPC_FEATURE_POWER4;
 
-#ifdef SHARED
+#ifndef MULTI_ARCH_POWER8
+# ifdef SHARED
   /* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c.  */
   IFUNC_IMPL (i, name, memcpy,
 	      IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_HAS_VSX,
@@ -108,6 +109,20 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 	      IFUNC_IMPL_ADD (array, i, strlen, 1,
 			      __strlen_ppc))
 
+  /* Support sysdeps/powerpc/powerpc64/multiarch/strcmp.c.  */
+  IFUNC_IMPL (i, name, strcmp,
+	      IFUNC_IMPL_ADD (array, i, strcmp,
+			      hwcap2 & PPC_FEATURE2_ARCH_3_00,
+			      __strcmp_power9)
+	      IFUNC_IMPL_ADD (array, i, strcmp,
+			      hwcap2 & PPC_FEATURE2_ARCH_2_07,
+			      __strcmp_power8)
+	      IFUNC_IMPL_ADD (array, i, strcmp,
+			      hwcap & PPC_FEATURE_HAS_VSX,
+			      __strcmp_power7)
+	      IFUNC_IMPL_ADD (array, i, strcmp, 1,
+			     __strcmp_ppc))
+
   /* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c.  */
   IFUNC_IMPL (i, name, strncmp,
 	      IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_00,
@@ -131,6 +146,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 			      __strchr_power7)
 	      IFUNC_IMPL_ADD (array, i, strchr, 1,
 			      __strchr_ppc))
+# endif
 
   /* Support sysdeps/powerpc/powerpc64/multiarch/strchrnul.c.  */
   IFUNC_IMPL (i, name, strchrnul,
@@ -142,7 +158,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 			      __strchrnul_power7)
 	      IFUNC_IMPL_ADD (array, i, strchrnul, 1,
 			      __strchrnul_ppc))
-#endif
 
   /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c.  */
   IFUNC_IMPL (i, name, memcmp,
@@ -267,7 +282,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 	      IFUNC_IMPL_ADD (array, i, wcschr, 1,
 			      __wcschr_ppc))
 
-  /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c.  */
+  /* Support sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c.  */
   IFUNC_IMPL (i, name, wcsrchr,
 	      IFUNC_IMPL_ADD (array, i, wcsrchr,
 			      hwcap & PPC_FEATURE_HAS_VSX,
@@ -333,20 +348,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 	      IFUNC_IMPL_ADD (array, i, stpncpy, 1,
 			     __stpncpy_ppc))
 
-  /* Support sysdeps/powerpc/powerpc64/multiarch/strcmp.c.  */
-  IFUNC_IMPL (i, name, strcmp,
-	      IFUNC_IMPL_ADD (array, i, strcmp,
-			      hwcap2 & PPC_FEATURE2_ARCH_3_00,
-			      __strcmp_power9)
-	      IFUNC_IMPL_ADD (array, i, strcmp,
-			      hwcap2 & PPC_FEATURE2_ARCH_2_07,
-			      __strcmp_power8)
-	      IFUNC_IMPL_ADD (array, i, strcmp,
-			      hwcap & PPC_FEATURE_HAS_VSX,
-			      __strcmp_power7)
-	      IFUNC_IMPL_ADD (array, i, strcmp, 1,
-			     __strcmp_ppc))
-
   /* Support sysdeps/powerpc/powerpc64/multiarch/strcat.c.  */
   IFUNC_IMPL (i, name, strcat,
 	      IFUNC_IMPL_ADD (array, i, strcat,
@@ -390,6 +391,29 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 			      __strcasestr_power8)
              IFUNC_IMPL_ADD (array, i, strcasestr, 1,
                              __strcasestr_ppc))
+#endif
+
+#ifdef MULTI_ARCH_POWER8
+# ifdef SHARED
+  /* Support sysdeps/powerpc/powerpc64/multiarch/strcmp.c.  */
+  IFUNC_IMPL (i, name, strcmp,
+	      IFUNC_IMPL_ADD (array, i, strcmp,
+			      hwcap2 & PPC_FEATURE2_ARCH_3_00,
+			      __strcmp_power9)
+	      IFUNC_IMPL_ADD (array, i, strcmp, 1,
+			      __strcmp_power8))
+
+  /* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c.  */
+  IFUNC_IMPL (i, name, strncmp,
+	      IFUNC_IMPL_ADD (array, i, strncmp,
+			      hwcap2 & PPC_FEATURE2_ARCH_3_00,
+			      __strncmp_power9)
+	      IFUNC_IMPL_ADD (array, i, strncmp, 1,
+			      __strncmp_power8))
+# endif
+  (void) hwcap;
+  (void) hwcap2;
+#endif
 
   return i;
 }
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S
index 10a8420..a96b3ab 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S
@@ -16,11 +16,13 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define MEMCHR __memchr_power8
+#ifndef MULTI_ARCH_POWER8
+# define MEMCHR __memchr_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
-#undef weak_alias
-#define weak_alias(name,alias)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# undef weak_alias
+# define weak_alias(name,alias)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/memchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr.c b/sysdeps/powerpc/powerpc64/multiarch/memchr.c
index fa2cfd5..309557d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
@@ -36,6 +36,8 @@ libc_ifunc (__memchr,
 
 weak_alias (__memchr, memchr)
 libc_hidden_builtin_def (memchr)
-#else
-#include <string/memchr.c>
+#endif
+
+#if !IS_IN (libc) && !defined MULTI_ARCH_POWER8
+# include <string/memchr.c>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
index 41c291a..d36e28e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S
@@ -16,11 +16,13 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define MEMCMP __memcmp_power8
+#ifndef MULTI_ARCH_POWER8
+# define MEMCMP __memcmp_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
-#undef weak_alias
-#define weak_alias(name,alias)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# undef weak_alias
+# define weak_alias(name,alias)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/memcmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
index 0d315d5..d27e6cf 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # define memcmp __redirect_memcmp
 # include <string.h>
 # include <shlib-compat.h>
@@ -39,6 +39,8 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp,
 		       : (hwcap & PPC_FEATURE_POWER4)
 			 ? __memcmp_power4
 			 : __memcmp_ppc);
-#else
-#include <string/memcmp.c>
+#endif
+
+#if !IS_IN (libc) && !defined MULTI_ARCH_POWER8
+# include <string/memcmp.c>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S
index 503be8c..3cab727 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define MEMCPY __memcpy_power7
+#ifndef MULTI_ARCH_POWER8
+# define MEMCPY __memcpy_power7
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power7/memcpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy.c b/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
index 9f4286c..afd3444 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
@@ -19,7 +19,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  In static binaries we need memcpy before the initialization
    happened.  */
-#if defined SHARED && IS_IN (libc)
+#if defined SHARED && IS_IN (libc) && !defined MULTI_ARCH_POWER8
 /* Redefine memcpy so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias, below.  */
 # undef memcpy
@@ -49,7 +49,7 @@ libc_ifunc (__libc_memcpy,
 		    ? __memcpy_power4
             : __memcpy_ppc);
 
-#undef memcpy
+# undef memcpy
 strong_alias (__libc_memcpy, memcpy);
 libc_hidden_ver (__libc_memcpy, memcpy);
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S b/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S
index 90816ce..5d62f4b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S
@@ -16,12 +16,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define MEMMOVE __memmove_power7
+#ifndef MULTI_ARCH_POWER8
+# define MEMMOVE __memmove_power7
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
 
-#undef bcopy
-#define bcopy __bcopy_power7
+# undef bcopy
+# define bcopy __bcopy_power7
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power7/memmove.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memmove.c b/sysdeps/powerpc/powerpc64/multiarch/memmove.c
index db2bbc7..8a04000 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memmove.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memmove.c
@@ -19,7 +19,7 @@
 /* Define multiple versions only for the definition in lib and for
    DSO.  In static binaries we need memmove before the initialization
    happened.  */
-#if defined SHARED && IS_IN (libc)
+#if defined SHARED && IS_IN (libc) && !defined MULTI_ARCH_POWER8
 /* Redefine memmove so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias, below.  */
 # undef memmove
@@ -37,9 +37,11 @@ libc_ifunc (__libc_memmove,
             ? __memmove_power7
             : __memmove_ppc);
 
-#undef memmove
+# undef memmove
 strong_alias (__libc_memmove, memmove);
 libc_hidden_ver (__libc_memmove, memmove);
-#else
+#endif
+
+#if !(defined SHARED && IS_IN (libc)) && !defined MULTI_ARCH_POWER8
 # include <string/memmove.c>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
index d0eb400..1c53f50 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
@@ -16,11 +16,13 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define MEMPCPY __mempcpy_power7
+#ifndef MULTI_ARCH_POWER8
+# define MEMPCPY __mempcpy_power7
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
-#undef weak_alias
-#define weak_alias(name, alias)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# undef weak_alias
+# define weak_alias(name, alias)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power7/mempcpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
index 92391d3..4fff7a6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # define mempcpy __redirect_mempcpy
 # define __mempcpy __redirect___mempcpy
 # define NO_MEMPCPY_STPCPY_REDIRECT
@@ -38,6 +38,8 @@ libc_ifunc_redirected (__redirect___mempcpy, __mempcpy,
 		       : __mempcpy_ppc);
 
 weak_alias (__mempcpy, mempcpy)
-#else
+#endif
+
+#if !IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <string/mempcpy.c>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S
index 469b129..0a07006 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S
@@ -16,11 +16,13 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define MEMRCHR __memrchr_power8
+#ifndef MULTI_ARCH_POWER8
+# define MEMRCHR __memrchr_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
-#undef weak_alias
-#define weak_alias(name,alias)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# undef weak_alias
+# define weak_alias(name,alias)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/memrchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
index 7d52af0..d0bc18c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
@@ -35,6 +35,8 @@ libc_ifunc (__memrchr,
 	    : __memrchr_ppc);
 
 weak_alias (__memrchr, memrchr)
-#else
-#include <string/memrchr.c>
+#endif
+
+#if !IS_IN (libc) && !defined MULTI_ARCH_POWER8
+# include <string/memrchr.c>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S b/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S
index 45149e1..c0160b2 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-power8.S
@@ -16,12 +16,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define MEMSET __memset_power8
+#ifndef MULTI_ARCH_POWER8
+# define MEMSET __memset_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
 
-#undef __bzero
-#define __bzero __bzero_power8
+# undef __bzero
+# define __bzero __bzero_power8
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/memset.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset.c b/sysdeps/powerpc/powerpc64/multiarch/memset.c
index a5d9b3e..ec92cd0 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if defined SHARED && IS_IN (libc)
+#if defined SHARED && IS_IN (libc) && !defined MULTI_ARCH_POWER8
 /* Redefine memset so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias, below.  */
 # undef memset
@@ -47,7 +47,7 @@ libc_ifunc (__libc_memset,
 		  ? __memset_power4
             : __memset_ppc);
 
-#undef memset
+# undef memset
 strong_alias (__libc_memset, memset);
 libc_hidden_ver (__libc_memset, memset);
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S
index c7bb422..e0f1990 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S
@@ -16,6 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define RAWMEMCHR __rawmemchr_power7
+#ifndef MULTI_ARCH_POWER8
+# define RAWMEMCHR __rawmemchr_power7
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power7/rawmemchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
index 8bfd58d..3ac9a80 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # define __rawmemchr __redirect___rawmemchr
 # include <string.h>
 # include <shlib-compat.h>
@@ -34,6 +34,8 @@ libc_ifunc_redirected (__redirect___rawmemchr, __rawmemchr,
 		       : __rawmemchr_ppc);
 
 weak_alias (__rawmemchr, rawmemchr)
-#else
-#include <string/rawmemchr.c>
+#endif
+
+#if !IS_IN (libc) && !defined MULTI_ARCH_POWER8
+# include <string/rawmemchr.c>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S
index 3baebfa..c277d6f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STPCPY __stpcpy_power8
+#ifndef MULTI_ARCH_POWER8
+# define STPCPY __stpcpy_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/stpcpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
index aa01adb..37eb603 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if defined SHARED && IS_IN (libc)
+#if defined SHARED && IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # define __NO_STRING_INLINES
 # define NO_MEMPCPY_STPCPY_REDIRECT
 # include <string.h>
@@ -37,6 +37,8 @@ libc_ifunc_hidden (__stpcpy, __stpcpy,
 weak_alias (__stpcpy, stpcpy)
 libc_hidden_def (__stpcpy)
 libc_hidden_def (stpcpy)
-#else
+#endif
+
+#if !(defined SHARED && IS_IN (libc)) && !defined MULTI_ARCH_POWER8
 # include <string/stpcpy.c>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S
index f8a0f29..6710352 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S
@@ -16,14 +16,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STPNCPY __stpncpy_power8
+#ifndef MULTI_ARCH_POWER8
+# define STPNCPY __stpncpy_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
 
-#define MEMSET __memset_power8
-#ifdef SHARED
-#define MEMSET_is_local
+# define MEMSET __memset_power8
+# ifdef SHARED
+#  define MEMSET_is_local
+# endif
 #endif
 
 #include <sysdeps/powerpc/powerpc64/power8/stpncpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
index e9b37dc..2281faa 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # define stpncpy __redirect_stpncpy
 # define __stpncpy __redirect___stpncpy
 # include <string.h>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S
index 49cf3ff..4f7890d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S
@@ -16,11 +16,13 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define __strcasecmp __strcasecmp_power8
-#undef weak_alias
-#define weak_alias(name, alias)
+#ifndef MULTI_ARCH_POWER8
+# define __strcasecmp __strcasecmp_power8
+# undef weak_alias
+# define weak_alias(name, alias)
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/strcasecmp.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
index dcb4ef4..8ba4556 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
@@ -16,9 +16,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <string.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__strcasecmp) __libc_strcasecmp;
 
@@ -34,3 +35,4 @@ libc_ifunc (__libc_strcasecmp,
              : __strcasecmp_ppc);
 
 weak_alias (__libc_strcasecmp, strcasecmp)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
index 6bad13a..0a9c6b7 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
@@ -16,13 +16,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define __strcasecmp_l __strcasecmp_l_power7
+#ifndef MULTI_ARCH_POWER8
+# define __strcasecmp_l __strcasecmp_l_power7
 
-#undef weak_alias
-#define weak_alias(name, alias)
+# undef weak_alias
+# define weak_alias(name, alias)
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+#endif
 
 #define USE_IN_EXTENDED_LOCALE_MODEL
 #define __STRCMP __strcasecmp_l
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
index 10b8f2e..4310ead 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
@@ -16,17 +16,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <string.h>
 # define strcasecmp_l __strcasecmp_l_ppc
 extern __typeof (__strcasecmp_l) __strcasecmp_l_ppc attribute_hidden;
 extern __typeof (__strcasecmp_l) __strcasecmp_l_power7 attribute_hidden;
 #endif
 
-#include <string/strcasecmp_l.c>
+#if !defined MULTI_ARCH_POWER8
+# include <string/strcasecmp_l.c>
+#endif
 #undef strcasecmp_l
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <shlib-compat.h>
 # include "init-arch.h"
 
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S
index 61025ce..f53931f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S
@@ -16,18 +16,20 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STRCASESTR __strcasestr_power8
+#ifndef MULTI_ARCH_POWER8
+# define STRCASESTR __strcasestr_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
 
 /* The following definitions are used in strcasestr optimization.  */
 
 /* strlen is used to calculate len of r4.  */
-#define STRLEN __strlen_power8
+# define STRLEN __strlen_power8
 /* strnlen is used to check if len of r3 is more than r4.  */
-#define STRNLEN __strnlen_power7
+# define STRNLEN __strnlen_power7
 /* strchr is used to check if first char of r4 is present in r3.  */
-#define STRCHR __strchr_power8
+# define STRCHR __strchr_power8
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/strcasestr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c b/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c
index 9e6a16d..2acd054 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
@@ -32,6 +32,8 @@ libc_ifunc (__strcasestr,
 		: __strcasestr_ppc);
 
 weak_alias (__strcasestr, strcasestr)
-#else
-#include <string/strcasestr.c>
+#endif
+
+#if !IS_IN (libc) && !defined MULTI_ARCH_POWER8
+# include <string/strcasestr.c>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c b/sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c
index f138bee..411e01f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat-power8.c
@@ -15,16 +15,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/ >.  */
 
-#include <string.h>
+#ifndef MULTI_ARCH_POWER8
+# include <string.h>
 
-#define STRCAT __strcat_power8
+# define STRCAT __strcat_power8
 
-#undef libc_hidden_def
-#define libc_hidden_def(name)
+# undef libc_hidden_def
+# define libc_hidden_def(name)
 
 extern typeof (strcpy) __strcpy_power8;
 extern typeof (strlen) __strlen_power8;
 
-#define strcpy __strcpy_power8
-#define strlen __strlen_power8
+# define strcpy __strcpy_power8
+# define strlen __strlen_power8
+#endif
+
 #include <string/strcat.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat.c b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
index 3336aed..2f0ce52 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # define strcat __redirect_strcat
 # include <string.h>
 # include <shlib-compat.h>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S
index ca01f88..e43a994 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STRCHR __strchr_power8
+#ifndef MULTI_ARCH_POWER8
+# define STRCHR __strchr_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/strchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr.c b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
index 5731058..9f031ef 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if defined SHARED && IS_IN (libc)
+#if defined SHARED && IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # define strchr __redirect_strchr
 /* Omit the strchr inline definitions because it would redefine strchr.  */
 # define __NO_STRING_INLINES
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S
index e66cdfe..642eee3 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STRCHRNUL __strchrnul_power8
+#ifndef MULTI_ARCH_POWER8
+# define STRCHRNUL __strchrnul_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/strchrnul.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
index 1e9018f..c397f6d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
@@ -35,6 +35,8 @@ libc_ifunc (__strchrnul,
             : __strchrnul_ppc);
 
 weak_alias (__strchrnul, strchrnul)
-#else
-#include <string/strchrnul.c>
+#endif
+
+#if !IS_IN (libc) && !defined MULTI_ARCH_POWER8
+# include <string/strchrnul.c>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S
index 7ef0c91..471d8f5 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STRCMP __strcmp_power7
+#if IS_IN (libc)
+# define STRCMP __strcmp_power7
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
 
-#include <sysdeps/powerpc/powerpc64/power7/strcmp.S>
+# include <sysdeps/powerpc/powerpc64/power7/strcmp.S>
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S
index ee4218c..1d194e2 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S
@@ -17,10 +17,20 @@
    <http://www.gnu.org/licenses/>.  */
 
 #if IS_IN (libc)
-#define STRCMP __strcmp_power8
-
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# ifndef MULTI_ARCH_POWER8
+#  define STRCMP __strcmp_power8
+#  undef libc_hidden_builtin_def
+#  define libc_hidden_builtin_def(name)
+# else
+#  ifdef SHARED
+#   define STRCMP __strcmp_power8
+#   undef libc_hidden_builtin_def
+#   define libc_hidden_builtin_def(name)			\
+	.globl __GI_##name; __GI_##name = __##name##_power8
+#  endif
+# endif
+#endif
 
-#include <sysdeps/powerpc/powerpc64/power8/strcmp.S>
+#if IS_IN (libc) || defined MULTI_ARCH_POWER8
+# include <sysdeps/powerpc/powerpc64/power8/strcmp.S>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S
index 5cfee93..86e4443 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S
@@ -17,10 +17,10 @@
    <http://www.gnu.org/licenses/>.  */
 
 #if IS_IN (libc)
-#define STRCMP __strcmp_power9
+# define STRCMP __strcmp_power9
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
 
-#include <sysdeps/powerpc/powerpc64/power9/strcmp.S>
+# include <sysdeps/powerpc/powerpc64/power9/strcmp.S>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
index fc10205..c7f88f1 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
@@ -32,11 +32,16 @@ extern __typeof (strcmp) __strcmp_power9 attribute_hidden;
 # undef strcmp
 
 libc_ifunc_redirected (__redirect_strcmp, strcmp,
-			(hwcap2 & PPC_FEATURE2_ARCH_3_00)
-			? __strcmp_power9 :
-		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+		       (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+		       ? __strcmp_power9
+# ifndef MULTI_ARCH_POWER8
+		       : (hwcap2 & PPC_FEATURE2_ARCH_2_07)
 		       ? __strcmp_power8
 		       : (hwcap & PPC_FEATURE_HAS_VSX)
-			 ? __strcmp_power7
-			 : __strcmp_ppc);
+		       ? __strcmp_power7
+		       : __strcmp_ppc
+# else
+		       : __strcmp_power8
+# endif
+		       );
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S
index 7c9378d..a7403888 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STRCPY __strcpy_power8
+#ifndef MULTI_ARCH_POWER8
+# define STRCPY __strcpy_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/strcpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy.c b/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
index 0da53e3..addf6ba 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if defined SHARED && IS_IN (libc)
+#if defined SHARED && IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # define strcpy __redirect_strcpy
 # include <string.h>
 # include <shlib-compat.h>
@@ -25,7 +25,7 @@
 extern __typeof (strcpy) __strcpy_ppc attribute_hidden;
 extern __typeof (strcpy) __strcpy_power7 attribute_hidden;
 extern __typeof (strcpy) __strcpy_power8 attribute_hidden;
-#undef strcpy
+# undef strcpy
 
 libc_ifunc_redirected (__redirect_strcpy, strcpy,
 		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S
index 1320145..f251178 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S
@@ -16,8 +16,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STRSPN __strcspn_power8
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+#ifndef MULTI_ARCH_POWER8
+# define STRSPN __strcspn_power8
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/strcspn.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
index a6df885..8791f75 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
@@ -16,11 +16,12 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <string.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
-#undef strcspn
+# undef strcspn
 extern __typeof (strcspn) __libc_strcspn;
 
 extern __typeof (strcspn) __strcspn_ppc attribute_hidden;
@@ -33,3 +34,4 @@ libc_ifunc (__libc_strcspn,
 
 weak_alias (__libc_strcspn, strcspn)
 libc_hidden_builtin_def (strcspn)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S
index f7972ff..4bac46f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STRLEN __strlen_power8
+#ifndef MULTI_ARCH_POWER8
+# define STRLEN __strlen_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/strlen.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen.c b/sysdeps/powerpc/powerpc64/multiarch/strlen.c
index a5a7b59..b4b9b60 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strlen.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if defined SHARED && IS_IN (libc)
+#if defined SHARED && IS_IN (libc) && !defined MULTI_ARCH_POWER8
 /* Redefine strlen so that the compiler won't complain about the type
    mismatch with the IFUNC selector in strong_alias, below.  */
 # undef strlen
@@ -38,7 +38,7 @@ libc_ifunc (__libc_strlen,
 	      ? __strlen_power7
 	      : __strlen_ppc);
 
-#undef strlen
+# undef strlen
 strong_alias (__libc_strlen, strlen)
 libc_hidden_ver (__libc_strlen, strlen)
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S
index 3b5a8de..1930c83 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S
@@ -16,11 +16,13 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define __strncasecmp __strncasecmp_power8
-#undef weak_alias
-#define weak_alias(name, alias)
+#ifndef MULTI_ARCH_POWER8
+# define __strncasecmp __strncasecmp_power8
+# undef weak_alias
+# define weak_alias(name, alias)
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/strncase.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase.c b/sysdeps/powerpc/powerpc64/multiarch/strncase.c
index 197f713..7cc75d8 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase.c
@@ -16,9 +16,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <string.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
+#ifndef MULTI_ARCH_POWER8
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
 extern __typeof (__strncasecmp) __libc_strncasecmp;
 
@@ -34,3 +35,4 @@ libc_ifunc (__libc_strncasecmp,
              : __strncasecmp_ppc);
 
 weak_alias (__libc_strncasecmp, strncasecmp)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
index 73b967d..540874a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c
@@ -15,13 +15,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <string.h>
+#ifndef MULTI_ARCH_POWER8
+# include <string.h>
 
-#define __strncasecmp_l __strncasecmp_l_power7
+# define __strncasecmp_l __strncasecmp_l_power7
 
-#undef libc_hidden_def
-#define libc_hidden_def(name)
+# undef libc_hidden_def
+# define libc_hidden_def(name)
 
 extern __typeof (strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
+#endif
 
 #include <string/strncase_l.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c b/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
index 6c2429c..7fa6a77 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
@@ -16,17 +16,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <string.h>
 # define strncasecmp_l __strncasecmp_l_ppc
 extern __typeof (__strncasecmp_l) __strncasecmp_l_ppc attribute_hidden;
 extern __typeof (__strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
 #endif
 
-#include <string/strncase_l.c>
+#if !defined MULTI_ARCH_POWER8
+# include <string/strncase_l.c>
+#endif
 #undef strncasecmp_l
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <shlib-compat.h>
 # include "init-arch.h"
 
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c b/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c
index 1ec1259..2ba8ed0 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c
@@ -15,17 +15,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/ >.  */
 
-#include <string.h>
+#ifndef MULTI_ARCH_POWER8
+# include <string.h>
 
-#define STRNCAT __strncat_power8
+# define STRNCAT __strncat_power8
 
 extern __typeof (strncat) __strncat_power8 attribute_hidden;
 extern __typeof (strlen) __strlen_power8 attribute_hidden;
 extern __typeof (strnlen) __strnlen_power8 attribute_hidden;
 extern __typeof (memcpy) __memcpy_power7 attribute_hidden;
 
-#define strlen    __strlen_power8
-#define __strnlen __strnlen_power8
-#define memcpy    __memcpy_power7
+# define strlen    __strlen_power8
+# define __strnlen __strnlen_power8
+# define memcpy    __memcpy_power7
+#endif
 
 #include <string/strncat.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat.c b/sysdeps/powerpc/powerpc64/multiarch/strncat.c
index 72f2833..02a2b56 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncat.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S
index 5d8eeb4..3c7032d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S
@@ -16,10 +16,20 @@
    <http://www.gnu.org/licenses/>.  */
 
 #if IS_IN (libc)
-#define STRNCMP __strncmp_power8
-
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# ifndef MULTI_ARCH_POWER8
+#  define STRNCMP __strncmp_power8
+#  undef libc_hidden_builtin_def
+#  define libc_hidden_builtin_def(name)
+# else
+#  ifdef SHARED
+#   define STRNCMP __strncmp_power8
+#   undef libc_hidden_builtin_def
+#   define libc_hidden_builtin_def(name)			\
+	.globl __GI_##name; __GI_##name = __##name##_power8
+#  endif
+# endif
+#endif
 
-#include <sysdeps/powerpc/powerpc64/power8/strncmp.S>
+#if IS_IN (libc) || defined MULTI_ARCH_POWER8
+# include <sysdeps/powerpc/powerpc64/power8/strncmp.S>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S
index 52934cf..e096428 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S
@@ -16,10 +16,10 @@
    <http://www.gnu.org/licenses/>.  */
 
 #if IS_IN (libc)
-#define STRNCMP __strncmp_power9
+# define STRNCMP __strncmp_power9
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
 
-#include <sysdeps/powerpc/powerpc64/power9/strncmp.S>
+# include <sysdeps/powerpc/powerpc64/power9/strncmp.S>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
index 14122c6..8c83162 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
@@ -35,13 +35,18 @@ extern __typeof (strncmp) __strncmp_power9 attribute_hidden;
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
 libc_ifunc_redirected (__redirect_strncmp, strncmp,
-			(hwcap2 & PPC_FEATURE2_ARCH_3_00)
-			? __strncmp_power9 :
-		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+		       (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+		       ? __strncmp_power9
+# ifndef MULTI_ARCH_POWER8
+		       : (hwcap2 & PPC_FEATURE2_ARCH_2_07)
 		       ? __strncmp_power8
 		       : (hwcap & PPC_FEATURE_HAS_VSX)
-			 ? __strncmp_power7
-			 : (hwcap & PPC_FEATURE_POWER4)
-			   ? __strncmp_power4
-			   : __strncmp_ppc);
+		       ? __strncmp_power7
+		       : (hwcap & PPC_FEATURE_POWER4)
+		       ? __strncmp_power4
+		       : __strncmp_ppc
+# else
+		       : __strncmp_power8
+# endif
+		       );
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S
index 3d16363..cb9a03e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S
@@ -16,15 +16,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STRNCPY __strncpy_power8
+#ifndef MULTI_ARCH_POWER8
+# define STRNCPY __strncpy_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
 
 /* memset is used to pad the end of the string.  */
-#define MEMSET __memset_power8
-#ifdef SHARED
-#define MEMSET_is_local
+# define MEMSET __memset_power8
+# ifdef SHARED
+#  define MEMSET_is_local
+# endif
 #endif
 
 #include <sysdeps/powerpc/powerpc64/power8/strncpy.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
index bb63c18..195e657 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncpy.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/ >.  */
 
 /* Define multiple versions only for definition in libc. */
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # define strncpy __redirect_strncpy
 /* Omit the strncpy inline definitions because it would redefine strncpy.  */
 # define __NO_STRING_INLINES
@@ -38,5 +38,4 @@ libc_ifunc_redirected (__redirect_strncpy, strncpy,
 		       : (hwcap & PPC_FEATURE_HAS_VSX)
 			 ? __strncpy_power7
 			 : __strncpy_ppc);
-
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S
index 9ed0f91..91096e6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S
@@ -16,11 +16,13 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define __strnlen __strnlen_power8
+#ifndef MULTI_ARCH_POWER8
+# define __strnlen __strnlen_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
-#undef weak_alias
-#define weak_alias(name, alias)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# undef weak_alias
+# define weak_alias(name, alias)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/strnlen.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
index 7f89132..2850667 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
@@ -16,7 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
+
 # define strnlen __redirect_strnlen
 # define __strnlen __redirect___strnlen
 # include <string.h>
@@ -28,6 +29,7 @@ extern __typeof (__strnlen) __strnlen_power7 attribute_hidden;
 extern __typeof (__strnlen) __strnlen_power8 attribute_hidden;
 # undef strnlen
 # undef __strnlen
+
 libc_ifunc_redirected (__redirect___strnlen, __strnlen,
 		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
 		       ? __strnlen_power8 :
@@ -35,7 +37,8 @@ libc_ifunc_redirected (__redirect___strnlen, __strnlen,
 			 ? __strnlen_power7
 			 : __strnlen_ppc);
 weak_alias (__strnlen, strnlen)
+#endif
 
-#else
-#include <string/strnlen.c>
+#if !IS_IN (libc) && !defined MULTI_ARCH_POWER8
+# include <string/strnlen.c>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S
index 51adbb0..a581f24 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S
@@ -16,9 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STRRCHR __strrchr_power8
+#ifndef MULTI_ARCH_POWER8
+# define STRRCHR __strrchr_power8
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/strrchr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
index 0f94c9d..f648f4d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # define strrchr __redirect_strrchr
 # include <string.h>
 # include <shlib-compat.h>
@@ -26,7 +26,7 @@
 extern __typeof (strrchr) __strrchr_ppc attribute_hidden;
 extern __typeof (strrchr) __strrchr_power7 attribute_hidden;
 extern __typeof (strrchr) __strrchr_power8 attribute_hidden;
-#undef strrchr
+# undef strrchr
 
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S b/sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S
index 89e2e5b..0c4a00e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S
@@ -16,8 +16,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STRSPN __strspn_power8
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+#ifndef MULTI_ARCH_POWER8
+# define STRSPN __strspn_power8
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+#endif
 
 #include <sysdeps/powerpc/powerpc64/power8/strspn.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strspn.c b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
index 0957482..0b1449f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strspn.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
@@ -16,11 +16,12 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef MULTI_ARCH_POWER8
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
 
-#undef strspn
+# undef strspn
 extern __typeof (strspn) __libc_strspn;
 
 extern __typeof (strspn) __strspn_ppc attribute_hidden;
@@ -33,3 +34,4 @@ libc_ifunc (__libc_strspn,
 
 weak_alias (__libc_strspn, strspn)
 libc_hidden_builtin_def (strspn)
+#endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S b/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S
index 82a0e4c..218e09f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S
@@ -16,18 +16,20 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define STRSTR __strstr_power7
+#ifndef MULTI_ARCH_POWER8
+# define STRSTR __strstr_power7
 
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
 
-#define STRLEN __strlen_power7
-#define STRNLEN __strnlen_power7
-#define STRCHR __strchr_power7
-#ifdef SHARED
-#define STRLEN_is_local
-#define STRNLEN_is_local
-#define STRCHR_is_local
+# define STRLEN __strlen_power7
+# define STRNLEN __strnlen_power7
+# define STRCHR __strchr_power7
+# ifdef SHARED
+#  define STRLEN_is_local
+#  define STRNLEN_is_local
+#  define STRCHR_is_local
+# endif
 #endif
 
 #include <sysdeps/powerpc/powerpc64/power7/strstr.S>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c
index 37add12..2ce8638 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strstr-ppc64.c
@@ -17,13 +17,17 @@
 
 #include <string.h>
 
-#define STRSTR __strstr_ppc
 #if IS_IN (libc) && defined(SHARED)
 # undef libc_hidden_builtin_def
-# define libc_hidden_builtin_def(name) \
-  __hidden_ver1(__strstr_ppc, __GI_strstr, __strstr_ppc);
+# ifndef MULTI_ARCH_POWER8
+#  define libc_hidden_builtin_def(name) \
+     __hidden_ver1(__strstr_ppc, __GI_strstr, __strstr_ppc);
+# else
+#  define libc_hidden_builtin_def(name)
+# endif
 #endif
 
 extern __typeof (strstr) __strstr_ppc attribute_hidden;
+#define STRSTR __strstr_ppc
 
 #include <string/strstr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strstr.c b/sysdeps/powerpc/powerpc64/multiarch/strstr.c
index d903b27..3235406 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strstr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strstr.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # define strstr __redirect_strstr
 # include <string.h>
 # include <shlib-compat.h>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c
index 8f4de0e..a1c6baf 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c
@@ -16,4 +16,11 @@
    License along with the GNU C Library; see the file COPYING.LIB.  If
    not, see <http://www.gnu.org/licenses/>.  */
 
-#include <sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c>
+#ifndef MULTI_ARCH_POWER8
+# define WCSCHR __wcschr_power7
+
+# undef libc_hidden_def
+# define libc_hidden_def(name)
+#endif
+
+#include <sysdeps/powerpc/power6/wcschr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
index ca373e0..20289bb 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcschr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # define wcschr __redirect_wcschr
 # define __wcschr __redirect___wcschr
 # include <wchar.h>
@@ -36,8 +36,10 @@ libc_ifunc_redirected (__redirect___wcschr, __wcschr,
 			 ? __wcschr_power6
 			 : __wcschr_ppc);
 weak_alias (__wcschr, wcschr)
-#else
-#undef libc_hidden_def
-#define libc_hidden_def(a)
-#include <wcsmbs/wcschr.c>
+#endif
+
+#if !IS_IN (libc) && !defined MULTI_ARCH_POWER8
+# undef libc_hidden_def
+# define libc_hidden_def(a)
+# include <wcsmbs/wcschr.c>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c
index 47ba73b..5ad7cba 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c
@@ -16,4 +16,8 @@
    License along with the GNU C Library; see the file COPYING.LIB.  If
    not, see <http://www.gnu.org/licenses/>.  */
 
-#include <sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power7.c>
+#ifndef MULTI_ARCH_POWER8
+# define WCSCPY __wcscpy_power7
+#endif
+
+#include <sysdeps/powerpc/power6/wcscpy.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c b/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
index 13e44af..6d73551 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcscpy.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <wchar.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
@@ -31,6 +31,8 @@ libc_ifunc (wcscpy,
 	       (hwcap & PPC_FEATURE_ARCH_2_05)
 	       ? __wcscpy_power6
              : __wcscpy_ppc);
-#else
-#include <wcsmbs/wcscpy.c>
+#endif
+
+#if !IS_IN (libc) && !defined MULTI_ARCH_POWER8
+# include <wcsmbs/wcscpy.c>
 #endif
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c
index fa25aa0..003fcd7 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c
@@ -16,4 +16,8 @@
    License along with the GNU C Library; see the file COPYING.LIB.  If
    not, see <http://www.gnu.org/licenses/>.  */
 
-#include <sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power7.c>
+#ifndef MULTI_ARCH_POWER8
+# define WCSRCHR      __wcsrchr_power7
+#endif
+
+#include <sysdeps/powerpc/power6/wcsrchr.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
index 07590f5..cbcc35a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
+#if IS_IN (libc) && !defined MULTI_ARCH_POWER8
 # include <wchar.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
@@ -31,6 +31,8 @@ libc_ifunc (wcsrchr,
 	       (hwcap & PPC_FEATURE_ARCH_2_05)
 	       ? __wcsrchr_power6
              : __wcsrchr_ppc);
-#else
-#include <wcsmbs/wcsrchr.c>
+#endif
+
+#if !IS_IN (libc) && !defined MULTI_ARCH_POWER8
+# include <wcsmbs/wcsrchr.c>
 #endif
