Commit Graph

876 Commits

Author SHA1 Message Date
Siddhesh Poyarekar
9cd4747089 Add new macro IN_MODULE to identify module in which source is built
The current scheme to identify which module a translation unit is
built in depends on defining multiple macros IS_IN_* and also defining
NOT_IN_libc if we're building a non-libc module.  In addition, there
is an IN_LIB macro that does effectively the same thing, but for
different modules (notably the systemtap probes).  This macro scheme
unifies both ideas to use just one macro IN_MODULE and assign it a
value depending on the module it is being built into.  If the module
is not defined, it defaults to MODULE_libc.

Patches that follow will replace uses of IS_IN_* variables with the
IS_IN() macro.  libc-symbols.h has been converted already to give an
example of how such a transition will look.

Verified that there are no relevant binary changes.  One source change
that will crop up repeatedly is that of nscd_stat, since it uses the
build timestamp as a constant in its logic.

	* Makeconfig (in-module): Get value of libof set for the
	translation unit.
	(CPPFLAGS): Use $(in-module).
	* Makerules: Don't suffix routine names for nonlib.
	* include/libc-modules.h: New file.
	* include/libc-symbols.h: Include libc-modules.h
	(IS_IN): New macro to replace IS_IN_* macros.
	* elf/Makefile: Set libof-* for each routine.
	* elf/rtld-Rules: Likewise.
	* extra-modules.mk: Likewise.
	* iconv/Makefile: Likewise.
	* iconvdata/Makefile: Likewise.
	* locale/Makefile: Likewise.
	* malloc/Makefile: Likewise.
	* nss/Makefile: Likewise.
	* sysdeps/gnu/Makefile: Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile: Likewise.
	* sysdeps/unix/sysv/linux/Makefile: Likewise.
	* sysdeps/s390/s390-64/Makefile: Likewise.
	* nscd/Makefile: Set libof-* for each routine.  Set CFLAGS and
	CPPFLAGS for nscd instead of nonlib.
2014-11-19 12:13:54 +05:30
Joseph Myers
9975e3d37d Fix locale memmem namespace (bug 17585).
Locale code, brought in by ISO C functions, calls memmem, which is not
an ISO C function.  This isn't an ISO C conformance bug, because all
mem* names are reserved, but glibc practice is not to rely on that
reservation (thus, memmem is only declared in string.h if __USE_GNU
even though ISO C would allow it to be declared unconditionally, for
example).  This patch changes that code to use __memmem.

