aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-11-28Cygwin: Update some mentions of x86 in documentationJon Turney2-2/+2
2022-11-28Cygwin: Fix typo in FAQJon Turney1-1/+1
The consonant in 'debug' is doubled in 'debuggee' just as it is in 'debugger'. Fixes: 8c68a8a4
2022-11-25Cygwin: pty: Rename fhandler/tty.cc to fhandler/pty.cc.Takashi Yano2-1/+1
- Previously, we have two tty.cc, one is winsup/cygwin/tty.cc and the other is winsup/cygwin/fhandler/tty.cc. This is somewhat confusing. This patch renames fhandler/tty.cc to fhandler/pty.cc.
2022-11-24Cygwin: uname: allow to specify external release infoCorinna Vinschen1-1/+5
When creating regular Cygwin test releases we need a way to automate unambiguous version information based on the output of `git describe'. Allow to inject a release string via a preprocessor macro CYGPORT__RELEASE_INFO. Change the default release info to recognize a local, non-distro build. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-11-24Cygwin: drop snapshot handlingCorinna Vinschen2-29/+2
We're going to switch to regular test releases, rather than the old, handcrafted snapshots method. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-11-22amdgcn: Use __builtin_gcn_ in libc/machine/amdgcn/getreent.cTobias Burnus1-9/+29
Call __builtin_gcn_get_stack_limit and __builtin_gcn_first_call_this_thread_p to reduce dependency on some register/layout assumptions by using the new GCC mainline (GCC 13) builtins, if they are available. If not, the existing code is used.
2022-11-21amdgcn: Replace asm("s8") by __builtin_gcn_kernarg_ptr if existingTobias Burnus3-3/+17
Check whether __builtin_gcn_kernarg_ptr is available and, if it is, call it instead using the hard-coded 'asm("s8")' in: * newlib/libc/machine/amdgcn/exit-value.h (exit_with_int) * newlib/libc/machine/amdgcn/mlock.c (sbrk) * newlib/libc/sys/amdgcn/write.c (write) newlib/libc/machine/amdgcn/exit-value.h | 6 ++++++ newlib/libc/machine/amdgcn/mlock.c | 10 +++++++--- newlib/libc/sys/amdgcn/write.c | 4 ++++ 3 files changed, 17 insertions(+), 3 deletions(-)
2022-11-20Cygwin: pty, console: Encapsulate spawn.cc code related to pty/console.Takashi Yano4-121/+149
- The codes related to pty and console in spawn.cc have been moved into the new class fhandler_termios::spawn_worker, and make spawn.cc call them. The functionality has not been changed at all.
2022-11-12makedocbook: Fix false report of unhandled texinfo commandJon Turney1-7/+8
During 'make man', makedocbook falsely reports "texinfo command '@modifier' remains in output" while processing the setlocal(3) manpage, which contains that literal string. Move the check for unrecognized texinfo commands to before processing '@@' (an escaped '@') in the texinfo source, and teach it to ignore them. Improve that check slightly, so it catches non-alphabetic texinfo commands, of which there are few. Now we don't have false positives, we can make unrecognized texinfo commands fatal to manpage generation, rather than leaving them verbatim in the generated manpage.
2022-11-12makedocbook: Adjust inline whitespace to fix flake8 warningsJon Turney2-69/+68
2022-11-12makedocbook: Drop stray semicolonsJon Turney1-2/+2
This isn't written in C :)
2022-11-12makedocbook: Use sys.exit()Jon Turney1-10/+6
Use sys.exit() to write a message to stderr and terminate with a non-zero exit code.
2022-11-12makedocbook: Use raw strings for regexesJon Turney1-11/+11
Use raw strings for regexes. This is best practice, and fixes a number of "W605 invalid escape sequence" flakes.
2022-11-11Cygwin: document bugfix for USB CDC devicesCorinna Vinschen1-0/+3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-11-11Cygwin: fix TIOCMBIS/TIOCMBIC not working when using usbser.sysCarlo Bramini1-39/+28
In winsup/cygwin/fhandler/serial.cc, the function fhandler_serial::switch_modem_lines() is called when TIOCMBIS/TIOCMBIC are used in an ioctl() call. This function uses EscapeCommFunction() for setting and resetting RTS and DTR signals of a serial port. Unfortunately, this function does not work on USB CDC devices. This is not a true bug of CYGWIN but an issue of the usbser.sys driver, from Windows 2000 to the latest Windows 11. Both 32bit and 64bit versions of the operating system are affected. Actually, I tested EscapeCommFunction() also when using a real UART, based on the traditional 16550 driver and it works fine. Using thirdy party CDC drivers, like the one provided by FTDI for their USB bridge chips, probably also works. However, it is also possible to drive the RTS/DTR signals by writing their state with SetCommState(), which proved to be working fine all types of connection. This is also a better solution for handling these signals since RTS/DTR can be set at the same time rather than having two separate calls with a visible delay between them.
2022-11-10powerpc/setjmp: Fix 64-bit buffer alignmentSebastian Huber1-0/+16
The rlwinm is a word-size instruction which clears the remaining 32 bits of a 64-bit register. Use clrrdi in 64-bit configurations.
2022-11-10Cygwin: Correct /proc/*/stat for processes without cttyAndy Koppe1-3/+5
Report 0 instead of 268435455 (i.e. 0xFFFFFFF) in the tty field of /proc/*/stat for processes without a controlling terminal. This is what the procps utility expects when selecting or excluding such processes.
2022-11-08Generally make all 'long double complex' methods available in <complex.h>Thomas Schwinge1-19/+16
..., not just '#if defined(__CYGWIN__)'. (Exception: 'clog10l' which currently indeed is for Cygwin only.) This completes 2017-07-05 commit be3ca3947402827aa52709e677369bc7ad30aa1d "Fixed warnings for some long double complex methods" after Aditya Upadhyay's work on importing "Long double complex methods" from NetBSD. For example, this changes GCC/nvptx libgfortran 'configure' output as follows: [...] checking for ccosf... yes checking for ccos... yes checking for ccosl... [-no-]{+yes+} [...] ..., and correspondingly GCC/nvptx 'nvptx-none/libgfortran/config.h' as follows: [...] /* Define to 1 if you have the `ccosl' function. */ -/* #undef HAVE_CCOSL */ +#define HAVE_CCOSL 1 [...] Similarly for 'ccoshl', 'cexpl', 'cpowl', 'csinl', 'csinhl', 'ctanl', 'ctanhl', 'cacoshl', 'cacosl', 'casinhl', 'catanhl'. ('conjl', 'cprojl' are not currently being used in libgfortran.) This in turn simplifies GCC/nvptx 'libgfortran/intrinsics/c99_functions.c' compilation such that this files doesn't have to provide its own "Implementation of various C99 functions" for those, when in fact they're available in newlib libm.
2022-11-04Cygwin: Improve FAQ on early breakpoint for ASLRJon Turney1-0/+6
gdb supports the 'disable-randomization' setting on Windows since [1] (included in gdb 13). https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=bcb9251f029da8dcf360a4f5acfa3b4211c87bb0;hp=8fea1a81c7d9279a6f91e49ebacfb61e0f8ce008
2022-11-04Cygwin: Handle out of order modules for module offsets in stackdumpJon Turney1-1/+3
Improve address to module+offset conversion, to work correctly in the presence of out-of-order elements in InMemoryOrderModuleList. Fixes: d59651d4
2022-10-29strftime/wcsftime: use STRLEN, not strlenCorinna Vinschen1-1/+1
Commit 737e2004a3bb accidentally introduced a call to strlen in code used with wide character strings in case of wcsftime. Use STRLEN instead. Fixes: 737e2004a3bb ("strftime.c(__strftime): add %q, %v, tests; tweak %Z doc") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-29makedocbook: Add explicit locking for PLY parser table generationJon Turney3-229/+227
Drop 'makedocbook --cache' (any dependency on the man-cache rule which invokes that was dropped by the non-recursive make changes) Instead, add some explicit locking which prevents processes colliding over the file containing generated python code for the parser table.
2022-10-29Cygwin: Add loaded module base address list to stackdumpJon Turney1-0/+10
This adds an extra section to the stackdump, which lists the loaded modules and their base address. This is perhaps useful as it makes it immediately clear if RandomCrashInjectedDll.dll is loaded... Future work: It seems like the 'InMemoryOrder' part of 'InMemoryOrderModuleList' is a lie? > Loaded modules > 000100400000 segv-test.exe > 7FFF2AC30000 ntdll.dll > 7FFF29050000 KERNEL32.DLL > 7FFF28800000 KERNELBASE.dll > 000180040000 cygwin1.dll > 7FFF28FA0000 advapi32.dll > 7FFF29F20000 msvcrt.dll > 7FFF299E0000 sechost.dll > 7FFF29B30000 RPCRT4.dll > 7FFF27C10000 CRYPTBASE.DLL > 7FFF28770000 bcryptPrimitives.dll
2022-10-28Cygwin: Add addresses as module offsets in .stackdump fileJon Turney1-1/+29
This adds an additional column to the stack trace in a .stackdump file, which gives the stack frame return address as a module name+offset. This makes it a possible to convert the address to a function name without having to guess what module the address belongs to. > Stack trace: > Frame Function Args > 0007FFFFCC30 0001004010E9 (000180048055, 000180046FA0, 000000000002, 00018031E160) segv-test.exe+0x10E9 > 0007FFFFCD30 0001800480C1 (000000000000, 000000000000, 000000000000, 000000000000) cygwin1.dll+0x80C1 > 0007FFFFFFF0 000180045C86 (000000000000, 000000000000, 000000000000, 000000000000) cygwin1.dll+0x5C86 > 0007FFFFFFF0 000180045D34 (000000000000, 000000000000, 000000000000, 000000000000) cygwin1.dll+0x5D34 > End of stack trace Loosely based on this patch [1] by Brian Dessent. [1] https://cygwin.com/pipermail/cygwin-patches/2008q1/006306.html
2022-10-28Cygwin: Tidy up formatting of stackdumpJon Turney1-3/+3
Resize stackdump headers for b9e97f58 Consistently use \r\n line endings
2022-10-28Cygwin: cygheap: make bucket_val a static const arrayCorinna Vinschen2-15/+16
Every time the cygheap is initialized, that is, on each fork or exec, cygheap_init() *again* computes the bucket size values and stores them in the cgyheap, albeit they are always the same values anyway. Make bucket_val a local const array, statically initialized instead. Fixes: 61522196c715 ("* Merge in cygwin-64bit-branch.)" Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Cygwin: document ASLR supporttopic/aslr_supportCorinna Vinschen2-0/+6
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Cygwin: Enable dynamicbase on the Cygwin DLL by defaultCorinna Vinschen1-1/+2
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Cygwin: /proc/<PID>/maps: output cygheap infoCorinna Vinschen1-0/+2
Now that the cygheap isn't part of the CYgwin DLL anymore, we have a known memory location which is not known in maps output. Fix that by checking for cygheap address (same in all processes) and add to output. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Cygwin: drop objcopy .gnu_debuglink juggleCorinna Vinschen2-33/+5
Prior to 591fec858d01 ("Cygwin: decouple cygheap from Cygwin DLL") the .cygheap section was required to stay the last section in the final binary. That required some juggling with objcopy to make sure the .gnu_debuglink section is prior to the .cygheap section in the final DLL. This isn't required anymore, so just drop it. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Cygwin: memory_layout.h: define absolute MMAP_STORAGE_HIGH values hereCorinna Vinschen2-17/+22
Use the symbolic values in wincap.cc. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Cygwin: memory_layout.h: fix commentsCorinna Vinschen1-19/+3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Cygwin: decouple shared mem regions from Cygwin DLLCorinna Vinschen2-47/+18
Another reason ASLR may fail is the coupling of the standard shared mem regions (global, userinfo, process info, shared console) to the address of the Cygwin DLL. They are always placed in fixed addresses preceeding the Cygwin DLL's address. With ASLR this is bound to fail. Use a fixed, unused memory area to place the shared mem regions. This also allows to simplify the shared memory creation. There's no reason anymore to rebase the regions and rather than offsets, just use the addresses directly. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Cygwin: decouple cygheap from Cygwin DLLCorinna Vinschen5-45/+50
One reason that ASLR is tricky is the fact that the cygheap is placed at the end of the DLL and especially that it's expected to be growable. To support ASLR, this construct must go. Define dedicated cygheap memory region and reserve entire region. Commit 3 Megs, as was the default size of the cygheap before. Fix linker script accordingly, drop a now useless version check in get_cygwin_startup_info().
2022-10-28Cygwin: add memory_layout.hCorinna Vinschen4-25/+62
Collect all info about memory layout in one header file, so the mem layout is documented in one logical place and not in heap.cc arbitrarily. Use info from this file throughout. This is to prepare for ASLR support. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Cygwin: exceptions: print 48 bit addressesCorinna Vinschen1-4/+4
Exception handling was *still* printing addresses as 44 bit values, but Windows supports a 48 bit virtual address space since Windows 8.1. Fix that. Fixes: e1254add73b1 ("Cygwin: Allow accessing 48 bit address space in Windows 8.1 or later") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Cygwin: add missing .com entry in new-features.xmlCorinna Vinschen1-0/+5
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28powerpc/setjmp: Fix 64-bit supportSebastian Huber1-57/+72
The first attempt to support the 64-bit mode had two bugs: 1. The saved general-purpose register 31 value was overwritten with the saved link register value. 2. The link register was saved and restored using 32-bit instructions. Use 64-bit store/load instructions to save/restore the link register. Make sure that the general-purpose register 31 and the link register storage areas do not overlap.
2022-10-28Cygwin: stop handling files with .com suffix like .exe filesCorinna Vinschen5-7/+4
.com is a remnant from the past. There are only five executables left: chcp.com format.com mode.com more.com tree.com Calling them on the command line already requires to use the suffix anyway. So drop useless .com test from the execve test for scripts (they are handled earlier in the same function as executables) and do not handle them like .exe suffixes in other functions. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Revert "Cygwin: pty: Fix 'Bad address' error when running 'cmd.exe /c dir'"Corinna Vinschen1-2/+0
This reverts commit 7589034cc3151bfac8cc3d3af5e91402a78e160b. The previous commit 14816de9af69 ("Cygwin: spawn: drop special handling for cmd.exe and command.com") make this patch unnecessary. The filename argument (i. e., run_path in the caller) is now always non-NULL. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Cygwin: spawn: drop special handling for cmd.exe and command.comCorinna Vinschen1-69/+43
Apparently at one point handling cmd.exe and command.com special made sense, but what that should be has never been documented. There's also no clear reason why cmd.exe is different from any other native executable. Additionaly, checking for command.com is entirely useless on 64 bit Windows anyway. Just drop this code. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Fix warning during manpage generatonJon Turney1-2/+12
> ERROR: xref linking to Stubs has no generated link text. > Error: no ID for constraint linkend: Stubs. (Despite saying "ERROR", this is actually a warning, and manpages are still generated) Improve chapter-texi2docbook so it generates elements for texinfo sections as well, so that a cross-reference to the "Stubs" section contains a valid element ID.
2022-10-28Cygwin: utils: drop 32 bit considerationsCorinna Vinschen5-41/+8
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-28Cygwin: regtool: drop 32 bit hint from help outputCorinna Vinschen1-2/+2
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-27Cygwin: document dropping 32 bit supportCorinna Vinschen2-0/+6
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-10-27Fix typo in faq-programming.xmlHamish McIntyre-Bhatty1-1/+1
2022-10-25strftime.c(__strftime): add %q, %v, tests; tweak %Z docBrian Inglis1-3/+55
%q GNU quarter year 1-4 %v BSD/OSX/Ruby VMS/Oracle %e-%b-%Y %Z change time zone *name* to *abbreviation*
2022-10-24strptime.cc(__strptime): add %q GNU quarterBrian Inglis1-1/+9
2022-10-24strptime.c(strptime_l): add %q GNU quarterBrian Inglis1-1/+9
2022-10-22Cygwin: pty: Fix 'Bad address' error when running 'cmd.exe /c dir'Takashi Yano1-0/+2
- If the command executed is 'cmd.exe /c [...]', runpath in spawn.cc will be NULL. In this case, is_console_app(runpath) check causes access violation. This case also the command executed is obviously console app., therefore, treat it as console app to fix this issue. Addresses: https://github.com/msys2/msys2-runtime/issues/108