* path.cc (path_conv::set_normalized_path): Use crealloc_abort to avoid a
memory leak.
* path.h (path_conv::operator =): Just use cstrdup to allocate normalized_path,
avoiding attempt to free a pointer which is allocated in another pc.
Jeff Johnston [Tue, 6 Apr 2010 20:20:36 +0000 (20:20 +0000)]
2010-04-06 Dave Korn <dave.korn.cygwin@googlemail.com>
* libc/stdlib/__atexit.c (__atexit_lock): Initialise as recursive
rather than non-recursive lock type.
(__register_exitproc): Use recursive locking APIs on it.
* libc/stdlib/__call_atexit.c (__call_exitprocs): Likewise.
Jakub Jelinek [Mon, 5 Apr 2010 19:30:00 +0000 (19:30 +0000)]
include/
* dwarf2.h (DWARF2_Internal_LineInfo): Add li_max_ops_per_insn
field.
bfd/
* dwarf2.c (struct line_head): Add maximum_ops_per_insn field.
(struct line_info): Add op_index field, change end_sequence type to
unsigned char.
(new_line_sorts_after): For the same address compare op_index.
(add_line_info): Add op_index argument, store it into the structure.
(decode_line_info): Complain about unknown versions of .debug_line.
Initialize maximum_ops_per_insn. Add op_index state register and
track it.
binutils/
* dwarf.c (struct State_Machine_Registers): Add op_index field,
change end_sequence type to unsigned char.
(reset_state_machine): Clear op_index.
(process_extended_line_op): For DW_LNE_set_address clear op_index.
(display_debug_lines_raw): Initialize li_max_ops_per_insn.
Track op_index state machine register and print it if
li_max_ops_per_insn is != 1.
(display_debug_lines_decoded): Likewise.
* fhandler.h (fhandler_base::has_ongoing_io): Declare virtual method.
* select.cc (peek_pipe): Reorganize slightly. Don't attempt to check a handle
if it has ongoing I/O.
(select_pipe_info::select_pipe_info): Delete definition.
(select_pipe_info::~select_pipe_info): Delete definition.
(thread_pipe): Get rid of WFMO call. Reorganize loop.
(pipe_cleanup): Remove dependence on destructor.
(thread_serial): Reorganize loop.
* select.h (select_pipe_info): Empty this class since it no longer has any
special requirements (for now).
* syscalls.cc (readv): Remove an unneeded debug printf.
* dtable.cc (dtable::init_std_file_from_handle): Avoid adding fh to fdtab until
we know that it is good.
* fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Handle error
conditions more consistently. Avoid handle leakage on error.
* nlsfuncs.cc (rebase_locale_buf): New helper function to rebase
function pointers in locale structures. Explain why this is necessary.
(__set_lc_time_from_win): Use rebase_locale_buf after realloc.
(__set_lc_numeric_from_win): Ditto.
(__set_lc_monetary_from_win): Ditto.
Jeff Johnston [Thu, 1 Apr 2010 18:33:37 +0000 (18:33 +0000)]
2010-04-01 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/sched.h: Include prototypes for
sched_* methods.
* libc/include/sys/sched.h: Update to POSIX
1003.1b-2008. Rework constants to allow sharing
between RTEMS and Cygwin.
* sigproc.cc (wait_sig): Make sure that strace is activated on __SIGSTRACE by
calling new strace::activate function.
* strace.cc (strace::activate): Rename from strace::strace.
* strace.h (strace::activate): Define new function.
(strace::strace): Call activate.
* fhandler.h (fhandler_base_overlapped): Temporarily (?) make select_pipe_info
a friend until the fhandler_tty intertangling can be worked out.
* select.cc (select_pipe_info::add_watch_handle): Don't inspect the overlapped
event if we're not waiting for I/O.
(fhandler_tty_common::select_*): Change to standard function. Don't do kludgy
fhandler_pipe coercion.
Ralf Wildenhues [Wed, 31 Mar 2010 05:44:01 +0000 (05:44 +0000)]
Fix toplevel configure --enable-multilib handling.
/:
PR bootstrap/43328
* configure.ac: Do not pass --enable-multilib nor
--disable-multilib in baseargs. Accept explicitly passed
--enable_multilib.
* configure: Regenerate.
* fhandler.cc (fhandler_base::dup): Call setup_overlapped unconditionally.
(fhandler_base::fork_fixup): Ditto.
(fhandler_base::fixup_after_fork): Ditto.
(fhandler_base::fixup_after_exec): Ditto.
(fhandler_base_overlapped::setup_overlapped): Move to this class from
fhandler_base.
(handler_base_overlapped::destroy_overlapped): Ditto.
(fhandler_base_overlapped::wait_overlapped): Ditto. Track when we expect
pending I/O.
(fhandler_base_overlapped::read_overlapped): Move to this class from
fhandler_base. Return error if ongoing I/O.
(fhandler_base_overlapped::write_overlapped): Ditto.
(fhandler_base_overlapped::has_ongoing_io): Semi-reinstate previous function.
* fhandler.h (fhandler_base::wait_overlapped): Move to fhandler_base_overlapped
class.
(fhandler_base::write_overlapped): Ditto.
(fhandler_base::get_overlapped): Ditto.
(fhandler_base::get_overlapped_buffer): Ditto.
(fhandler_base_overlapped): New class.
(fhandler_pipe): Inherit from fhandler_base_overlapped. Remove overlapped
stuff as a result.
(fhandler_fifo): Ditto.
* pipe.cc (fhandler_pipe::fhandler_pipe): Initialize fhandler_base_overlapped.
(pipe): Put a descriptive name in the fhandler.
* globals.cc (exit_status): Add new ES_EXIT_STARTING enum.
* dcrt0.cc (cygwin_exit): Set exit_state to ES_EXIT_STARTING prior to calling
real exit.
* dll_init.cc (dll_list::detach): Remove dll from linked list and call
destructors even if exiting. Don't call __cxa_finalize in exiting case.
Corinna Vinschen [Sat, 27 Mar 2010 21:04:49 +0000 (21:04 +0000)]
* libc/locale/locale.c (loadlocale): Optimize "EUC" charset check.
Cygwin only: Allow GB2312 and EUC-CN as alternative codeset names
for GBK. Add to documentation.
* libc/locale/nl_langinfo.c (nl_langinfo): On Cygwin, translate EUCCN
to GB2312.
ld:
* Makefile.am (ALL_EMULATIONS): Add eelf32_tic6x_be.o and
eelf32_tic6x_le.o.
(eelf32_tic6x_be.c, eelf32_tic6x_le.c): New.
* NEWS: Add news entry for TI C6X support.
* configure.tgt (tic6x-*-*): New.
* emulparams/elf32_tic6x_be.sh, emulparams/elf32_tic6x_le.sh: New.
ld/testsuite:
* ld-elf/flags1.d, ld-elf/merge.d: XFAIL for tic6x-*-*.
* ld-elf/sec-to-seg.exp: Set B_test_same_seg to 0 for tic6x-*-*.
* ld-tic6x: New directory and testcases.
Corinna Vinschen [Tue, 23 Mar 2010 21:01:01 +0000 (21:01 +0000)]
* locale.cc (print_locale_with_codeset): Drop redundant name parameter.
Simplify creating locale string. Add "@" in case of a modifier.
(print_locale): Drop name parameter in calls to
print_locale_with_codeset.
Joseph Myers [Tue, 23 Mar 2010 14:30:59 +0000 (14:30 +0000)]
Merge from gcc:
2010-03-19 Jack Howarth <howarth@bromo.med.uc.edu>
PR ada/42554
* configure.ac: Only pass -c to ranlib for darwin9 and earlier.
* configure: Regenerate.
Corinna Vinschen [Mon, 22 Mar 2010 10:47:53 +0000 (10:47 +0000)]
* fhandler_socket.cc (fhandler_socket::evaluate_events): Make erase
const in parameter list.
(fhandler_socket::wait_for_events): Take a DWORD flags value instead of
just a bool. Call evaluate_events with erase flag according to
MSG_PEEK value in flags. Replace check for dontwait with check for
MSG_DONTWAIT in flags.
(fhandler_socket::connect): Call wait_for_events with 0 flags value.
(fhandler_socket::accept4): Ditto.
(fhandler_socket::recv_internal): Save flags in wait_flags. Drop
dontwait variable. Call wait_for_events with wait_flags.
(fhandler_socket::send_internal): Save MSG_DONTWAIT flag in wait_flags
and call wait_for_events with wait_flags as argument. Drop dontwait
variable.
* fhandler.h (class fhandler_socket): Change second parameter in
declaration of wait_for_events to const DWORD.
* shared_info.h (user_info): Add dll_crt0_1 as a friend.
(user_info::version): Make LONG to accommodate spinlock use.
(user_info::create): New static function renamed from user_info_create.
(user_info::initialize): New private function renamed from
user_info_initialize.
(SHARED_VERSION): Delete.
(SHARED_VERSION_MAGIC): Ditto.
(USER_VERSION_MAGIC): Ditto.
(SHARED_INFO_CB): Ditto.
(USER_VERSION): Ditto.
(USER_VERSION_MAGIC): Ditto.
(CURR_SHARED_MAGIC): Update.
(CURR_USER_MAGIC): Ditto.
(shared_info::version): Make LONG to accommodate spinlock use.
(shared_info::create): New static function mirroring user_info::create.
(dll_crt0_1): Accommodate change to user_info::initialize.
* spinlock.h (spinlock::setto): New variable member.
(spinlock::done): New function.
(spinlock::spinlock): Generalize to allow arbitrary values and timeouts. Call
done() when lock is not needed.
* ntdll.h: Make multiple-inclusion safe.
(NtQuerySystemTime): Declare.
* shared.cc (installation_root_inited): Rename from shared_mem_inited.
(init_installation_root): Make inline. Use a spinlock to ensure that this is
initialized only once per session.
(user_info::initialize): Rename from user_shared_initialize. Protect with
spinlock on sversion and remove other spinlock-like things. Remove reference
to user_shared since it is now implicit. Refer to spinlock version of
multiple_cygwin_problem to ensure that any spinlock is released.
(user_info::create): Rename from user_shared_create. Accommodate change from
user_shared_initialize to user_info::initialize.
(shared_info::create): New inline function.
(shared_info::initialize): Protect with spinlock on sversion. Move heap_init
back under specific control of shared_info spinlock. Remove reference to
SHARED_INFO_CB and just use sizeof(*this).
(memory_init): Move all locking into respective functions where it is needed.
Accommodate name changes. Remove call to heap_init().
* syscalls.cc (seteuid32): Accommodate name change to user_info::create().
* mount.cc (mount_info::create_root_entry): Report on errors from add_item
since they should be nonexistent.
(mount_info::init): Don't initialize nmounts. It should already be zero. Give
more verbose error when root_idx < 0. Implicitly use this pointer rather than
explicitly referencing mount_table->.
(mount_info::add_item): Minor whitespace fix.
* spinlock.h: New file.
(spinlock): New class.
* shared.cc: Include spinlock.h.
(memory_init): Use new spinlock methods rather than roll-your-own. Time out
after ten seconds if shared_mem_inited is not initialized.
* sync.h: Update copyright. Remove vanity attribution.
* sigproc.cc (sigproc_terminate): Avoid attempts to kill the signal thread
while we're still initializing or suffer a deadlock.
Throughout change all calls of low_priority_sleep (0) to yield ().
* miscfuncs.cc (yield): Rename from low_priority_sleep. Remove all of the
logic which called Sleep() and just use SwitchToThread.
* miscfuncs.h (yield): Rename from low_priority_sleep.
(SLEEP_0_STAY_LOW): Delete unused define.
* shared.cc (memory_init): Move heap_init() call directly after shared memory
initialization to more closely mimic long-standing program flow.
* tty.cc (tty_list::terminate): Replace call to low_priority_sleep with Sleep.
* shared_info.h (open_shared): Create function wrapper for common use case.
(open_shared): Change fifth argument to a pointer rather than a reference.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Eliminate use of dummy
variable and call open_shared with constant.
* fhandler_process.cc (format_process_mounts): Ditto.
* pinfo.cc (pinfo::init): Pass pointer to shloc.
* shared.cc (shared_mem_inited): New variable.
(open_shared): Crate function wrapper for common use case.
(open_shared): Accommodate change to fifth argument to a pointer.
(shared_info::initialize): Remove spinlock test. Simplify function. Move
get_session_parent_dir call back here.
(memory_init): Protect global shared settings with shared_mem_inited spinlock.
Move get_session_parent_dir call to shared_info::initialize.
* shared.cc (inst_root_inited): Delete.
* (shared_info::initialize): Reorganize. Move call to init_installation_root
here under spinlock control. Move unneeded non-shared_info initialization out
of this function.
(memory_init): Remove call to init_installation_root. Call heap_init and
get_session_parent_dir here.
* libm/common/s_rint.c: Fix error when integral part had 18 bits and
fraction had bits set beyond first radix bit. Also, make 2-part
adjustment consistent with 1-part adjustment when adjusting fractional
bits.
* libm/common/sf_rint.c: Make fractional-bit adjustment consistent
with s_rint.c by setting 0b.01 instead of 0b.001.
* setup2.sgml (setup-env): Add cross reference to using-cygwinenv.
Change description for locale environment variables to comply with
changes in 1.7.2.
* syscalls.cc (nt_path_has_executable_suffix): Change storage class of
blessed_executable_suffixes to static.
(rename): Revert meaning of old_explicit_suffix. Change the rules
for appending a .exe suffix and (yikes!) document them.
* cygwin.din: Export __xdr functions.
* include/cygwin/version.h: Bump version.
* posix.sgml: Add a few more XDR functions to list
of implemented Solaris functions.
* libc/include/sys/features.h: Add POSIX.1-permitted definition of
_POSIX_C_SOURCE if not already defined and _XOPEN_SOURCE has an
appropriate value. Specifically, check for POSIX.1-2008 & 2001 values.
* libc/include/sys/config.h: Add #include <sys/features.h> so that all
includes get the new check added to it.