* libc/include/getopt.h: Hide newlib extensions under
the __need_getopt_newlib flag.
* libc/stdlib/getopt.c: #define __need_getopt_newlib before including
getopt.h. Put entire code under !HAVE_GETOPT to support platforms
with their own getopt implementation.
* configure.host: Specify HAVE_GETOPT for x86-linux.
* libc/include/sys/reent.h(_REENT_SMALL_CHECK_INIT): Specify
this macro completely instead of referring to CHECK_STD_INIT which
is only found in libc/stdio/local.h.
* libc/stdio/dprintf.c: Add include of local.h.
* libc/stdio/vdprintf.c: Ditto.
* libc/stdio/vdiprintf.c: Ditto.
* autoload.cc (CreateDesktopW): Replace CreateDesktopA.
(CreateWindowStationW): Replace CreateWindowStationA.
(GetUserObjectInformationW): Replace GetUserObjectInformationA.
* cygheap.h (cwdstuff::get): Assume default buffer size NT_MAX_PATH.
* cygtls.cc (_cygtls::remove): Free temporary TLS path buffers.
* cygtls.h (TP_NUM_C_BUFS): Define.
(TP_NUM_W_BUFS): Define.
(class tls_pathbuf): New class to store pointers to thread local
temporary path buffers.
(_local_storage::pathbufs): New member.
* environ.cc (win_env::add_cache): Use temporary TLS path buffer instead
of stack based buffer.
(posify): Get temporary outenv buffer from calling function.
(environ_init): Create temporary TLS path buffer for posify.
(build_env): Create Windows environment block as WCHAR buffer.
* environ.h (build_env): Change declaration accordingly.
* external.cc (sync_winenv): Accommodate build_env change.
* fhandler_console.cc (fhandler_console::need_invisible): Use
GetUserObjectInformationW and CreateWindowStationW.
* fhandler_process.cc (format_process_maps): Use temporary TLS path
buffer instead of stack based buffer.
* fork.cc (frok::parent): Convert to use CreateProcessW.
* path.cc: Throughout use temporary TLS path buffers instead of stack
based buffer. Replace checks for CYG_MAX_PATH by checks for
NT_MAX_PATH.
(getfileattr): New function to replace GetFileAttributesA.
(normalize_win32_path): Remove Win32 and NT long path prefixes.
(getwd): Assume PATH_MAX + 1 buffer per SUSv3.
* path.h (class path_conv): Set path buffer to size NT_MAX_PATH.
(iswdrive): Define.
* pinfo.cc (commune_process): Use temporary TLS path buffer instead of
stack based buffer.
* registry.cc (get_registry_hive_path): Ditto.
(load_registry_hive): Ditto.
* spawn.cc (spawn_guts): Convert to use CreateProcessW and
CreateProcessAsUserW.
(av::fixup): Open/close file using NtOpenFile/NtClose.
* syscalls.cc (mknod_worker): Allow PATH_MAX file name.
(mknod32): Ditto.
(getusershell): Ditto.
* tls_pbuf.cc: New file implementing tls_pathbuf and tmp_pathbuf
methods.
* tls_pbuf.h: New header for files using tmp_pathbuf.
* tlsoffsets.h: Regenerate.
* winsup.h (NT_MAX_PATH): Define as 32767 to avoid USHORT overflow.
NULL before closing.
* spawn.cc (spawn_guts): Don't close moreinfo->myself_pinfo explicitely
in case of failing CloseProcess.
* fhandler.cc (fhandler_base::open_): Return EISDIR when trying to
create a directory.
* path.cc (path_conv::check): If input path had a trailing dir
separator, tack it on to the native path if directory doesn't exist.
* libc/stdlib/gdtoa-hexnan.c (hexnan): When the optional
n-char-sequence is omitted, still parse the ().
-------------------------------------------------------------------
ourselves the exception handler and nothing else.
* exceptions.cc (open_stackdumpfile): Use correct format specifiers for unicode
when printing nameof stackdump file.
(stack_info::walk): Stop walking if ebp points into cygwin itself.
(_cygtls::handle_exceptions): Detect when signal is masked and treat as if it
was not caught. Reinitialize exception handler to known state to avoid
subsequent attempts to call Windows exception handlers if an exception occurs
in a signal handler. Revert to a 'return 0' rather than using a goto.
* strfuncs.cc (sys_wcstombs_alloc): Minor formatting tweak.
* winsup.h: Fix comment typo.
(_cygtls::init_threadlist_exceptions): Ditto.
* cygtls.cc (_cygtls::handle_threadlist_exception): Eliminate.
(_cygtls::init_threadlist_exceptions): Ditto.
(_cygtls::find_tls): Use myfault handling to deal with errors caused by
nonexistent threads.
exiting. Just return, don't set thread context.
* gendef (_setjmp): Store %fs:0 in jmp_buf.
(_sjfault): Ditto.
(_ljfault): Restore %fs:0 from jmp_buf.
(_longjmp): Ditto.
* libc/stdlib/getopt.c (getopt_internal): Rewrite to accept
data area so as to support reentrant calls. Change all callers
to fill in data area with global values and restore any changes
to the global values after call.
(__getopt_r, __getopt_long_r, __getopt_long_only_r): New routines
to support reentrancy that add a data area argument.
* libc/include/getopt.h: Add new _r routines and provide macros
so they can be called with using double-underscores.
instead of close to avoid calling close from wrong class when changing
a file system based device node.
(fhandler_disk_file::fchown): Ditto.
(fhandler_disk_file::facl): Ditto.
function never actually returns.
* exceptions.cc (_cygtls::handle_exceptions): Jump out of function rather than
returning to avoid meddling by previously installed exception handlers.
* h8300.h (h8_opcodes): Add an encoding for a mov.l instruction
with a 32-bit displacement but without the top bit of the 4th byte
set.
* gas/h8300/pr3134.s: New test.
* gas/h8300/pr3134.d: Expected disassembly
* gas/h8300/h8300.exp: Run the new test.
* gas/h8300/h8300-coff.exp: Fix test for COFF based ports to
accept h8300-rtemscoff not just h8300-rtems.
PR bootstrap/32009
PR bootstrap/32161
* configure.ac (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Compute here.
* configure: Regenerate.
* Makefile.def: Define stage_libcflags for all bootstrap stages.
* Makefile.tpl (BOOT_LIBCFLAGS, STAGE2_LIBCFLAGS, STAGE3_LIBCFLAGS,
STAGE4_LIBCFLAGS): New.
(CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Subst from autoconf, without
$(SYSROOT_CFLAGS_FOR_TARGET) and $(DEBUG_PREFIX_CFLAGS_FOR_TARGET).
(BASE_TARGET_EXPORTS): Append them here to C{,XX}FLAGS.
(EXTRA_TARGET_FLAGS): Append them here to {LIB,}C{,XX}FLAGS.
(configure-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags
for target modules. Don't export LIBCFLAGS.
(all-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags; pass
$(BASE_FLAGS_TO_PASS) where [+args+] was passed, and [+args+] after
the overridden CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
(invocations of `all'): Replace $(TARGET_FLAGS_TO_PASS) with
$(EXTRA_TARGET_FLAGS), $(FLAGS_TO_PASS) with $(EXTRA_HOST_FLAGS).
* Makefile.in: Regenerate.
config:
2008-02-20 Paolo Bonzini <bonzini@gnu.org>
PR bootstrap/32009
* mh-ppc-darwin (BOOT_CFLAGS): Reenable.