Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Christian Franke <christian.franke@t-online.de>
|
|
This patch adds configure options allowing to disable build of cygserver
and Cygwin utilities. This is useful when one needs to build only
cygwin1.dll and crt0.o with stage1 compiler that is not yet capable of
linking executables as it is missing cygwin1.dll and crt0.o.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
This patch introduces dummy implementation of fegetprec and fsetprec for Cygwin
build as those symbols are being exported by cygwin1.dll and AArch64 do not support
changing floating point precision at runtime.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
Systems prior to W10 1803 don't have the leapsecs registry key
HKLM\SYSTEM\CurrentControlSet\Control\LeapSecondInformation and
don't handle leap seconds at all.
Given that new leap seconds are a rather seldom, irregular event,
drop reading from /usr/share/zoneinfo/leapseconds. Just read the
same leap second records from a file /etc/leapsecs as stored in
the LeapSeconds registry value on newer systems instead.
As a sidenote, the code reading from /usr/share/zoneinfo/leapseconds
was wrong anyway, because it didn't take the timestamps into account.
Given IERS publishes new leap seconds about 6 months before they
occur, CLOCK_TAI would have been one second off for up to 6 months.
/etc/leapsecs doesn't exist yet, so we just default to 37 secs. If
new leap seconds get provided for newer systems, make sure to provide
the /etc/leapsecs file as part of the Cygwin distro with identical
entries.
Fixes: 2abb929f0ad2 ("Cygwin: clocks: Implement CLOCK_TAI")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
Long-standing bug in the sys/termios.h file which, for some reason,
has never been encountered before.
STC:
#include <sys/termios.h>
int main()
{
struct winsize win;
tcgetwinsize (0, &win);
}
Result with gcc 12.4.0:
termios-bug.c: In function ‘main’:
termios-bug.c:7:20: warning: passing argument 2 of ‘tcgetwinsize’ from incompatible pointer type [-Wincompatible-pointer-types]
7 | tcgetwinsize (0, &win);
| ^~~~
| |
| struct winsize *
In file included from termios-bug.c:1:
/usr/include/sys/termios.h:304:42: note: expected ‘struct winsize *’ but argument is of type ‘struct winsize *’
304 | int tcgetwinsize(int fd, struct winsize *winsz);
| ~~~~~~~~~~~~~~~~^~~~~
This warning apparently becomes an error with C23.
The reason is that struct winsize is defined in sys/termios.h after
using it as argument type in function declarations. From the compil;er
perspective it's now a different type , regardless of having the same
name.
Move declaration of struct winsize up so it's defined before being used.
Reported-by: Zachary Santer <zsanter@gmail.com>
Suggested-by: Zachary Santer <zsanter@gmail.com>
Addresses: https://cygwin.com/pipermail/cygwin/2025-July/258474.html
Fixes: 1fd5e000ace55 ("import winsup-2000-02-17 snapshot")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
The commit cited below introduced changes which included
conditionals strictly on __mips__. This ignored tailoring
for any environment on MIPS except that targeted by the
author of the change. This patch just fixes this code for
RTEMS.
commit 467a2bdf17ad376dafada9f1734784f4611fa6fd
Author: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
Date: Wed Jun 11 10:11:33 2025 +0200
mips: Implement MIPS HAL and UHI
Implement abstract interface for MIPS, including unified hosting
interface (UHI).
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
This commit changes the return type of the read() and write() syscalls for
nvptx to ssize_t. This would allow large files to be handled properly by
these syscalls in situations where the read/write buffer length exceeds
INT_MAX, for example. This also makes the syscall signatures fully complaint
with their current POSIX specifications.
We additionally define two macros: '_READ_WRITE_RETURN_TYPE' as _ssize_t and
'_READ_WRITE_BUFSIZE_TYPE' as __size_t in libc/include/sys/config.h under
__nvptx__ for consistency.
Signed-off-by: Arijit Kumar Das <arijitkdgit.official@gmail.com>
|
|
Windows 10 1803 introduced leap seconds support in 2018. The OS always
starts at 37 leap secs. Additional leap second timestamps are added to
the registry key HKLM\SYSTEM\CurrentControlSet\Control\LeapSecondInformation,
value LeapSeconds.
If the key exists, read the leap second timestamps from this value,
otherwise fallback to reading /usr/share/zoneinfo/leapseconds.
Note that we might change the file we read from yet, but that's no part
of this patch.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
This patch is required for a followup patch fetching the leap seconds
info from the registry starting with Windows 10 1803.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
This patch ports `winsup/utils/mingw/cygcheck.cc` to AArch64:
- Adds arch=aarch64 to packages API URL.
- Ports dll_info function.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
This patch synchronizes newlib/libc/machine/aarch64/asmdefs.h header with
version from https://github.com/ARM-software/optimized-routines/commit/4352245388a55a836f3ac9ac5907022c24ab8e4c
commit that added support for AArch64 Cygwin.
This version of the header removed PTR_ARG and SIZE_ARG macros as ILP32 was
deprecated which introduced changes in many .S files so the patch contains
removal of usages of those macros.
On top of that, setjmp.S and rawmemchr.S were refactored to use
ENTRY/ENTRY_ALIGN and END macros. `
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
This is a mingw program meant to demonstrate loading the Cygwin dll in a
non-Cygwin process, but the Cygwin dll still initializes the cygheap on
load in that case. Without --disable-high-entropy-va, Windows may
occasionally locate the PEB, TEB, and/or stacks in the address space
that Cygwin tries to reserve for the cygheap, resulting in a failure.
Fixes: 60675f1a7eb2 ("Cygwin: decouple shared mem regions from Cygwin DLL")
Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
|
|
CLOCK_TAI is like CLOCK_REALTIME ignoring leap secs. Right now,
2025, it has a positive 37 secs offset from CLOCK_REALTIME.
Given the unpredictability of adding leap secs by the IERS
(International Earth Rotation and Reference Systems Service),
we also add a mechanism to read the current leap secs offset from
/usr/share/zoneinfo/leapseconds, part of the tzdata package.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
With the commit 656df313e08a, if a thread acquires sfp lock after
another thread calls fclose() and fp lock is acquired, the first
thread falls into deadlock if it tries to acquire fp lock. This can
happen if the first thread calls __sfp_lock_all() while the second
thread calls fclose().
This patch reverts the changes for newlib/libc/stdio/fclose.c in
the commit 656df313e08a.
Addresses: https://cygwin.com/pipermail/cygwin/2025-June/258323.html
Fixes: 656df313e08a ("* libc/stdio/fclose.c: Only use sfp lock to guard non-atomic changes of flags and fp lock.")
Reported-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
|
|
Deploy (what is now a full set of) documentation files from install
directory.
|
|
For _GNU_VISIBLE, provide the CLOCK_TAI clock identifier for the
International Atomic Time. Use the value specified by glibc and Linux.
Add _BSD_VISIBLE given FreeBSD also provides this clock identifier.
|
|
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
Add CLOCK_REALTIME_COARSE and CLOCK_REALTIME_ALARM to the clocks
allowing an absolute timeout value to be used as such in NtSetTimer.
Fixes: c05df02725c59 ("Cygwin: implement extensible clock interface")
Fixes: 013e2bd9ecf85 ("Cygwin: posix timers: Add support for CLOCK_REALTIME_ALARM/CLOCK_BOOTTIME_ALARM")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
The clock init functions checked timer ticks/period for 0 and then
called InterlockedExchange64 if the value was still 0. This is not
quite as atomic as it was supposed to be.
Use InterlockedCompareExchange64 instead.
Fixes: 2b72887ac834b ("Cygwin: clocks: fix a hang on pre-Windows 10 machines")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
This gives us a full set of the built documentation files in the install
directory, which can then be appropriately filtered for packaging or
deploying to website, as required.
Again, there will be a separate change to the cygwin packaging to avoid
including theses files in the cygwin-doc package.
Also, add matching uninstall rules.
|
|
We don't currrently deploy the CSS file to the website, because the FAQ
doesn't get installed, so instead we copy all the doc files from the
build directory.
That omits docbook.css, which is installed from directly from the source
directory. (We just happen to have a similar file lying around on the
webserver).
Instead, just install the FAQ.
There will be a separate change to the cygwin packaging to avoid
including the FAQ in the cygwin-doc package. (I guess we'd rather people
go online for that, to ensure they have the latest version?)
Also, add matching uninstall rules.
|
|
This patch aspires to provide only minimal changes to
`winsup/cygwin/scripts/gendef` allowing to pass the AArch64 build. It does not
provide any implementations of the generated routines.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
Raw devices of partitions may be accessible from unprivileged
processes, for example if connected via USB.
Signed-off-by: Christian Franke <christian.franke@t-online.de>
|
|
This patch extracts macros from winsup/cygwin/exceptions.cc serving for portable
register access to context structures into a separate local header
winsup/cygwin/local_includes/register.h and implements their AArch64
counterparts.
Then, it adds AArch64 declaration of __mcontext structure based on
mingw-w64-headers/include/winnt.h header to
winsup/cygwin/include/cygwin/singal.h header.
Then, it includes the registers.h header and uses the macros where applicable,
namely at:
- winsup/cygwin/exceptions.cc
- winsup/cygwin/profil.c
- winsup/cygwin/tread.cc
The motivation is to make usage of the context structures portable without
unnecessary #if defined(__x86_64__) while implementations of signal handling
code will be developed later, e.g. implementation of makecontext.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
Implements import_address function by decoding adr AArch64 instructions to get target address.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
_fe_nomask_env is exported by cygwin.din but not used at all for AArch64.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
This patch allows to build winsup/utils/dumper.cc for AArch64 by handling target
architecture condition in dumper::init_core_dump.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
This patch allows to build winsup/utils/profiler.cc for AArch64 by handling
target architecture condition in find_text_section function implementation.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
This patch ports winsup/cygwin/scripts/mkimport script to AArch64, namely
implements relocation to the imp_sym.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
Previously, TCIFLUSH flushed the pipe to_slave which transfers
input from master to slave. However, this was not sufficiant.
The master side holds input data before accept_input() in the
read-ahead buffer. So, if input data before 'enter' key can be
leaked into slave input after TCIFLUSH.
With this patch, TCIFLUSH requests master to flush read-ahead
buffer via master control pipe. To realize this, add cmd filed
to pipe_request structure so that the flush request can be
distinguished from existing pipe handle request.
Addresses: https://cygwin.com/pipermail/cygwin/2025-July/258442.html
Fixes: 41946df6111b (" (fhandler_tty_slave::tcflush): Implement input queue flushing by calling read with NULL buffer.")
Reported-by: Christoph Reiter <reiter.christoph@gmail.com>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
|
|
The posix_spawn/winchild test was added recently by
2af1914b6ad673a2041cf94cc8e78e1bdec57a27 commit. It fails to build for AArch64
due to missing stdlib.h header where malloc and free functions are defined.
This patch fixes the missing header.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
Regenerate the configuration files since a file was replaced
in the RISC-V port, and one other file was renamed.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
Redirect to memcpy() if the memory areas of source and destination
do not overlap. Only redirect if length is > SZREG in order to
reduce overhead on very short copies.
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
If misaligned accesses are slow or prohibited, either
source or destination address are unaligned and the number
of bytes to be copied is > SZREG*2, align the source address
to xlen. This speeds up the function in the case where at
least one address is unaligned, since now one word (or doubleword
for rv64) is loaded at a time, therefore reducing the amount of
memory accesses necessary.
We still need to store back individual bytes since the
destination address might (still) be unaligned after aligning
the source.
The threshold of SZREG*2 was chosen to keep the negative effect
on shorter copies caused by the additional overhead from aligning
the source low.
This change also affects the case where both adresses are xlen-
aligned, the memory areas overlap destructively, and length is not
a multiple of SZREG. In the destructive-overlap case, the copying
needs to be done in reversed order. Therefore the length is added
to the addresses first, which causes them to become unaligned.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
Add loop-unrolling for the case where both source and destination
address are aligned in the case of a destructive overlap, and
increase the unroll factor from 4 to 9 for the word-by-word
copy loop in the non-destructive case.
This matches the loop-unrolling done in memcpy() and increases
performance for lenghts >= SZREG*9 while almost not at all
degrading performance for shorter lengths.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
Replace macros with static inline functions or RISC-V specifc
macros in order to keep consistency between all functions in the port.
Change data types to fixed-width and/or RISC-V specific types.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
Copy the common implementation of memmove() to the RISC-V port.
Rename memmove.S to memmove-asm.S to keep naming of files
consistent between functions. Update Makefile.inc with the changed
filenames.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
This was previously not handled correctly by newlib.
Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
|
|
According to the POSIX documentation, "when the new process image is
executed, any file descriptor (from this new set) which has its
FD_CLOEXEC flag set shall be closed (see posix_spawn())." The "new set"
is after processing the file actions, so if addopen had the O_CLOEXEC
flag set the descriptor should be closed after the exec.
The adddup2 docs, by contrast, specify that the flag should be cleared,
even if dup2 wouldn't have done so due to the specified file descriptors
being equal. Add a comment to that effect.
Addresses: https://sourceware.org/pipermail/newlib/2025/021968.html
Fixes: c7c1a1ca1b ("2013-10-01 Petr Hosek <phosek@chromium.org>")
Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
|
|
The 'filerace' test may run longer than the watchdog timeout.
'flock' and 'fork' may leave processes behind for some unknown reason.
Signed-off-by: Christian Franke <christian.franke@t-online.de>
|
|
Only try to fix the cached DOS attributes if the caller actually
tried to create the file. Otherwise the fixup code is called even
in cases where we open the file with minimal query access bits and
NtQueryInformationFile() could fail with STATUS_ACCESS_DENIED and
the new cached DOS attributes are wrong again.
Fixes: 37c49decc835f ("Cygwin: open: only fix up cached DOS file attributes for on-disk files")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
Previously, it was always applied to "myself", which is only appropriate
in the case of _P_OVERLAY (aka exec). Apply the flag to "myself" only
in that case, and apply it to the new child instead in other cases.
Also, clear the flag from "myself" in the case of a failed exec.
Fixes: 8d8724ee1b5a ("Cygwin: pty: Fix Ctrl-C handling further for non-cygwin apps.")
Signed-off-by: Jeremy Drake <cygwin@jdrake.com>
|
|
This patch defines binutils output binary format for AArch64 which is pei-aarch64-little.
Since =/usr/lib/w32api resolves to $SYSROOT/usr/lib/w32api and Fedora cross-build takes libraries from
/usr/aarch64-pc-cygwin/sys-root/usr/lib/w32api, the SEARCH_DIR("/usr/x86_64-pc-cygwin/lib/w32api"); is
redundant and can be removed.
Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
|
|
Add options '-e' and '-r' to control error behavior and number of
test runs.
Signed-off-by: Christian Franke <christian.franke@t-online.de>
|
|
Signed-off-by: Christian Franke <christian.franke@t-online.de>
|
|
strcmp gives incorrect result for little endian targets under
the following conditions:
1. Length of 1st string is 1 less than a multiple of 4 (i.e len%4=3)
2. First string is a prefix of the second string
3. The first differing character in the second string is extended
ASCII (that is > 127)
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
This _isr_vec_count=1 is prevalent in MIPS Open FGPA examples.
Looks like forcing _isr_vec_007 in to the link was a mistake
and we always intended to only include the top-level _isr_vec
symbol.
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
The compiler driver positions the linker script at the end of the linker
command-line, after crtend.o. As a result, any INPUT objects and archive
GROUPs introduced by the linker script end up after crtend.o. This messes up
the end-of-frame marker provided by crtend.o
This has always been a problem, but a recent binutils update to clean-up
redundant NULL markers in .eh_frame exposes it as a execution failure in
exception-handling tests. This patch re-orders .eh_frame in all linker
scripts so that the one from crtend.o is placed last.
An alternative approach would be to fix the compiler driver to put
the linker script before the ENDFILE spec.
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|
|
Improve `strcmp` by using `ext` instruction, if available.
Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
|