* dlltool.c (PAGE_SIZE): Delete.
(PAGE_MASK): Provide default definition based on COFF_PAGE_SIZE.
Check for DLLTOOL_DEFAULT_MX86_64 and DLLTOOL_DEFAULT_I386.
* coff-i386.h (COFF_PAGE_SIZE): Definition moved to coff/i386.h
* i386lh (COFF_PAGE_SIZE): Define.
* x86_64.h (COFF_PAGE_SIZE): Define.
* libc/include/sys/reent.h (_Kmax): Define here based on the sizeof
size_t, as in latest NetBSD.
* libc/reent/reent.c (_reclaim_reent): Use _Kmax rather than constant
value 15.
* libc/stdlib/mprec.c (_Kmax): Don't define here. Explain why.
socket handle value to debug output.
(fhandler_socket::fixup_after_fork): Ditto. Make new socket handle
OVERLAPPED, just as if it has been created with socket().
* net.cc (fdsock): Close duplicated socket and explain why. Disable
the entire WSADuplicateSocket test for now and explain why.
error codes. Always refuse non "user." EAs for Linux compatibility
and return EOPNOTSUPP. Fix handling of empty (== non-existant) EAs.
Always prepend "user." prefix to EA names.
(write_ea): Try to open file first to have more sensible error codes.
Always refuse non "user." EAs for Linux compatibility and return
EOPNOTSUPP. Delay skipping "user." prefix until after potential call
to read_ea.
_mbtowc_r with direct call to __mbtowc.
* libc/stdio/vfscanf.c: Ditto.
* libc/stdlib/btowc.c: Include local.h. Replace call to _mbtowc_r
with direct call to __mbtowc.
* libc/stdlib/mblen.c: Ditto.
* libc/stdlib/mblen_r.c: Ditto.
* libc/stdlib/mbrtowc.c: Ditto.
* libc/stdlib/mbstowcs_r.c: Ditto.
* libc/stdlib/mbtowc.c: Ditto.
* libc/stdlib/wcrtomb.c: Include local.h. Replace call to _wctomb_r
with direct call to __wctomb.
* libc/stdlib/wcsnrtombs.c: Ditto.
(_wcsnrtombs_r): Ditto.
* libc/stdlib/wcstombs_r.c: Ditto.
* libc/stdlib/wctob.c: Ditto.
* libc/stdlib/wctomb.c: Ditto.
* libc/stdlib/mbrtowc.c (mbrtowc): Implement independently from
_mbrtowc_r, unless PREFER_SIZE_OVER_SPEED or __OPTIMIZE_SIZE__ are
defined.
* libc/stdlib/wcrtomb.c (wcrtomb): Implement independently from
_wcrtomb_r, unless PREFER_SIZE_OVER_SPEED or __OPTIMIZE_SIZE__ are
defined.
* libc/stdlib/mbtowc_r.c (__utf8_mbtowc): Drop unnecessary test for
ch >= 0.
* autoload.cc (WSADuplicateSocketW): Define.
(WSASocketW): Define.
* dtable.cc (dtable::release): Call dec_need_fixup_before if necessary.
(dtable::fixup_before_fork): New function.
(dtable::fixup_before_exec): New function.
* dtable.h (class dtable): Add member cnt_need_fixup_before. Add
declarations for above new functions.
(dtable::dec_need_fixup_before): New inline method.
(dtable::inc_need_fixup_before): New inline method.
(dtable::need_fixup_before): New inline method.
* fhandler.h (fhandler_base::fixup_before_fork_exec): New virtual
method.
(fhandler_base::need_fixup_before): New virtual method.
(class fhandler_socket): Add member prot_info_ptr.
(fhandler_socket::init_fixup_before): Declare.
(fhandler_socket::need_fixup_before): New inline method.
(fhandler_socket::fixup_before_fork_exec): Declare.
(fhandler_socket::fixup_after_exec): Declare.
* fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
prot_info_ptr to NULL.
(fhandler_socket::~fhandler_socket): Free prot_info_ptr conditionally.
(fhandler_socket::init_fixup_before): New method.
(fhandler_socket::fixup_before_fork_exec): Ditto.
(fhandler_socket::fixup_after_fork): Use WSASocketW to duplicate
socket if necessary.
(fhandler_socket::fixup_after_exec): New method.
(fhandler_socket::dup): Use fixup_before_fork_exec/fixup_after_fork
to duplicate socket if necessary.
* fork.cc (frok::parent): Start child suspended if some fhandler
needs fixup before fork. If so, call dtable::fixup_before_fork after
CreateProcess and resume child.
* net.cc (fdsock): Try to find out if socket needs fixup before and
initialize socket accordingly. Add HUGE comment to explain what happens
and why.
* spawn.cc (spawn_guts): Start child suspended if some fhandler needs
fixup before exec. If so, call dtable::fixup_before_exec after
CreateProcess.
of ppl and cloog. Fix in-tree configury of libelf, skip tests.
Fix portability of test of C++ as bootstrap language. Add
ppl/src/ppl-config.o to the bootstrap compare exclusion list.
* configure: Rebuild.
* Makefile.def: Drop host and target settings from gmp, mpfr, ppl,
and cloog. Fix in-tree ppl configuration. Introduce libelf
in-tree building.
* Makefile.tpl (POSTSTAGE1_CXX_EXPORT): New.
(POSTSTAGE1_HOST_EXPORTS): Use it.
(STAGE[+id+]_CXXFLAGS): New.
(BASE_FLAGS_TO_PASS): Pass it down.
(configure-stage[+id+]-[+prefix+][+module+]): Use it. Add
extra_exports.
(all-stage[+id+]-[+prefix+][+module+]): Likewise.
(configure-[+prefix+][+module+], all-[+prefix+][+module+]): Add
extra_exports.
* Makefile.in: Rebuild.
* configure.ac (FLAGS_FOR_TARGET): Add -L and -isystem
paths for *-w64-mingw* and x86_64-*mingw*.
* configure: Regenerated.
* configure.ac: Disable target-winsup & co for
x86_64-*-mingw* and *-w64-mingw* targets.
* configure: Regenerated.
* configure.ac (CLooG test): Use = with test.
* configure: Regenerate.
* configure.ac: Do not set LIBS for ppl/cloog checks. Disable
cloog if the ppl version check failed. Move flags saving
before setting in libelf check.
* configure: Regenerate.
* configure.ac: Adjust the ppl and cloog configure to work as
documented. Disable cloog if ppl was disabled. Omit the version
checks if they were disabled.
* configure: Re-generate.