aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-07-03Cygwin: console: Set console mode only if std{in,out,err} is consoleTakashi Yano2-15/+27
Currently, when cygwin app is launched, the console input mode is set to tty::cygwin, even if the stdin is not a console. However, it is not necessary because the cygwin app does not use stdin. This also applies to stdout and stderr. With this patch, the console mode is set only when std{in,out,err} is a console for the cygwin app for better coexistence with non- cygwin apps. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-07-03Cygwin: console: Call set_input_mode() after changing disable_master_threadTakashi Yano1-4/+9
With the commit 476135a24506, set_input_mode() reffers to the flag disable_master_thread in tty::cygwin mode. So it is necessary to call set_input_mode() after changing disable_master_thread flag. However, the commit 476135a24506 was missing that. With this patch, set_input_mode() is called after changing the flag disable_master_thread, if the console input mode is tty::cygwin. Fixes: 476135a24506 ("Cygwin: console: Set ENABLE_PROCESSED_INPUT when disable_master_thread"); Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-07-02wcstombs: also call __WCTOMB on terminating NUL if output buffer is NULLChristian Franke1-3/+4
A __WCTOMB call on the terminating NUL may emit more than a NUL byte. This is the case if the string ends with a lone UTF-16 high surrogate. Fixes: 2a3a02a68764 ("Add SUSV2 support for calculating size if output buffer is NULL") Signed-off-by: Christian Franke <christian.franke@t-online.de>
2025-07-02newlib: increase jump buffer length to 25 to fit all non-volatile registers ↵Radek Bartoň1-1/+10
for aarch64-pc-cygwin Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
2025-07-02cygwin: faq-programming-6.21 unmatched parenthesisJohn Haugabook1-1/+1
Fix typo - parenthesis without an opening parenthesis. Signed-off-by: John Haugabook <johnhaugabook@gmail.com>
2025-07-02cygwin: faq-programming-6.21 ready-made download commandsJohn Haugabook1-0/+12
Running setup-x86_64.exe and performing an individual search for each package, is a pain in the neck. And the user running "setup-x86_64.exe -q -P packageName" may have a typo and the package would not be installed. So by copying and pasting these commands into the terminal setup-x86_64.exe runs a preliminary search, so when they reach the "Select Packages" window these packages will be amongst the packages ready to be downloaded. Additionally sorting them makes it easier to go down the list, and make sure all packages are listed. Putting separate commands allows the user to pick which packages to download in the case they want to run config, where those packages are not needed i.e. --without-cross-bootstrap. Signed-off-by: John Haugabook <johnhaugabook@gmail.com>
2025-07-02cygwin: faq-programming-6.21 add 5 required packagesJohn Haugabook1-11/+13
Add 5 additional packages: for build: libtool; for dumper utility: libiconv, libiconv2; for documentation: perl-XML-SAX-Expat, docbook-utils. When building from a sandbox environment on Windows 11 using the packages currently listed in faq 6.21, I got the below error after calling "make": """"""""""""""" make[3]: Leaving directory '/home/WDAGUtilityAccount/build-newlib/x86_64-pc-cygwin/winsup/testsuite' Making all in doc make[3]: Entering directory '/home/WDAGUtilityAccount/build-newlib/x86_64-pc-cygwin/winsup/doc' GEN Makefile.dep GEN cygwin-ug-net/cygwin-ug-net.pdf GEN cygwin-api/cygwin-api.pdf GEN cygwin-api/cygwin-api.html etc... GEN cygwin-api.info could not find ParserDetails.ini in /usr/share/perl5/vendor_perl/5.40/XML/SAX warning : xmlAddEntity: invalid redeclaration of predefined entity 'lt' sh: line 1: /usr/bin/iconv: No such file or directory -: warning: document without nodes GEN cygwin-ug-net.info could not find ParserDetails.ini in /usr/share/perl5/vendor_perl/5.40/XML/SAX warning : xmlAddEntity: invalid redeclaration of predefined entity 'lt' docbook2texi://refentry[@id='proc']/refnamediv: section is too deep docbook2texi://refsect1[@id='proc-desc']: section is too deep etc... sh: line 1: /usr/bin/iconv: No such file or directory -: warning: document without nodes make[3]: *** [Makefile:721: cygwin-ug-net.info] Error 141 make[3]: Leaving directory '/home/WDAGUtilityAccount/build-newlib/x86_64-pc-cygwin/winsup/doc' make[2]: *** [Makefile:398: all-recursive] Error 1 make[2]: Leaving directory '/home/WDAGUtilityAccount/build-newlib/x86_64-pc-cygwin/winsup' make[1]: *** [Makefile:9464: all-target-winsup] Error 2 make[1]: Leaving directory '/home/WDAGUtilityAccount/build-newlib' make: *** [Makefile:883: all] Error 2 """"""""""""""" Added the packages: libtool, libiconv, libiconv2, perl-XML-SAX-Expat, and docbook-utils. Ran "make" again, and the error was resolved, and the install completed. In the case that someone is using a similar OS (Windows 10 and 11), architecture (x64-based PC), and/or verions of cygwin (3.6.3) for building cygwin from newlib-cygwin, this commit may prevent those errors from occuring. Additionally sorting the packages makes it easier to go down the list when selecting from the "Select Packages" GUI window from setup-x86_64.exe, making sure all packages have been checked. Signed-off-by: John Haugabook <johnhaugabook@gmail.com>
2025-07-02RISC-V: Fix memcpy() for GCC 13Sebastian Huber1-2/+2
GCC 13 does not define the __riscv_misaligned_* builtin defines. They are supported by GCC 14 or later. Test for __riscv_misaligned_fast to select an always correct memcpy() implementation for GCC 13. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2025-07-01Cygwin: Aarch64: optimize pthread_wrapper register usageThirumalai Nagalingam1-10/+11
This patch resolves issues related to unsafe access to deallocated stack memory in the pthread wrapper for AArch64. Key changes: - Removed use of x19 by directly loading the thread function and argument using LDP from [WRAPPER_ARG], freeing one register. - Stored thread function and argument in x20 and x21 before VirtualFree to preserve them across calls. - Used x1 as a temporary register to load the stack base, subtract CYGTLS, and update SP. - Moved the thread argument back into x0 after VirtualFree and before calling the thread function. Earlier, `wrapper_arg` lived on the stack, which was freed via `VirtualFree`, risking segfaults on later access. Now, the thread `func` and `arg` are loaded before the stack is freed, stored in callee-saved registers, and restored to `x0` before calling the thread function. Fixes: f4ba145056db ("Aarch64: Add inline assembly pthread wrapper") Signed-off-by: Thirumalai Nagalingam <thirumalai.nagalingam@multicorewareinc.com>
2025-07-01Cygwin: console: Set ENABLE_PROCESSED_INPUT when disable_master_threadTakashi Yano1-1/+1
Currently, ENABLE_PROCESSED_INPUT is set in set_input_mode() if master_thread_suspended is true. This enables Ctrl-C handling when cons_master_thread is suspended, since Ctrl-C is normally handled by cons_master_thread. However, when disable_master_thread is true, ENABLE_PROCESSED_INPUT is not set, even though this also disables Ctrl-C handling in cons_master_thread. Due to this bug, the command C:\cygwin64\bin\sleep 10 < NUL in the Command Prompt cannot be terminated with Ctrl-C. This patch addresses the issue by setting ENABLE_PROCESSED_INPUT when either disable_master_thread or master_thread_suspended is true. This bug also affects cases where non-Cygwin Git (Git for Windows) launches Cygwin SSH. In such cases, SSH also cannot be terminated with Ctrl-C. Addresses: https://github.com/git-for-windows/git/issues/5682#issuecomment-2995983695 Fixes: 746c8116dd4f ("Cygwin: console: Allow pasting very long text input.") Reported-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-06-30Cygwin: testsuite: test relative path to exe after addchdir.Jeremy Drake1-0/+8
This is apparently relative to the new cwd, but my implementation is currently treating it as relative to the parent's cwd, so it's worth testing. Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
2025-06-30Cygwin: testsuite: test passing directory fd to childJeremy Drake2-0/+23
This is a legal (if non-obvious) thing to do, so test it. Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
2025-06-30Cygwin: testsuite: test posix_spawn of a non-Cygwin executable.Jeremy Drake2-0/+171
Test CWD and redirection of standard handles. Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
2025-06-30Cygwin: testsuite: add a mingw test program to spawnJeremy Drake4-4/+139
This program is currently meant to test standard file handles and current working directory (since these are settable via posix_spawn), but could be extended to add additional checks if other cygwin-to-win32 process properties need to be tested. Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
2025-07-01Cygwin: pipe: Add missing code restoring real_non_blocking_modeTakashi Yano1-2/+8
Fixes: 940dbeffa713 ("Cygwin: pipe: Fix unexpected blocking mode change by pipe_data_available()") Reported by: Andrew Ng <anng.sw@gmail.com> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-07-01Cygwin: Add release message for recent pipe fixesTakashi Yano1-0/+6
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-07-01Cygwin: pipe: Simplify raw_write() a bit (Drop using chunk)Takashi Yano1-8/+2
There are tree variables for similar purpose in raw_write(), avail, chunk, and len1. avail is the amount of writable space in the pipe. len1 is the data length to attempt to NtWriteFile(). And chunk is intermediate value to calculate len1 from avail which holds min(avail, len). Here, chunk has no clear role among them. In fact, it appears to obscure the intent of the code for the reader. This patch removes the use of chunk and obtains len1 directly from avail. Reviewed-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-07-01Cygwin: pipe: Fix unexpected blocking mode change by pipe_data_available()Takashi Yano3-7/+9
ipipe_data_available() is called from raw_write(). If the pipe is in real_non_blocking_mode at that time, calling pipe_data_available() can, in some cases, inadvertently revert the pipe to blocking mode. Here is the background: pipe_data_available() checks the amount of writable space in the pipe by calling NtQueryInformationFile() with the FilePipeLocalInformation parameter. However, if the read side of the pipe is simultaneously consuming data with a large buffer, NtQueryInformationFile() may return 0 for WriteQuotaAvailable. As a workaround for this behavior, pipe_data_available() temporarily attempts to change the pipe-mode to blocking. If the pipe contains data, this operation fails-indicating that the pipe is full. If it succeeds, the pipe is considered empty. The problem arises from the assumption that the pipe is always in real blocking mode before attempting to flip the mode. However, if raw_write() has already set the pipe to non-blocking mode due to its failure to determine available space, two issues occur: 1) Changing to non-blocking mode in pipe_data_available() always succeeds, since the pipe is already in non-blocking mode. 2) After this, pipe_data_available() sets the pipe back to blocking mode, unintentionally overriding the non-blocking state required by raw_write(). This patch addresses the issue by having pipe_data_available() check the current real blocking mode, temporarily flip the pipe-mode and then restore the pipe-mode to its original state. Addresses: https://github.com/git-for-windows/git/issues/5682#issuecomment-2997428207 Fixes: 7ed9adb356df ("Cygwin: pipe: Switch pipe mode to blocking mode by default") Reported-by: Andrew Ng <andrew.ng@sony.com> Reviewed-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-07-01Cygwin: pipe: Make pipe_data_available() return PDA_UNKNOWNTakashi Yano3-12/+16
... rather than 1 when the pipe space estimation fails, so that select() and raw_wrie() can perform appropriate fallback handling. In select(), even if pipe space is unknown, return writable to avoid deadlock. Even with select() returns writable, write() can blocked anyway, if data is larger than pipe space. In raw_write(), if the pipe is real non-blocking mode, attempting to write larger data than pipe space is safe. Otherwise, return error. For other cases than FH_PIPEW, PDA_UNKNOWN never orrurs. Therefore, it is not necessary to handle it in that cases. Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-07-01Cygwin: pipe; Update source comment align with previous commitTakashi Yano2-31/+31
The commit "Cygwin: pipe: Fix SSH hang with non-cygwin pipe reader" modifies how the amount of writable data is evaluated. This patch updates the source comments to align with that change. Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-07-01Cygwin: pipe: Fix SSH hang with non-cygwin pipe readerTakashi Yano2-7/+13
If ssh is used with non-cygwin pipe reader, ssh some times hangs. This happens when non-cygwin git (Git for Windows) starts cygwin ssh. The background of the bug is as follows. Before attempting to NtWriteFile() in raw_write() in non-blocking mode, the amount of writable space in the pipe is checked by calling NtQueryInformationFile with FilePipeLocalInformation parameter. The same is also done by pipe_data_available() in select.cc. However, if the read side of the pipe is simultaneously consuming data, NtQueryInformationFile() returns less value than the amount of writable space, i.e. the amount of writable space minus the size of buffer to be read. This does not happen when the reader is a cygwin app because cygwin read() for the pipe attempts to read the amount of the data in the pipe at most. This means NtReadFile() never enters a pending state. However, if the reader is non-cygwin app, this cannot be expected. As a workaround for this problem, the code checking the pipe space temporarily attempts to toggle the pipe-mode. If the pipe contains data, this operation fails with STATUS_PIPE_BUSY indicating that the pipe is not empty. If it succeeds, the pipe is considered empty. The current code uses this technic only when NtQueryInformationFile() retuns zero. Therefore, if NtQueryInformationFile() returns 1, the amount of writable space is assumed to be 1 even in the case that e.g. the pipe size is 8192 bytes and reader is pending to read 8191 bytes. Even worse, the current code fails to write more than 1 byte to 1 byte pipe space due to the remnant of the past design. Then the reader waits for data with 8191 bytes buffer while the writer continues to fail to write to 1 byte space of the pipe. This is the cause of the deadlock. In practice, when using Git for Windows in combination with Cygwin SSH, it has been observed that a read of 8191 bytes is occasionally issued against a pipe with 8192 bytes of available space. With this patch, the blocking-mode-toggling-check is performed even if NtQueryInformationFile() returns non-zero value so that the amount of the writable space in the pipe is always estimated correctly. Addresses: https://github.com/git-for-windows/git/issues/5682 Fixes: 7ed9adb356df ("Cygwin: pipe: Switch pipe mode to blocking mode by default") Reported-by: Vincent-Liem (@github), Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-06-29wcrtomb: fix CESU-8 value of leftover lone high surrogateChristian Franke1-2/+2
Addresses: https://cygwin.com/pipermail/cygwin/2025-June/258378.html Fixes: 6ff28fc3b121 ("Allow CESU-8 surrogate value encoding") Signed-off-by: Christian Franke <christian.franke@t-online.de>
2025-06-27Cygwin: testsuite: include sys/stat.h for chmod in posix_spawn/errors.cJeremy Drake1-0/+1
This is required on Linux. Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
2025-06-27Cygwin: drop ASCII NUL from invalid DOS filename char transposition tableCorinna Vinschen1-3/+3
The mechanism to convert characters invalid in DOS/Windows filenames to the Unicode private use area starting at 0xf000 accidentally also converts ASCII NUL to the private use area. That usually doesn't happen, but what if the filename contains the 0xf000 character and we want to convert it back to multibyte? In this case the 0xf000 becomes the ASCII NUL again, and the resulting string is cut short and does not match with the real filename. This leads to all sorts of problems like the inability to unlink the file. Fix this problem by not marking ASCII NUL as transposable character. This problem has been introduced by adding code to support abstract sockets which may contain a NUL char as part of the socket name. By reverting the ASCII NUL in the transposition tables, transform_chars_af_unix has to handle ASCII NUL explicitely now. Reported-by: Christian Franke <Christian.Franke@t-online.de> Addresses: https://cygwin.com/pipermail/cygwin/2025-June/258367.html Fixes: 7d260cfac42d ("Cygwin: add transform_chars_af_unix helper") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-06-27Cygwin: add release message for mbrtowc bugfixCorinna Vinschen1-0/+3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-06-27mbrtowc: fix handling invalid UTF-8 4 byte sequences if wchar_t == UTF-16Corinna Vinschen1-9/+16
When commit 28186e81d947 split _mbtowc_r into per-codeset functions, the code generating wchar_t from UTF-8 input was slightly rearranged. Unfortunately the new code introduced a bug: On systems with wchar_t being UTF-16, 4 byte sequences have to be converted to surrogate pairs. The low surrogate pair can be fully created from the first 3 bytes of the sequence. However, the surrogates should only be created if it's clear that the 4th byte is valid, and the entire 4 byte string represents a valid UTF-8 sequence. The code change in 28186e81d947 neglected just that: In contrast to the original code, it now created the low surrogate after having read the first 3 bytes of the sequence, without checking validity of the 4th byte. This patch moves the test sequence to check the 4th byte in front of the code generating the low surrogate. Make sure to return the value 3 (3 bytes digested) rather than the content of the local variable i, which is already set to 4 at this point. Reported-by: Christian Franke <Christian.Franke@t-online.de> Addresses: https://cygwin.com/pipermail/cygwin/2025-June/258358.html Fixes: 28186e81d947 ("* libc/ctype/iswalpha.c: Handle all wchar_t as unicode on _MB_CAPABLE systems.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-06-26Cygwin: signal: Do not suspend myself and use VEHTakashi Yano4-18/+43
After the commit f305ca916ad2, some stress-ng tests fail in arm64 windows. There seems to be two causes for this issue. One is that calling SuspendThread(GetCurrentThread()) may suspend myself in the kernel. Branching to sigdelayed in the kernel code does not work as expected as the original _cygtls::interrup_now() intended. The other cause is, single step exception sometimes does not trigger exception::handle() for some reason. Therefore, register vectored exception handler (VEH) and use it for single step exception instead. Addresses: https://cygwin.com/pipermail/cygwin/2025-June/258332.html Fixes: f305ca916ad2 ("Cygwin: signal: Prevent unexpected crash on frequent SIGSEGV") Reported-by: Jeremy Drake <cygwin@jdrake.com> Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-06-25Cygwin: testsuite: test posix_file_actions_add(f)chdirJeremy Drake4-1/+153
Also test their interaction with addopen, as opens added subsequent to a chdir need to be relative to that new cwd. In order for the tests to compile on Linux, define O_SEARCH to O_PATH if O_SEARCH is not defined, and use the *chdir_np names instead of the now-standardized *chdir. Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
2025-06-25Cygwin: define ___CTOR_LIST__ and ___DTOR_LIST__ for AArch64Radek Bartoň1-1/+1
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
2025-06-25Cygwin: stack base initialization for AArch64Radek Bartoň1-1/+8
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
2025-06-24Cygwin: fix syntax error in cpu_relax.h for AArch64Radek Bartoň1-2/+2
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
2025-06-24Cygwin: add release note about `..` symlinksJohannes Schindelin1-0/+3
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2025-06-24Cygwin: fix visibility of symbols introduced with POSIX Issue 8Corinna Vinschen3-6/+6
This patch just follows the previous 5 patches changing newlib headers for the matching symbols in Cygwin headers. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-06-24libc: Update the guard for quick_exit() and at_quick_exit() functionsMazen Adel Elmessady1-1/+4
Updated the guard for stdlib functions to use the POSIX Issue 8 guard added in 2024.
2025-06-24libc: Added the prototype for ppoll()Mazen Adel Elmessady1-0/+9
Added prototype of ppoll() to newlib/libc/sys/rtems/include/sys/poll.h
2025-06-24libc: Added the prototype for sem_clockwait()Mazen Adel Elmessady1-0/+6
Added the prototype for sem_clockwait() to newlib/libc/sys/rtems/include/semaphore.h
2025-06-24libc/../pthread.h: Updated the guard for Posix Issue 8 functionsMazen Adel Elmessady1-6/+6
Updated the guard for pthread functions added in POSIX Issue 8 to use the POSIX Issue 8 guard added in 2024. These functions are: pthread_mutex_clocklock() pthread_cond_clockwait() pthread_rwlock_clockrdlock() pthread_rwlock_clockwrlock()
2025-06-24libc: Added timespec_get() to time.hMazen Adel Elmessady2-6/+5
Added timespec_get() prototype to libc/include/time.h and removed the prototype from winsup/cygwin/include/cygwin/time.h
2025-06-23Cygwin: testsuite: test posix_spawn_file_actions.Jeremy Drake2-0/+125
There are still more that could be tested, such as (f)chdir. Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
2025-06-23Cygwin: testsuite: test signal mask and ignore options.Jeremy Drake3-0/+93
Test both that SIG_IGN and sigprocmask are inherited by default, and that posix_spawnattr options can prevent this. Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
2025-06-23Cygwin: testsuite: test posix_spawnpJeremy Drake2-0/+26
Given the limited binaries available (sh, ls, sleep), use sh -c true Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
2025-06-23Cygwin: testsuite: add posix_spawn testsJeremy Drake3-0/+96
Currently just a couple of tests of error conditions, but I have more tests to add. Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
2025-06-23Cygwin: symlink_native: allow linking to `..`Johannes Schindelin1-5/+16
When running CYGWIN=winsymlinks:nativestrict ln -s .. abc the counter-intuitive result is _not_ a symbolic link to `..`, but instead to `../../$(basename "$PWD")`. The reason for this is that the search for the longest common prefix assumes that the link target is not a strict prefix of the parent directory of the link itself. Let's fix that. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2025-06-23Increase SYMLOOP_MAX limit to 63 per Win32 specSebastian Feld1-1/+7
Increase SYMLOOP_MAX limit to 63 per Win32 spec. The spec at https://learn.microsoft.com/en-us/windows/win32/fileio/reparse-points says: ... There is a limit of 63 reparse points on any given path. NOTE: The limit can be reduced depending on the length of the reparse point. For example, if your reparse point targets a fully qualified path, the limit becomes 31. */ Signed-off-by: Sebastian Feld <sebastian.n.feld@gmail.com>
2025-06-20Aarch64: Add inline assembly pthread wrapperThirumalai Nagalingam1-1/+17
This patch adds AArch64-specific inline assembly block for the pthread wrapper used to bootstrap new threads. It sets up the thread stack, adjusts for __CYGTLS_PADSIZE__, releases the original stack via VirtualFree, and invokes the target thread function. Signed-off-by: Thirumalai Nagalingam <thirumalai.nagalingam@multicorewareinc.com>
2025-06-19Cygwin: implement spinlock pause for AArch64Radek Bartoň3-2/+11
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
2025-06-19Cygwin: obtain stack base on AArch64Radek Bartoň2-1/+13
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
2025-06-19Cygwin: obtain stack pointer on AArch64Radek Bartoň2-1/+9
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
2025-06-18add value for _h_errno in _REENT_INIT(var) for struct, _reentJohannes Rosa1-1/+2
The define '_REENT_INIT' for the case '!_REENT_SMALL' was missing an initializing value for 'int _h_errno'. If code uses the _REENT_INIT() macro to preset a variable of type struct _reent, this led to an issue when compiling with -Wmissing-field-initializers.
2025-06-18Cygwin: make pthread initializer macros constinit compliantJeremy Drake4-8/+47
In order to avoid a restriction on any reinterpret_cast-like behavior in constinit expressions, use assembly and the linker to define symbols with the not-valid-address addresses. Due to being built with -mcmodel=small, this linker trick does not always work in the Cygwin DLL, specifically in the cases where they are used in comparisons (==). As a result, leave the case where the symbols would have had to have been classes rather than structs as casts of integers. If Cygwin ever needs these to be constinit compliant, it may need to move to the medium code model or add some other workaround. Signed-off-by: Jeremy Drake <cygwin@jdrake.com>