Note: there are uses of memmem elsewhere in glibc that I didn't
change, although it may turn out some of those also need to use
__memmem.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by this patch).

	[BZ #17585]
	* string/memmem.c [!_LIBC] (__memmem): Define to memmem.
	(memmem): Rename to __memmem and define as weak alias of
	__memmem.  Use libc_hidden_weak.
	(__memmem): Use libc_hidden_def.
	* include/string.h (__memmem): Declare.  Use libc_hidden_proto.
	* locale/findlocale.c (valid_locale_name): Use __memmem instead of
	memmem.
2014-11-12 22:41:03 +00:00
Tatiana Udalova
fb89b46d1d New Bhilodi and Tulu locales (BZ #17475) 2014-11-12 17:06:39 +05:30
Roland McGrath
a62b3c15de Minor cleanup in locale.c 2014-09-12 16:07:23 -07:00
Roland McGrath
d7e49b19d3 Minor cleanup in ld-ctype.c 2014-09-12 15:59:10 -07:00
Roland McGrath
8c0ab919f6 Move findidx nested functions to top-level. 2014-09-11 16:02:17 -07:00
Florian Weimer
4e8f95a0df _nl_find_locale: Improve handling of crafted locale names [BZ #17137]
Prevent directory traversal in locale-related environment variables
(CVE-2014-0475).
2014-07-10 16:29:55 +02:00
Florian Weimer
d183645616 setlocale: Use the heap for the copy of the locale argument
This avoids alloca calls with potentially large arguments.
2014-07-10 16:29:34 +02:00
Siddhesh Poyarekar
c3c7c3604f Fix -Wundef warning for HAVE_OBSTACK
Remove the HAVE_OBSTACK macro check and include obstack check in
include path order since we don't have a copy of obstack.h in the
current directory.
2014-07-10 14:18:13 +05:30
Roland McGrath
26ffd5e6c7 Clean up HAVE_CONFIG_H and STDC_HEADERS. 2014-06-20 20:04:47 -07:00
Andreas Schwab
b60ea6fff5 Fix searching localedef input on I18NPATH (BZ #16984) 2014-05-26 12:32:57 +02:00
Aurelien Jarno
ae75a883f2 fix nl_langinfo with static linking (BZ #16915)
For static linking the locale code avoids linking code and data for
unused categories. However for nl_langinfo we know only at runtime which
categories are used, so direct reference to every nl_current_CATEGORY
symbol should be done.

This was broken by commit bc3e1c1273 where
nl_langinfo_l and nl_langinfo have been merged and some code has been
lost in the process.

In order to detect locales issues with static linking, compile a version
of tst-langinfo with static linking.

Note: this is Debian bug#747103 reported by Raphael <raphael.astier@eliot-sa.com>
2014-05-20 18:43:14 +02:00
Adam Conrad
7776e6692f Revert incorrect removal of the XDR currency from locale/iso-4217.def
In 7447ccd98e, the XDR currency was
removed from locale/iso-4217.def, despite the fact that it's both
still a part of the standard, according to the official table:

http://www.currency-iso.org/dam/downloads/table_a1.xml

... and, more importantly, is referenced from localedata/i18n, so
any quick-and-dirty locale definition that uses "copy i18n" for
LC_MONETARY wouldn't work anymore.
2014-05-03 23:45:15 -06:00
Joseph Myers
a5f891ac8d Consistently include Makeconfig after defining subdir.
In <https://sourceware.org/ml/libc-alpha/2014-01/msg00196.html> I
noted it was necessary to add includes of Makeconfig early in various
subdirectory makefiles for the tests-special variable settings added
by that patch to be conditional on configuration information.  No-one
commented on the general question there of whether Makeconfig should
always be included immediately after the definition of subdir.

This patch implements that early inclusion of Makeconfig in each
directory (which is a lot easier than consistent placement of includes
of Rules).  Includes are added if needed, or moved up if already
present.  Subdirectory "all:" targets are removed, since Makeconfig
provides one.

There is potential for further cleanups I haven't done.  Rules and
Makerules have code such as

ifneq   "$(findstring env,$(origin headers))" ""
headers :=
endif

to override to empty any value of various variables that came from the
environment.  I think there is a case for Makeconfig setting all the
subdirectory variables (other than subdir) to empty to ensure no
outside value is going to take effect if a subdirectory fails to
define a variable.  (A list of such variables, possibly out of date
and incomplete, is in manual/maint.texi.)  Rules and Makerules would
give errors if Makeconfig hadn't already been included, instead of
including it themselves.  The special code to override values coming
from the environment would then be obsolete and could be removed.

Tested x86_64, including that installed binaries are identical before
and after the patch.

	* argp/Makefile: Include Makeconfig immediately after defining
	subdir.
	* assert/Makefile: Likewise.
	* benchtests/Makefile: Likewise.
	* catgets/Makefile: Likewise.
	* conform/Makefile: Likewise.
	* crypt/Makefile: Likewise.
	* csu/Makefile: Likewise.
	(all): Remove target.
	* ctype/Makefile: Include Makeconfig immediately after defining
	subdir.
	* debug/Makefile: Likewise.
	* dirent/Makefile: Likewise.
	* dlfcn/Makefile: Likewise.
	* gmon/Makefile: Likewise.
	* gnulib/Makefile: Likewise.
	* grp/Makefile: Likewise.
	* gshadow/Makefile: Likewise.
	* hesiod/Makefile: Likewise.
	* hurd/Makefile: Likewise.
	(all): Remove target.
	* iconvdata/Makefile: Include Makeconfig immediately after
	defining subdir.
	* inet/Makefile: Likewise.
	* intl/Makefile: Likewise.
	* io/Makefile: Likewise.
	* libio/Makefile: Likewise.
	(all): Remove target.
	* locale/Makefile: Include Makeconfig immediately after defining
	subdir.
	* login/Makefile: Likewise.
	* mach/Makefile: Likewise.
	(all): Remove target.
	* malloc/Makefile: Include Makeconfig immediately after defining
	subdir.
	(all): Remove target.
	* manual/Makefile: Include Makeconfig immediately after defining
	subdir.
	* math/Makefile: Likewise.
	* misc/Makefile: Likewise.
	* nis/Makefile: Likewise.
	* nss/Makefile: Likewise.
	* po/Makefile: Likewise.
	(all): Remove target.
	* posix/Makefile: Include Makeconfig immediately after defining
	subdir.
	* pwd/Makefile: Likewise.
	* resolv/Makefile: Likewise.
	* resource/Makefile: Likewise.
	* rt/Makefile: Likewise.
	* setjmp/Makefile: Likewise.
	* shadow/Makefile: Likewise.
	* signal/Makefile: Likewise.
	* socket/Makefile: Likewise.
	* soft-fp/Makefile: Likewise.
	* stdio-common/Makefile: Likewise.
	* stdlib/Makefile: Likewise.
	* streams/Makefile: Likewise.
	* string/Makefile: Likewise.
	* sunrpc/Makefile: Likewise.
	(all): Remove target.
	* sysvipc/Makefile: Include Makeconfig immediately after defining
	subdir.
	* termios/Makefile: Likewise.
	* time/Makefile: Likewise.
	* timezone/Makefile: Likewise.
	(all): Remove target.
	* wcsmbs/Makefile: Include Makeconfig immediately after defining
	subdir.
	* wctype/Makefile: Likewise.

libidn/ChangeLog:
	* Makefile: Include Makeconfig immediately after defining subdir.

localedata/ChangeLog:
	* Makefile: Include Makeconfig immediately after defining subdir.
	(all): Remove target.

nptl/ChangeLog:
	* Makefile: Include Makeconfig immediately after defining subdir.

nptl_db/ChangeLog:
	* Makefile: Include Makeconfig immediately after defining subdir.
2014-02-26 23:12:03 +00:00
Ondřej Bílka
a1ffb40e32 Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
Allan McRae
88726d48af Update remaining copyright dates
Update copyright years that are not handled by scripts/update-copyright.
2014-01-01 22:02:55 +10:00
Allan McRae
d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Aurelien Jarno
18d1425127 locale: don't crash if locale-archive contains all zeros
In case of power failure followed by filesystem issues locale-archive
can end-up containing all zeros. In that case all calls to setlocale()
generate a SIGFPE. This renders a system with a default non-C locale
unbootable.

Avoid this by ignoring the locale instead of generating a SIGFPE.
2013-12-03 11:16:16 +01:00
Siddhesh Poyarekar
4712799fbb Fix build warning in locarchive.c 2013-11-20 18:19:57 +05:30
Siddhesh Poyarekar
0417b20fe6 Rename Oriya locale to Odia (bug 15601)
The state of Orissa was officially renamed the state to Odisha and the
language from Oriya to Odia in 2010.

References:

http://zeenews.india.com/election09/story.aspx?aid=739995
http://orissamatters.com/2011/11/07/orissa-became-odisha/
http://www.ndtv.com/article/india/parliament-passes-bill-to-change-orissa-s-name-93888
http://orissa.gov.in/e-magazine/Orissareview/2011/Nov/engpdf/9-17.pdf
2013-11-20 17:47:41 +05:30
Andreas Schwab
b5449b1296 Complete display of LC_MONETARY 2013-11-19 11:53:00 +01:00
Andreas Schwab
a7931fcfba Properly handle unavailable elements in LC_MONETARY category 2013-11-18 12:50:09 +01:00
Chris Leonard
1820b143aa Add Chitwani Tharu (the) 2013-11-15 12:33:40 -05:00
Andreas Schwab
714bd261e8 Fix country_num element in LC_ADDRESS for C locale 2013-11-14 16:02:59 +01:00
Chris Leonard
f6e12daa51 Correct Walaita (wal) and add Unami Delaware (unm). 2013-11-04 11:04:19 -05:00
Chris Leonard
ae129d3ca6 Add Quechua, Southern (quz) and Silesian (szl) to iso-639.def. 2013-11-03 12:43:06 -05:00
Chris Leonard
1d70fd6c75 Add Central Nahuatl (nhn). 2013-11-01 09:11:26 -04:00
Chris Leonard
da5579c2dd Add Meadow Mari (mhr). 2013-10-31 19:52:31 -04:00
Chris Leonard
b85545a671 Adjust language-code fields of LC_ADDRESS. 2013-10-24 11:43:38 -04:00
Carlos O'Donell
484c12fb1e Enhance localedef --list-archive option.
The localedef --list-archive option claims that it can
accept a [file] argument and list the contents of that
archive. The support was never implemented. This patch
adds that support and allows --list-archive to work as
expected. You can now use localedef to list the contents
of arbitrary locale archives by using:
./localedef --list-archive file
2013-10-18 23:44:35 -04:00
Richard Sandiford
5abe068233 Fix localedef collation handling of <U0000> (bug 15948). 2013-10-18 20:58:31 +00:00
Reuben Thomas
9cd8330240 Fix typo in setlocale.c. Fixes BZ #15764 2013-10-12 14:32:09 +02:00
Joseph Myers
7602d070dc Clean up locale file alignment handling. 2013-10-08 00:14:08 +00:00
Chris Leonard
428d8c5e69 Fix typos in 3166.def. 2013-10-04 18:51:42 -04:00
Chris Leonard
afee9c1a25 Correct error in iso-3166.def 2013-10-04 09:48:45 -04:00
Chris Leonard
c755294d3c Update iso-1366.def and related occurrences 2013-10-04 08:35:44 -04:00
Joseph Myers
d3d237560b Hardcode locale archive page size as 4096. 2013-10-03 22:00:05 +00:00
Joseph Myers
975569d0d9 Remove locale file dependence on int32_t alignment. 2013-10-03 21:51:32 +00:00
Chris Leonard
e74a6fd906 Fix ayc_PE.UTF-8 and lzh_TW.UTF-8 build issues 2013-09-28 20:32:16 -04:00
Joseph Myers
6055173a0f Add localedef --big-endian and --little-endian options. 2013-09-24 22:07:47 +00:00
Joseph Myers
a3a6c3129f Make locale archive hash function architecture-independent. 2013-09-23 23:03:34 +00:00
Chris Leonard
354a7a548f Update iso-639.def 2013-09-19 20:34:03 -04:00
Richard Sandiford
08ffcf34d9 Fix some types in localedef. 2013-09-13 23:31:10 +00:00
Richard Sandiford
1ecbb381ae Make localedef output generation use more logical interfaces. 2013-09-06 17:20:45 +00:00
Chris Leonard
7447ccd98e Update iso-1427.def and related occurrences. 2013-09-04 11:42:53 -04:00
Ondřej Bílka
f24a6d086b Fix then/than typos. 2013-08-30 18:10:31 +02:00
Andreas Schwab
45b8acccaf Fix missing declaration of LC_CTYPE nonascii-case element 2013-08-27 12:21:12 +02:00
Richard Henderson
1d17fa5f8e Fix missing libc-internal.h include.
* locale/programs/locarchive.c: Include <libc-internal.h>
2013-06-25 11:21:20 -07:00
Mike Frysinger
17db6e8d6b [BZ #10283] localedef: align fixed maps to SHMLBA
Many Linux arches require fixed mmaps to be aligned higher than pagesize,
so use the SHMLBA define as it represents this quantity exactly.

This fixes spurious errors seen on those arches like:
cannot map archive header: Invalid argument

URL: http://sourceware.org/bugzilla/show_bug.cgi?id=10283
Reported-by: CHIKAMA Masaki <masaki.chikama@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-06-24 20:26:58 -04:00
Siddhesh Poyarekar
59b3055595 Convert iso-639.def to utf-8 2013-06-11 22:14:43 +05:30