summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Cygwin: libpthread: Export C11 thread symbols from libpthread.a as wellCorinna Vinschen2020-09-011-1/+2
| | | | | | | ...as on glibc right now. This is supposed to support autoconf scripts checking for existence of these symbols in libpthread. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: mtx_init: drop glibc workaroundCorinna Vinschen2020-09-011-7/+0
| | | | | | | GLibc will change this code in the forseeable future to align more with FreeBSD, so this hack is not actually desired. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: pty: Fix a bug in the code removing set window title sequence.Takashi Yano via Cygwin-patches2020-08-311-8/+5
| | | | | | - Commit 4e08fe42c9f3fdba63a57a8e3a6d705c4e10f50f has a bug which may cause infinite loop in pty_master_fwd_thread(). This patch fixes the issue.
* Cygwin: pty: Disable pseudo console if TERM does not have CSI6n.Takashi Yano via Cygwin-patches2020-08-315-30/+229
| | | | | | | | | | | | | | | | | | | - Pseudo console internally sends escape sequence CSI6n (query cursor position) on startup of non-cygwin apps. If the terminal does not support CSI6n, CreateProcess() hangs waiting for response. To prevent hang, this patch disables pseudo console if the terminal does not have CSI6n. This is checked on the first execution of non-cygwin app using the following steps. 1) Check if the terminal support ANSI escape sequences by looking into terminfo database. If terminfo has cursor_home (ESC [H), the terminal is supposed to support ANSI escape sequences. 2) If the terminal supports ANSI escape sequneces, send CSI6n for a test and wait for a responce for 40ms. 3) If there is a responce within 40ms, CSI6n is supposed to be supported. Also set-title capability is checked, and removes escape sequence for setting window title if the terminal does not have the set- title capability.
* Cygwin: Remove waitloop argument from try_to_debug()Jon Turney2020-08-302-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when using CYGWIN's error_start facility, the faulting process isn't stopped while the error_start process is started when the fault is caused by an exception. (it even seems possible in theory that the faulting process could have exited before the error_start process attaches). This leads to e.g. the core dump written by CYGWIN='error_start=dumper' in response to an exception being non-deterministic. Remove the waitloop argument from try_to_debug(), only used in the exception case, so the faulting process busy-waits until the error_start process attaches. Code archaeology to determine why the code is this way didn't really turn up any answers, but this seems a low-risk change, as this only changes the behaviour when: - a debugger isn't already attached - an error_start is specified in CYGWIN env var - an exception has occurred which will be translated to a signal If error_start invokes something which doesn't attach using DebugActiveProcess(), we will spin indefinitely, but that will also currently occur for any of the existing other uses of try_to_debug(), which default to waitloop=TRUE.
* Cygwin: sigproc.cc: add commentKen Brown2020-08-301-1/+5
|
* Cygwin: Add modfl fix to release notesCorinna Vinschen2020-08-301-0/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: crt: Add "volatile" to all inline assembly snippets under mathMartin Storsjö2020-08-3011-15/+21
| | | | | | | | On 32 bit x86, clang seems to miss loading input parameters based on asm constraints for inline assembly that uses the x87 floating registers, unless the snippet has got the volatile keyword. Signed-off-by: Martin Storsjö <martin@martin.st>
* Cygwin: math/modfl.c: Fix segment faults in modfl().Liu Hao2020-08-301-2/+2
| | | | | Reference: https://sourceforge.net/p/mingw-w64/bugs/478/ Signed-off-by: Liu Hao <lh_mouse@126.com>
* Cygwin: Add Cygwin 3.2 release infoCorinna Vinschen2020-08-303-0/+74
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Add C11 threads APICorinna Vinschen2020-08-308-37/+627
| | | | | | | | | | | | | | Code taken from FreeBSD, which implements C11 threads as wrapper around pthreads. Fix up machine/_threads.h which is called from newlib's machine-independent threads.h to match Cygwin's pthreads types. Add the FreeBSD source files to libc subdir and take opportunity to define LIBC_OFILES var in Makefile. Add new symbols to common.din and sort symbols. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: make pthread_yield available for internal usageCorinna Vinschen2020-08-302-1/+2
| | | | | | | | In preparation of importing FreeBSDs stdthreads functions, change the way pthread_yield is exported, so that the symbol can be used internally as well. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: pthread_yield: Add BSD visibilityCorinna Vinschen2020-08-301-0/+2
| | | | | | | | pthread_yield was only declared under GNU visibility, but the function should be available under BSD visibility as well. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: pthreads: iterate over key destructors per POSIXCorinna Vinschen2020-08-303-7/+24
| | | | | | | | | | | | | POSIX requires that key destructors are called in a loop for each key with a non-NULL value until all values are NULL, or until all destructors for non-NULL values have been called at least PTHREAD_DESTRUCTOR_ITERATIONS (per POSIX: 4) times. Cygwinonly called all destructors with non-NULL values exactly once. This patch fixes Cygwin to follow POSIX. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Remove .drone.ymlJon Turney2020-08-281-58/+0
| | | | tea-ci.org was a CI service for MSYS2, but is no longer operating.
* Cygwin: Add github action to cross-build on FedoraJon Turney2020-08-281-0/+45
| | | | | This helps avoid unpleasant surprises when we come to actually make a release (which are cross-built in this manner)
* Cygwin: Add .appveyor.ymlJon Turney2020-08-281-0/+69
| | | | | | This is a slightly more polished version of the configuration being used for CI builds at https://ci.appveyor.com/project/cygwin/cygwin, which is not currently under version control.
* Cygwin: sigproc: Fix a thinko in array sizeCorinna Vinschen2020-08-281-3/+3
| | | | | | | | We need one more entry than max children in the arrays. There's no reason to do this for the static array, though. One more entry in the overflow array is sufficient. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: sigproc: Eliminate redundant copying of chld_procsCorinna Vinschen2020-08-281-1/+3
| | | | | | | | | | | | On PROC_EXEC_CLEANUP, the pinfo's in chld_procs are removed. This is done in a loop always removing the child with index 0. This, however, results in copying the last child's pinfo in chld_procs to position 0. Do this for 100 children and you get 99 entirely useless copy operations. Fix this by calling remove_proc in reverse order. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: sigproc: fix minor formatting issueCorinna Vinschen2020-08-281-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: select: Fix a bug on closing pi->bye event.Takashi Yano via Cygwin-patches2020-08-281-3/+3
| | | | | | - Close event handle pi->bye only if it was created. Addresses: https://cygwin.com/pipermail/cygwin-developers/2020-August/011948.html
* Cygwin: sigproc: Allow more child processes per processCorinna Vinschen2020-08-282-54/+93
| | | | | | | | | | | | | | | | | | | | | | | 256 children per process is a bit tight in some scenarios. Fix this by revamping the `procs' array. Convert it to an extensible class child_procs and rename procs to chld_procs. Fix code throughout to use matching class methods rather than direct access. To allow a lot more child processes while trying to avoid allocations at DLL startup, maintain two arrays within class child_procs, one using a default size for 255 (i686) or 1023 (x86_64) children, the other, dynamically allocated on overflowing the first array, giving room for another 1023 (i686) or 4095 (x86_64) processes. On testing with a simple reproducer on a x86_64 machine with 4 Gigs RAM, a system memory overflow occured after forking about 1450 child processes, so this simple dynamic should suffice for a while. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: drop PROC_DETACHED_CHILD flagCorinna Vinschen2020-08-285-18/+11
| | | | | | | | | | | | pinfo::remember with the detach parameter set to true is the only way to call proc_subproc with PROC_DETACHED_CHILD. This call is exclusively used in spawn to set up a pinfo for a detached child, and that pinfo goes out of scope right afterwards without any further action. Drop the flag and drop the detach parameter from pinfo::remember. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: sigproc: drop __stdcallCorinna Vinschen2020-08-282-14/+14
| | | | | | Nothing to gain here Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: sigproc: return int from remove_procCorinna Vinschen2020-08-281-3/+3
| | | | | | | The return value is used in a numerical context and remove_proc already returned inconsistently "true" vs. 0. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fix up proc_subproc flags and matching pinfo methodsCorinna Vinschen2020-08-285-14/+15
| | | | | | | | | | | | | | | | After patch 23a779bf3d7c2afc9eab88f6b8727c1db5544547 "Cygwin: pinfo: stop remember doing reattach", PROC_ADDCHILD actually just sets up a new child, mirroring PROC_DETACHED_CHILD. The actual attaching of the child is performed by action PROC_REATTACH_CHILD or pinfo::reattach respectively. To better reflect what's going on, rename PROC_REATTACH_CHILD to PROC_ATTACH_CHILD and rename pinfo::reattach to pinfo::attach. For better readability change PROC_ADDCHILD to PROC_ADD_CHILD. Fix comments accordingly. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fhandler_fifo::delete_client_handler: improve efficiencyKen Brown2020-08-271-3/+3
| | | | | Delete a client handler by swapping it with the last one in the list instead of calling memmove.
* winsup/doc/faq-api.xml(faq.api.timezone): explain time zone updatesBrian Inglis2020-08-271-5/+35
| | | | based on material from tz@IANA.org mailing list sources
* Cygwin: console: Replace WriteConsoleA() with WriteConsoleW().Takashi Yano via Cygwin-patches2020-08-271-42/+47
| | | | | | | - To allow sending non-ASCII chars to console, all WriteConsoleA() are replaced by WriteConsoleW(). Addresses: https://cygwin.com/pipermail/cygwin-patches/2020q3/010476.html
* doc: Also update shebang for chapter-texi2docbook.pyJon Turney2020-08-261-1/+1
|
* winsup/doc/faq-api.xml, -programming.xml: change Win32 to Windows/APIBrian Inglis2020-08-262-15/+15
|
* winsup/doc/faq-setup.xml, faq-using.xml: update setup FAQBrian Inglis2020-08-262-138/+118
| | | | | | | change all kinds of setup references to "the Cygwin Setup program"; emphasize 64 bit and deemphasize 32 bit; update options list; explain why installing everything is now extremely inadvisable, with stats
* Enabled _CS* defines for RTEMSEshan dhawan via Newlib2020-08-251-1/+2
| | | | Signed-off-by: Eshan dhawan <eshandhawan51@gmail.com>
* doc: Various fixes to makedocbook for python3.8Jon Turney2020-08-241-4/+6
| | | | | Also update shebang to explicitly use python3, since python2 is EOL and (per PEP 0394) 'python' may not exist at all.
* Cygwin: cwdstuff::get: clean up debug_printf outputKen Brown2020-08-231-0/+2
| | | | | | Set errno = 0 at the beginning so that the debug_printf call at the end doesn't report a nonzero errno left over from some other function call.
* Cygwin: pty: Implement new pseudo console support.Takashi Yano2020-08-2212-1719/+339
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - In this implementation, pseudo console is created for each native console app. Advantages and disadvantages of this implementation over the previous implementation are as follows. Advantages: 1) No performance degradation in pty output for cygwin process. https://cygwin.com/pipermail/cygwin/2020-February/243858.html 2) Free from the problem caused by difference of behaviour of control sequences between real terminal and pseudo console. https://cygwin.com/pipermail/cygwin/2019-December/243281.html https://cygwin.com/pipermail/cygwin/2020-February/243855.html 3) Free from the problem in cgdb and emacs gud. https://cygwin.com/pipermail/cygwin/2020-January/243601.html https://cygwin.com/pipermail/cygwin/2020-March/244146.html 4) Redrawing screen on executing native console apps is not necessary. 5) cygwin-console-helper is not necessary for the pseudo console support. 6) The codes for pseudo console support are much simpler than that of the previous one. Disadvantages: 1) The cygwin program which calls console API directly does not work. 2) The apps which use console API cannot be debugged with gdb. This is because pseudo console is not activated since gdb uses CreateProcess() rather than exec(). Even with this limitation, attaching gdb to native apps, in which pseudo console is already activated, works. 3) Typeahead key inputs are discarded while native console app is executed. Simirally, typeahead key inputs while cygwin app is executed are not inherited to native console app. 4) Code page cannot be changed by chcp.com. Acctually, chcp works itself and changes code page of its own pseudo console. However, since pseudo console is recreated for another process, it cannot inherit the code page. 5) system_printf() does not work after stderr is closed. (Same with cygwin 3.0.7) 6) Startup time of native console apps is about 3 times slower than previous implemenation. 7) Pseudo console cannot be activated if it is already activated for another process on same pty.
* Cygwin: bump version to 3.2.0Corinna Vinschen2020-08-221-2/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: strace: ignore GCC exceptionscygwin-3_1_7-releaseKen Brown2020-08-201-0/+8
| | | | | | | Any C++ app that calls 'throw' on 64-bit Cygwin results in an exception of type STATUS_GCC_THROW (0x20474343) generated by the C++ runtime. Don't pollute the strace output by printing information about this and other GCC exceptions.
* Cygwin: add header defining GCC exception codesKen Brown2020-08-202-9/+20
| | | | | Include it in exceptions.cc instead of defining the exception codes there.
* Cygwin: main exception handler (64-bit): continue GCC exceptionsKen Brown2020-08-182-0/+23
| | | | | | | | | | | | | | | | | This is necessary in order to be consistent with the following comment in the definition of _Unwind_RaiseException() in the GCC source file libgcc/unwind-seh.c: The exception handler installed in crt0 will continue any GCC exception that reaches there (and isn't marked non-continuable). Previously we failed to do this and, as a consequence, the C++ runtime didn't call std::terminate after an unhandled exception. This fixes the problem reported here: https://cygwin.com/pipermail/cygwin/2019-October/242795.html https://sourceware.org/pipermail/cygwin/2020-August/245897.html
* libm/stdlib: Realloc when shrinking by 2* or moreKeith Packard via Newlib2020-08-171-3/+3
| | | | | | This reduces memory usage when reallocating objects much smaller. Signed-off-by: Keith Packard <keithp@keithp.com>
* libm/stdlib: don't read past source in nano_reallocKeith Packard via Newlib2020-08-171-2/+4
| | | | | | | Save the computed block size and use it to avoid reading past the end of the source block. Signed-off-by: Keith Packard <keithp@keithp.com>
* Cygwin: pty: Change the timing of set_locale() call again.Takashi Yano via Cygwin-patches2020-08-172-4/+18
| | | | | | | | - After commit 095972ce5b1d319915501a7e381802914bed790c, charset conversion in mintty is broken if charset is set to other than UTF-8. This seems to be caused because mintty does not set locale yet at fork() call. This patch changes the timing of set_locale() call again to avoid this issue.
* Cygwin: pty: Change the timing of setup_locale() call.Takashi Yano via Cygwin-patches2020-08-131-4/+4
| | | | | | - If native app is exec()'ed in a new pty, setup_locale() loses the chance to be called. For example, with "mintty -e cmd", charset conversion does not work as expected. This patch fixes the issue.
* libc/stdlib: Fix build failure in nano_callocCraig Blackmore2020-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 588a5e1ddebdf6d74391c7409680ea20e050c0e1 added a non-reentrant call to nano_malloc which causes a build failure if INTERNAL_NEWLIB is defined. Here is a snippet of the error: In file included from .../newlib/newlib/libc/stdlib/nano-mallocr.c:38: .../newlib/newlib/libc/include/malloc.h:42:25: note: expected 'struct _reent *' but argument is of type 'ptrdiff_t' {aka 'int'} 42 | extern void *_malloc_r (struct _reent *, size_t); | ^~~~~~~~~~~~~~~ .../newlib/newlib/libc/stdlib/nano-mallocr.c:67:22: error: too few arguments to function '_malloc_r' 67 | #define nano_malloc _malloc_r | ^~~~~~~~~ .../newlib/newlib/libc/stdlib/nano-mallocr.c:456:11: note: in expansion of macro 'nano_malloc' 456 | mem = nano_malloc(bytes); | ^~~~~~~~~~~ In file included from .../newlib/newlib/libc/stdlib/nano-mallocr.c:38: .../newlib/newlib/libc/include/malloc.h:42:14: note: declared here 42 | extern void *_malloc_r (struct _reent *, size_t); | ^~~~~~~~~ .../newlib/newlib/libc/stdlib/nano-mallocr.c:43: warning: "assert" redefined 43 | #define assert(x) ((void)0) | This patch adds a missing RCALL to the args when calling nano_malloc from nano_calloc, so that if the call is reentrant, reent_ptr is passed as the first argument. The variable `bytes` (also added in 588a5e1d) has been changed from a `ptrdiff_t` to `malloc_size_t` as it does not need to be signed. It is used to store the product of two unsigned malloc_size_t variables and then iff there was no overflow is it passed to malloc and memset which both expect size_t which is unsigned. Signed-off-by: Craig Blackmore <craig.blackmore@embecosm.com>
* libc/stdlib: Use __builtin_mul_overflow for reallocarray and callocKeith Packard via Newlib2020-08-123-15/+22
| | | | | | | This built-in function (available in both gcc and clang) is more efficient and generates shorter code than open-coding the test. Signed-off-by: Keith Packard <keithp@keithp.com>
* libm/machine/riscv: Add custom fma/sqrt functions when supported [v2]Keith Packard via Newlib2020-08-127-5/+237
| | | | | | | Check for HW FMA and SQRT support and use those instructions in place of software implementations. Signed-off-by: Keith Packard <keithp@keithp.com>
* Cygwin: pty: Add a workaround for issue of starting a lot of mintty.Takashi Yano2020-08-111-4/+11
| | | | | | | | | - If a lot of mintty are started in a short time from a mintty, some of them hang with empty screen, crash immediately or hang on exiting mintty. The following report seems to be related to this issue. https://cygwin.com/pipermail/cygwin/2020-August/245751.html The cause is not clear at all, but this patch seems to solve the issue.
* libm/machine/arm: Add optimized fmaf and fma when availableKeith Packard via Newlib2020-08-106-5/+125
| | | | | | | | | | | When HAVE_FAST_FMAF is set, use the vfma.f32 instruction, when HAVE_FAST_FMA is set, use the vfma.f64 instruction. Usually the compiler built-ins will already have inlined these instructions, but provide these symbols for cases where that doesn't work instead of falling back to the (inaccurate) common code versions. Signed-off-by: Keith Packard <keithp@keithp.com>
* libm: Detect fast fmaf supportKeith Packard via Newlib2020-08-101-0/+8
| | | | | | | Anything with fast FMA is assumed to have fast FMAF, along with 32-bit arms that advertise 32-bit FP support and __ARM_FEATURE_FMA Signed-off-by: Keith Packard <keithp@keithp.com>