Corinna Vinschen [Wed, 10 Feb 2010 10:44:21 +0000 (10:44 +0000)]
* nlsfuncs.cc (__get_lcid_from_locale): Convert iu_CA to iu-Latn-CA
rather than iu-Cans-CA on Vista and later.
(__set_charset_from_locale): Set default charset for iu_CA to UTF-8.
* dcrt0.cc (_dll_crt0): Set _main_tls as early as possible.
* thread.cc (pthread_mutex::can_be_unlocked): Remove check for
MUTEX_OWNER_ANONYMOUS since it is racy and unsafe.
(pthread::init_mainthread): Initialize thread directly from _my_tls.
(pthread::self): Ditto.
(pthread::get_tls_self_pointer): Delete.
(pthread_mutex::pthread_mutex): Use an event rather than a semaphore.
(pthread_mutex::lock): Rename from _<func>. Derive self directly.
(pthread_mutex::tryunlock): Ditto.
(pthread_mutex::destroy): Ditto.
(pthread_mutex::unlock): Ditto. Accommodate change from semaphore to event.
(pthread_mutex::_fixup_after_fork): Accommodate change from semaphore to event.
(pthread_mutex::init): Don't attempt to initialize a semaphore unless it is in
an initialized state. Do this check under mutex_initialization_lock.lock
* thread.h (fast_mutex::init): Use event rather than semaphore.
(fast_mutex::lock): Ditto.
(pthread_mutex::_lock): Delete.
(pthread_mutex::_unlock): Ditto.
(pthread_mutex::_trylock): Ditto.
(pthread_mutex::_destroy): Ditto.
(pthread_mutex::get_pthread_self): Ditto.
(pthread_mutex::get_tls_self_pointer): Ditto.
(pthread_mutex::lock): Un-inline.
(pthread_mutex::unlock): Ditto.
(pthread_mutex::trylock): Ditto.
(pthread_mutex::destroy): Ditto.
* nlsfuncs.cc (lc_wcstombs): Add `return_invalid' flag to specify
whether invalid chars should be ignored or not. Change comment.
(__set_lc_monetary_from_win): Call lc_wcstombs with return_invalid
flag set.
(__set_lc_messages_from_win): Simplify to accommodate the fact that
lc_wcstombs just ignores invalid chars. Explain why.
* lc_msg.h: New file, autogenerated from CLDR data.
* nlsfuncs.cc: Include lc_msg.h.
(lc_time_buf): Remove.
(lc_numeric_buf): Remove.
(lc_monetary_buf): Remove.
(lc_mbstowcs): Fix previous fix.
(__set_lc_time_from_win): Take additional pointer to buffer pointer,
defined in newlib.
(__set_lc_numeric_from_win): Ditto.
(__set_lc_monetary_from_win): Ditto.
(locale_cmp): New static function.
(__set_lc_messages_from_win): New function to be called from newlib.
* libc/locale/lmessages.c (__messages_load_locale): Take additional
parameters for wide char to multibyte conversion. Call
__set_lc_messages_from_win on Cygwin.
* libc/locale/lmessages.h: Make C++-safe.
(__messages_load_locale): Change declaration.
* libc/locale/lmonetary.c (__monetary_load_locale): Use
_monetary_locale_buf as buffer pointer.
* libc/locale/lnumeric.c (__numeric_load_locale): Use
_numeric_locale_buf as buffer pointer.
* libc/locale/timelocal.c (__time_load_locale): Use time_locale_buf
as buffer pointer.
* libc/locale/locale.c (loadlocale): Enable loading LC_MESSAGES data
on Cygwin.
* elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add loc_hash_table
and loc_hash_memory.
(_bfd_sparc_elf_link_hash_table_free): Declare.
* elf32-sparc.c (elf32_sparc_add_symbol_hook): New.
(elf_backend_add_symbol_hook, elf_backend_post_process_headers,
bfd_elf32_bfd_link_hash_table_free): Define.
* elf64-sparc.c (elf64_sparc_add_symbol_hook): Set
has_ifunc_symbols if STT_GNU_IFUNC.
(bfd_elf64_bfd_link_hash_table_free): Define.
(elf_backend_post_process_headers): Define always.
* elfxx-sparc.c (sparc_jmp_irel_howto, sparc_irelative_howto): New.
(sparc_reloc_map): Add entries for new IFUNC relocs.
(_bfd_sparc_elf_reloc_type_lookup): Handle new IFUNC relocs.
(_bfd_sparc_elf_info_to_howto_ptr): Likewise.
(elf_sparc_local_htab_hash, elf_sparc_local_htab_eq,
elf_sparc_get_local_sym_hash): New.
(_bfd_sparc_elf_create_dynamic_sections): Move PLT ops initialization
from here...
(_bfd_sparc_elf_link_hash_table_create): ... to here. Allocate
local hash table.
(_bfd_sparc_elf_link_hash_table_free): New.
(create_ifunc_sections): New.
(_bfd_sparc_elf_check_relocs): Unconditionally assign htab->elf.dynobj
and call create_ifunc_sections(). For local STT_GNU_IFUNC symbols
cons up a fake local hash table entry for it. Unconditionally add
a PLT refcount for STT_GNU_IFUNC symbols when h->def_regular. Count
dyn relocs for ifunc.
(_bfd_sparc_elf_adjust_dynamic_symbol): Handle ifunc.
(allocate_dynrelocs): Unconditionally emit a PLT entry when STT_GNU_IFUNC
and h->def_regular. Count GOT dyn relocs for ifunc.
(allocate_local_dynrelocs): New function.
(_bfd_sparc_elf_size_dynamic_sections): Invoke it over the local hash table.
Emit dynamic relocs to irelplt when not shared. Treat iplt like splt.
(_bfd_sparc_elf_relocate_section): Handle ifunc relocations by hand.
(_bfd_sparc_elf_finish_dynamic_symbol): Adjust for non-dynamic ifunc plt
in iplt/irelplt.
* external.cc (cygwin_internal): Add CW_INT_SETLOCALE case to
allow to call internal_setlocale().
* nlsfuncs.cc (internal_setlocale): Make externally available.
* include/cygwin/version.h: Bump API minor number.
* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_INT_SETLOCALE.
* libc/locale/locale.c: Add Cygwin's /usr/share/locale/locale.alias
support to documentation.
(__set_locale_from_locale_alias): Declare when build for Cygwin.
(loadlocale): On Cygwin, if locale can't be recognized, call
__set_locale_from_locale_alias to check for locale alias.
Define FAIL macro to replace `return NULL' statements. Replace
throughout.
* libc/locale/locale.c: Fix typo in documentation. Remove useless
_MB_CAPABLE guards within other _MB_CAPABLE guards. Add comment
to remaining #endif's.
* nlsfuncs.cc (has_modifier): MOve up in file to use in
__get_lcid_from_locale as well.
(__get_lcid_from_locale): Handle no_NO locale as alias for nn_NO.
Default all sr_XY locales to Cyrillic script. Change lcid to Latin
script if "@latin" modifier has been specified.
(__set_charset_from_locale): Handle Serbian in codepage 1251 case as
well. Also check for sr_BA lcid. Restrict "@euro" modifier to
locales otherwise defaulting to ISO-8859-1.
* new-features.sgml (ov-new1.7.2): Add support for new charsets.
Change text for modifier support.
(setup-locale-charsetlist): Add new GEORGIAN-PS and PT154 charsets
to list of supported charsets. Reorder list for non-ISO, non-CP
charsets alphabetically.
* libc/ctype/ctype_cp.h (_CTYPE_GEORGIAN_PS_128_254): Define.
(_CTYPE_GEORGIAN_PS_255): Define.
(_CTYPE_PT154_128_254): Define.
(_CTYPE_PT154_255): Define.
(__ctype_cp): Add array members for above ctype definitions.
* libc/locale/locale.c (loadlocale): Make TIS-620 charset name
available for all targets. Add guards for setting the conversion
function pointers. Add support for GEORGIAN-PS and PT154 charsets.
Change documentation to reflect current behaviour more closely.
* libc/locale/nl_langinfo.c (nl_langinfo): On Cygwin, translate
"CP101" to "GEORGIAN-PS" and "CP102" to "PT154".
* libc/stdlib/sb_charsets.c (__cp_conv): Add conversion arrays
for GEORGIAN-PS and PT154.
(__cp_index): Map invalid Windows codepage number 101 to
GEORGIAN-PS conversion array, 102 to PT154 conversion array.
* sec_auth.cc (get_full_privileged_inheritable_token): New function
to fetch token with full privileges from logon token in Vista and
later, and to make token inheritable. Add lengthy comments to explain
the function's job.
(cygwin_logon_user): Drop calling SetHandleInformation. Enable TCB
privilege and call get_full_privileged_inheritable_token.
(lsaauth): Don't fetch linked token and don't make handle inheritable
here, just call get_full_privileged_inheritable_token instead.
(lsaprivkeyauth): Ditto.
* setup2.sgml (setup-locale-ov): Add description for "uz_UZ@cyrillic"
and "tt_RU@iqtelif" modifiers. Slightly rephrase locale specifier
description in terms of the modifier string.
* libc/stdio/vfprintf.c: Include locale.h also if _WANT_IO_C99_FORMATS
is defined. Raise conversion buffer size to make sure it has enough
room for numbers plus grouping character. Define GROUPING flag.
(_VFPRINTF_R): Add PRINTANDPAD macro. Handle grouping flag character.
Handle grouping for decimal integer and float values.
* libc/stdio/vfwprintf.c: Ditto.
* libc/stdlib/__atexit.c (__atexit_lock): Define a global lock for atexit
functions.
(__register_exitproc): Use __atexit_lock rather than a local static lock.
* libc/stdlib/__call_atexit.c: Ditto.
* regex/engine.c (step): Declare and define with `int ch' rather than
`wint_t ch' parameter. Explain why.
(NONCHAR): Remove related Cygwin patch here, including wrong comment.
Replace regex files with multibyte-aware version from FreeBSD.
* Makefile.in (install-headers): Remove extra command to install
regex.h.
(uninstall-headers): Remove extra command to uninstall regex.h.
* nlsfuncs.cc (collate_lcid): Make externally available to allow
access to collation internals from regex functions.
(collate_charset): Ditto.
* wchar.h: Add __cplusplus guards to make C-clean.
* include/regex.h: New file, replacing regex/regex.h. Remove UCB
advertising clause.
* regex/COPYRIGHT: Accommodate BSD license. Remove UCB advertising
clause.
* regex/cclass.h: Remove.
* regex/cname.h: New file from FreeBSD.
* regex/engine.c: Ditto.
(NONCHAR): Tweak for Cygwin.
* regex/engine.ih: Remove.
* regex/mkh: Remove.
* regex/regcomp.c: New file from FreeBSD. Tweak slightly for Cygwin.
Import required collate internals from nlsfunc.cc.
(p_ere_exp): Add GNU-specific \< and \> handling for word boundaries.
(p_simp_re): Ditto.
(__collate_range_cmp): Define.
(p_b_term): Use Cygwin-specific collate internals.
(findmust): Ditto.
* regex/regcomp.ih: Remove.
* regex/regerror.c: New file from FreeBSD. Fix a few compiler warnings.
* regex/regerror.ih: Remove.
* regex/regex.7: New file from FreeBSD. Remove UCB advertising clause.
* regex/regex.h: Remove. Replaced by include/regex.h.
* regex/regexec.c: New file from FreeBSD. Fix a few compiler warnings.
* regex/regfree.c: New file from FreeBSD.
* regex/tests: Remove.
* regex/utils.h: New file from FreeBSD.
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Workaround
another bug in NWFS. Add comment to explain why. Improve debug output
in case the NT calls to test for binary fail.
* path.h (path_conv::fs_is_cifs): New method.
(path_conv::fs_is_nwfs): New method.
* include/paths.h (_PATH_MNTTAB): Define.
(_PATH_MOUNTED): Define.
* include/mntent.h: Include paths.h. Define MNTTAB and MOUNTED as their
paths.h equivalents. Add comment.
* dcrt0.cc (atexit_lock): Delete.
(cygwin_exit): Remove atexit lock.
(cygwin_atexit): Ditto. Rename parameter to match newlib. Call __cxa_atexit
when invoked by a registered DLL.
* dll_init.cc (remove_dll_atexit): Delete.
(dll_list::find): New function.
(dll_list::detach): Use dll_list::find to find dll associated with return
address. Use __cxa_finalize to run atexit functions associated with the dll.
(cygwin_detach_dll): Don't assume that HANDLE == void *.
* dll_init.h (dll_list::find): Declare.
(__cxa_atexit): Ditto.
(__cxa_finalize): Ditto.
* init.cc (dll_entry): Clarify comment.
Corinna Vinschen [Fri, 29 Jan 2010 19:50:15 +0000 (19:50 +0000)]
* cyglsa.c: Include lmcons.h instead of lm.h to make newer WinDDK happy.
(LsaApLogonUserEx): Use CYG_LSA_MAGIC as checksum start value to
decouple from Cygwin release.
* make-64bit-version-with-visual-c.bat: Avoid compiler warning.
* cyglsa64.dll: New build.
* libc/strfmon.c (__setup_vars): Fix compiler warning about assigning const
strings. Compare a pointer to NULL rather than '\0'.
* dll_init.cc (dll_dllcrt0_1): Minor comment fix.
* pipe.cc (fhandler_pipe::create_selectable): Remove Win9x accommodation.
Corinna Vinschen [Fri, 29 Jan 2010 11:20:06 +0000 (11:20 +0000)]
Throughout, use FileBothDirectoryInformation info class rather than
FileDirectoryInformation info class to avoid problems with incomplete
filesystem implementations. Fix comments accordingly.
* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Set
fname->Length to 0 in error case to avoid potential crash in debug
output.
(fhandler_disk_file::readdir): Try to speed up the working default case.
Check for STATUS_INVALID_NETWORK_RESPONSE as potential status value
returned by filesystems not implementing FileIdBothDirectoryInformation.
* ntdll.h (STATUS_INVALID_NETWORK_RESPONSE): Define.
(FILE_BOTH_DIRECTORY_INFORMATION): Rename to official name.
* path.cc (symlink_info::check): Don't request FILE_READ_EA access, it's
not required for NFS. Try to speed up the working default case. Check
for STATUS_INVALID_NETWORK_RESPONSE as potential status value returned
by filesystems not supporting non-NULL EA parameters. Fix the way
fs.update is called. Improve debug output.
Corinna Vinschen [Mon, 25 Jan 2010 21:20:31 +0000 (21:20 +0000)]
* nlsfuncs.cc (__get_lcid_from_locale): Add comments. Fix typos in
comments. Make sure to set last_lcid every time. Return locale
without territory part as invalid. Handle modern serbian territory
names per ISO 3166 on older systems as well. Add appropriate comment.
(__set_charset_from_locale): Handle LCID for sr_CS as well to make older
systems happy.
Joern Rennecke [Mon, 25 Jan 2010 18:06:22 +0000 (18:06 +0000)]
gcc PR libstdc++/36101, gcc PR libstdc++/42813
* configure.ac (bootstrap_target_libs): Make inclusion of
target-libgomp conditional on libgomb being in target_configdirs.
* configure: Regenerate.
Corinna Vinschen [Sat, 23 Jan 2010 16:43:17 +0000 (16:43 +0000)]
* strfuncs.cc (__sjis_wctomb): Special handling for characters which
differ between SJIS and Windows codepage 932, if charset is "SJIS".
(__sjis_mbtowc): Ditto.
(_jis_wctomb): Remove.
(__jis_mbtowc): Remove.
Corinna Vinschen [Fri, 22 Jan 2010 22:32:42 +0000 (22:32 +0000)]
* new-features.sgml (ov-new1.7.2): Add chapter for news in 1.7.2.
* setup2.sgml (setup-locale-ov): Describe how valid locales are
determined by Windows locale support. Change description for modifiers
in locale environment variables.
(setup-locale-how): Describe new charset behaviour. Mention new
getlocale tool to fetch valid locale information from Windows.
(setup-locale-missing): Drop now implemented LC_foo options.
Explain missing LC_MESSAGES in more detail.
Corinna Vinschen [Fri, 22 Jan 2010 22:31:31 +0000 (22:31 +0000)]
* Makefile.in (DLL_OFILES): Add nlsfunc.o and strfmon.o.
* autoload.cc (LocaleNameToLCID): Define.
* cygwin.din (strfmon): Export.
* nlsfuncs.cc: New file. Define a lot of internal functions called
from setlocale.
(wcscoll): Implement locale-aware here, using CompareStringW function.
(strcoll): Ditto.
(wcsxfrm): Implement locale-aware here, usingLCMapStringW function.
(strxfrm): Ditto.
(__set_charset_from_locale): Replace __set_charset_from_codepage.
Return Linux-compatible charset.
* strfuncs.cc (__set_charset_from_codepage): Remove.
* wchar.h (__set_charset_from_codepage): Drop definition.
* wincap.h (wincaps::has_localenames): New element.
* wincap.cc: Implement above element throughout.
* libc/strfmon.c: New file.
* libc/strptime.cc: Remove locale constant strings in favor of
access to locale-specifc data.
(strptime): Point _CurrentTimeLocale to locale-specific data.
Throughout use correct locale-specific format fields for all
locale-specific formats.
* include/monetary.h: New file.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
Corinna Vinschen [Fri, 22 Jan 2010 13:03:42 +0000 (13:03 +0000)]
* libc/locale/lmonetary.c (__monetary_load_locale): Take additional
parameters for wide char to multibyte conversion. Call
__set_lc_monetary_from_win on Cygwin.
* libc/locale/lmonetary.h: Make C++-safe.
(__monetary_load_locale): Change declaration.
* libc/locale/lnumeric.c (__numeric_load_locale): Take additional
parameters for wide char to multibyte conversion. Call
__set_lc_numeric_from_win on Cygwin.
* libc/locale/lnumeric.h: Make C++-safe.
(__numeric_load_locale): Change declaration.
* libc/locale/locale.c (lconv): De-constify for Cygwin.
(__set_charset_from_locale): Rename from
__set_charset_from_codepage. Take locale as parameter instead of
a codepage.
(loadlocale): Allow "EUC-JP" for "EUCJP" and "EUC-KR" for "EUCKR".
Change documnetation accordingly. Enable LC_COLLATE, LC_MONETARY,
LC_NUMERIC, and LC_TIME handling on Cygwin.
(_localeconv_r): On Cygwin, copy values from monetary and numeric
domain if change has been noted.
* libc/locale/nl_langinfo.c (nl_langinfo): Accommodate change of
am/pm layout in struct lc_time_T.
* libc/locale/timelocal.c (_C_time_locale): Accommodate
redefinition of am/pm members.
(__time_load_locale): Take additional parameters for wide char
to multibyte conversion. Call __set_lc_time_from_win on Cygwin.
* libc/locale/timelocal.h: Make C++-safe.
(struct lc_time_T): Convert am and pm to a am_pm array for easier
consumption by strftime and strptime.
(__time_load_locale): Change declaration.
* libc/time/strftime.c: Change documentation to reflect changes to
strftime. Remove locale constant strings in favor of access to
locale-specifc data.
(_ctloc): Define access method for locale-specifc data.
(TOLOWER): Define for tolower conversion.
(strftime): Throughout, convert locale-specific formats to use
locale-specific data. Add GNU-specific "%P" format.
* libc/time/strptime.c: Remove locale constant strings in favor of
access to locale-specifc data.
(_ctloc): Define access method for locale-specifc data.
(strptime): Throughout, convert locale-specific formats to use
locale-specific data.