glibc/time
Joseph Myers 2cfbdb9a27 Fix strftime wcschr namespace (bug 17634).
Use of strftime, a C90 function, ends up bringing in wcschr, which is
not a C90 function.  Although not a conformance bug (C90 reserves
wcs*), this is still contrary to glibc practice of avoiding relying on
those reservations; this patch arranges for the internal uses to use
__wcschr instead, with wcschr being a weak alias.  This is more
complicated than some such patches because of the various IFUNC
definitions of wcschr (which include code redefining libc_hidden_def
in a way that involves creating __GI_wcschr manually and so also needs
to create __GI___wcschr after the change of internal uses to use
__wcschr).

Tested for x86_64 and 32-bit x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch).

2014-12-10  Joseph Myers  <joseph@codesourcery.com>
	    Adhemerval Zanella  <azanella@linux.vnet.ibm.com>

	[BZ #17634]
	* wcsmbs/wcschr.c [!WCSCHR] (wcschr): Define as __wcschr.
	Undefine after defining function.  Define as weak alias of
	__wcschr.  Use libc_hidden_weak.
	* include/wchar.h (__wcschr): Declare.  Use libc_hidden_proto.
	* sysdeps/i386/i686/multiarch/wcschr-c.c [IS_IN (libc) && SHARED]
	(libc_hidden_def): Also define __GI___wcschr alias.
	* sysdeps/i386/i686/multiarch/wcschr.S (wcschr): Rename to
	__wcschr and define as weak alias of __wcschr.
	* sysdeps/powerpc/power6/wcschr.c [!WCSCHR] (WCSCHR): Define as
	__wcschr.
	[!WCSCHR] (DEFAULT_WCSCHR): Define.
	[DEFAULT_WCSCHR] (__wcschr): Use libc_hidden_def.
	[DEFAULT_WCSCHR] (wcschr): Define as weak alias of __wcschr.  Use
	libc_hidden_weak.  Do not use libc_hidden_def.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c
	[IS_IN (libc) && SHARED] (libc_hidden_def): Also define
	__GI___wcschr alias.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c
	[IS_IN (libc)] (wcschr): Define as macro expanding to
	__redirect_wcschr.
	[IS_IN (libc)] (__wcschr_ppc): Use __redirect_wcschr in typeof.
	[IS_IN (libc)] (__wcschr_power6): Likewise.
	[IS_IN (libc)] (__wcschr_power7): Likewise.
	[IS_IN (libc)] (__libc_wcschr): New.  Define with libc_ifunc
	instead of wcschr.
	[IS_IN (libc)] (wcschr): Undefine and define as weak alias of
	__libc_wcschr.
	[!IS_IN (libc)] (libc_hidden_def): Do not undefine and redefine.
	* sysdeps/powerpc/powerpc64/multiarch/wcschr.c (wcschr): Rename to
	__wcschr and define as weak alias of __wcschr.  Use
	libc_hidden_builtin_def.
	* sysdeps/x86_64/wcschr.S (wcschr): Rename to __wcschr and define
	as weak alias of __wcschr.  Use libc_hidden_weak.
	* time/alt_digit.c (_nl_get_walt_digit): Use __wcschr instead of
	wcschr.
	* time/era.c (_nl_init_era_entries): Likewise.
	* conform/Makefile (test-xfail-ISO/time.h/linknamespace): Remove
	variable.
	(test-xfail-XPG3/time.h/linknamespace): Likewise.
	(test-xfail-XPG4/time.h/linknamespace): Likewise.
2014-12-10 16:59:02 +00:00
..
sys Complete _BSD_SOURCE / _SVID_source followup cleanup. 2014-02-21 21:45:26 +00:00
adjtime.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
alt_digit.c Fix strftime wcschr namespace (bug 17634). 2014-12-10 16:59:02 +00:00
asctime.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
bug-asctime_r.c [BZ #1468] 2005-10-14 17:20:58 +00:00
bug-asctime.c [BZ #1460] 2005-10-14 15:17:40 +00:00
bug-getdate1.c * time/bug-getdate1.c (do_test): Don't use century values which 2007-12-12 18:23:00 +00:00
bug-mktime1.c [BZ #2821] 2006-09-09 16:56:29 +00:00
clock.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
clocktest.c Make local functions static. 2000-12-27 20:26:07 +00:00
ctime_r.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ctime.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
datemsk * time/Makefile (tst-getdate-ENV): Add TZDIR to environment. 2001-07-18 09:43:36 +00:00
Depend * time/Makefile (tst-getdate-ENV): Add TZDIR to environment. 2001-07-18 09:43:36 +00:00
difftime.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dysize.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
era.c Fix strftime wcschr namespace (bug 17634). 2014-12-10 16:59:02 +00:00
ftime.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
getdate.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
getitimer.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
gettimeofday.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
gmtime.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
lc-time-cleanup.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
localtime.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Makefile New test for ftime 2014-09-18 13:26:53 +05:30
mktime.c Sync up mktime with gnulib 2014-06-28 06:15:54 +05:30
offtime.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
setitimer.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
settimeofday.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
stime.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
strftime_l.c Fix Wundef warning for HAVE_STRFTIME 2014-07-10 14:20:42 +05:30
strftime.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
strptime_l.c Fix -Wundef warning for HAVE_LOCALTIME_R 2014-07-10 14:21:27 +05:30
strptime.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
test_time.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
time.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
time.h Complete _BSD_SOURCE / _SVID_source followup cleanup. 2014-02-21 21:45:26 +00:00
timegm.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
timespec_get.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst_wcsftime.c Update. 1999-06-16 22:55:47 +00:00
tst-ftime_l.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-ftime.c New test for ftime 2014-09-18 13:26:53 +05:30
tst-getdate.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-mktime2.c Testsuite #include fixes. 2012-04-02 22:31:32 +02:00
tst-mktime3.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-mktime.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-posixtz.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-strftime.c (do_test): Add tests for - flag. 2003-05-11 22:41:23 +00:00
tst-strptime2.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-strptime3.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-strptime-whitespace.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-strptime.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tzfile.c Fix tzfile.c namespace (bug 17583). 2014-11-12 16:22:51 +00:00
tzset.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
Versions Sort Versions files 2013-02-17 16:34:04 +01:00
wcsftime_l.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
wcsftime.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00