powerpc: Fix __wcschr static build

This patch fix the static build for strftime, which uses __wcschr.
Current powerpc32 implementation defines the __wcschr be an alias to
__wcschr_ppc32 and current implementation misses the correct alias for
static build.

It also changes the default wcschr.c logic so a IFUNC implementation
should just define WCSCHR and undefine the required alias/internal
definitions.
This commit is contained in:
Adhemerval Zanella 2015-02-25 16:22:10 -03:00 committed by Adhemerval Zanella
parent a8b6a3a6c1
commit fb78612a96
4 changed files with 37 additions and 18 deletions

View File

@ -1,3 +1,13 @@
2015-04-15 Adhemerval Zanella <adhemerval.zanella@linaro.org>
* wcsmbs/wcschr.c [WCSCHR] (wcschr): Define as __wcschr. Remove
conditionals for weak_alias and libc_hidden_weak.
* sysdeps/i386/i686/multiarch/wcschr-c.c [libc]: Undefine
libc_hidden_weak and weak_alias.
* sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c [libc]:
Undefine libc_hidden_weak. Define libc_hidden_def for SHARED builds
and weak_alias for static one.
2015-04-15 David S. Miller <davem@davemloft.net> 2015-04-15 David S. Miller <davem@davemloft.net>
* sysdeps/sparc/fpu/libm-test-ulps: Regenerate from scratch. * sysdeps/sparc/fpu/libm-test-ulps: Regenerate from scratch.

View File

@ -1,6 +1,12 @@
#include <wchar.h> #include <wchar.h>
#if IS_IN (libc) #if IS_IN (libc)
# undef libc_hidden_weak
# define libc_hidden_weak(name)
# undef weak_alias
# define weak_alias(name,alias)
# ifdef SHARED # ifdef SHARED
# undef libc_hidden_def # undef libc_hidden_def
# define libc_hidden_def(name) \ # define libc_hidden_def(name) \
@ -8,9 +14,9 @@
strong_alias (__wcschr_ia32, __wcschr_ia32_1); \ strong_alias (__wcschr_ia32, __wcschr_ia32_1); \
__hidden_ver1 (__wcschr_ia32_1, __GI___wcschr, __wcschr_ia32_1); __hidden_ver1 (__wcschr_ia32_1, __GI___wcschr, __wcschr_ia32_1);
# endif # endif
# define WCSCHR __wcschr_ia32
#endif #endif
extern __typeof (wcschr) __wcschr_ia32; extern __typeof (wcschr) __wcschr_ia32;
#include "wcsmbs/wcschr.c" #define WCSCHR __wcschr_ia32
#include <wcsmbs/wcschr.c>

View File

@ -18,16 +18,26 @@
#include <wchar.h> #include <wchar.h>
#if IS_IN (libc) #if IS_IN (libc)
# undef libc_hidden_weak
# define libc_hidden_weak(name)
# undef weak_alias
# undef libc_hidden_def
# ifdef SHARED # ifdef SHARED
# undef libc_hidden_def # define libc_hidden_def(name) \
# define libc_hidden_def(name) \
__hidden_ver1 (__wcschr_ppc, __GI_wcschr, __wcschr_ppc); \ __hidden_ver1 (__wcschr_ppc, __GI_wcschr, __wcschr_ppc); \
strong_alias (__wcschr_ppc, __wcschr_ppc_1); \ strong_alias (__wcschr_ppc, __wcschr_ppc_1); \
__hidden_ver1 (__wcschr_ppc_1, __GI___wcschr, __wcschr_ppc_1); __hidden_ver1 (__wcschr_ppc_1, __GI___wcschr, __wcschr_ppc_1);
# endif # define weak_alias(name,alias)
# define WCSCHR __wcschr_ppc # else
# define weak_alias(name, alias) \
_weak_alias(__wcschr_ppc, __wcschr)
# define libc_hidden_def(name)
# endif /* SHARED */
#endif #endif
extern __typeof (wcschr) __wcschr_ppc; extern __typeof (wcschr) __wcschr_ppc;
#define WCSCHR __wcschr_ppc
#include <wcsmbs/wcschr.c> #include <wcsmbs/wcschr.c>

View File

@ -17,17 +17,13 @@
#include <wchar.h> #include <wchar.h>
/* Find the first occurrence of WC in WCS. */ #ifndef WCSCHR
#ifdef WCSCHR # define WCSCHR __wcschr
# define wcschr WCSCHR
#else
# define wcschr __wcschr
#endif #endif
/* Find the first occurrence of WC in WCS. */
wchar_t * wchar_t *
wcschr (wcs, wc) WCSCHR (const wchar_t *wcs, const wchar_t wc)
const wchar_t *wcs;
const wchar_t wc;
{ {
do do
if (*wcs == wc) if (*wcs == wc)
@ -36,9 +32,6 @@ wcschr (wcs, wc)
return NULL; return NULL;
} }
libc_hidden_def (wcschr) libc_hidden_def (__wcschr)
#ifndef WCSCHR
# undef wcschr
weak_alias (__wcschr, wcschr) weak_alias (__wcschr, wcschr)
libc_hidden_weak (wcschr) libc_hidden_weak (wcschr)
#endif