]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
3 years agoCygwin: console: Add missing guard regarding attach_mutex.
Takashi Yano via Cygwin-patches [Mon, 25 Jan 2021 09:18:11 +0000 (18:18 +0900)]
Cygwin: console: Add missing guard regarding attach_mutex.

- The commit a5333345 did not fix the problem enough. This patch
  provides additional guard for the issue.

3 years agosyscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE
Ben Wijen [Fri, 22 Jan 2021 15:47:11 +0000 (16:47 +0100)]
syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE

I think we don't need an extra flag as we can utilize: access & FILE_WRITE_ATTRIBUTES
What do you think?

Ben Wijen (1):
  syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE

 winsup/cygwin/ntdll.h     |  3 ++-
 winsup/cygwin/syscalls.cc | 22 +++++++--------
 winsup/cygwin/wincap.cc   | 11 ++++++++
 winsup/cygwin/wincap.h    | 56 ++++++++++++++++++++-------------------
 4 files changed, 53 insertions(+), 39 deletions(-)

--
2.30.0

>From 2d0ff6fec10d03c24d11c747852018b7bc1136ac Mon Sep 17 00:00:00 2001
In-Reply-To: <20210122105201.GD810271@calimero.vinschen.de>
References: <20210122105201.GD810271@calimero.vinschen.de>
From: Ben Wijen <ben@wijen.net>
Date: Tue, 17 Dec 2019 15:15:25 +0100
Subject: [PATCH v3 1/8] syscalls.cc: unlink_nt: Try
 FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE

Implement wincap.has_posix_unlink_semantics_with_ignore_readonly and when set
skip setting/clearing of READONLY attribute and instead use
FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE

3 years agoCygwin: ptsname_r: always return an error number on failure
Ken Brown [Wed, 20 Jan 2021 17:01:13 +0000 (12:01 -0500)]
Cygwin: ptsname_r: always return an error number on failure

Return EBADF on a bad file descriptor.  Previously 0 was returned, in
violation of the requirement in
https://man7.org/linux/man-pages/man3/ptsname_r.3.html that an error
number should be returned on failure.

We are intentionally deviating from Linux, on which ENOTTY is
returned.

Addresses: https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00245.html

3 years agoCygwin: normalize_posix_path: fix error handling when .. is encountered
Ken Brown [Wed, 20 Jan 2021 15:12:58 +0000 (10:12 -0500)]
Cygwin: normalize_posix_path: fix error handling when .. is encountered

When .. is in the source path and the path prefix exists but is not a
directory, return ENOTDIR instead of ENOENT.  This fixes a POSIX
compliance issue for realpath(3):

  https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html

Addresses: https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00214.html

3 years agoCygwin: Move post-dir unlink check
Ben Wijen [Wed, 20 Jan 2021 16:10:51 +0000 (17:10 +0100)]
Cygwin: Move post-dir unlink check

Move post-dir unlink check from fhandler_disk_file::rmdir to
_unlink_nt_post_dir_check

If a directory is not removed through fhandler_disk_file::rmdir
we can now make sure the post dir check is performed.

3 years agoCygwin: console: Fix "Bad file descriptor" error in script command.
Takashi Yano via Cygwin-patches [Wed, 20 Jan 2021 09:16:20 +0000 (18:16 +0900)]
Cygwin: console: Fix "Bad file descriptor" error in script command.

- After the commit 72770148, script command exits occasionally with
  the error "Bad file descriptor" if it is started in console on Win7
  and non-cygwin process is executed. This patch fixes the issue.

3 years agoCygwin: pty: Reduce buffer size in get_console_process_id().
Takashi Yano via Cygwin-patches [Wed, 20 Jan 2021 00:57:00 +0000 (09:57 +0900)]
Cygwin: pty: Reduce buffer size in get_console_process_id().

- The buffer used in get_console_process_id(), introduced by commit
  72770148, is too large and ERROR_NOT_ENOUGH_MEMORY occurs in Win7.
  Therefore, the buffer size has been reduced.

3 years agoCygwin: pty: Lessen the side effect of workaround for rlwarp.
Takashi Yano via Cygwin-patches [Tue, 19 Jan 2021 09:27:02 +0000 (18:27 +0900)]
Cygwin: pty: Lessen the side effect of workaround for rlwarp.

- This patch lessens the side effect of the workaround for rlwrap
  introduced by commit 4e16b033.

3 years agoCygwin: spawn.cc: Fix typo in comment by commit 974e6d76.
Takashi Yano via Cygwin-patches [Mon, 18 Jan 2021 18:45:24 +0000 (03:45 +0900)]
Cygwin: spawn.cc: Fix typo in comment by commit 974e6d76.

3 years agoCygwin: rmdir: handle /dev in fhandler_dev::rmdir
Corinna Vinschen [Tue, 19 Jan 2021 09:50:36 +0000 (10:50 +0100)]
Cygwin: rmdir: handle /dev in fhandler_dev::rmdir

The isdev_dev check in rmdir is unclean.  Create a virtual method
fhandler_dev::rmdir to handle this transparently.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
3 years agoCygwin: document a recent bug fix
Ken Brown [Fri, 15 Jan 2021 17:37:57 +0000 (12:37 -0500)]
Cygwin: document a recent bug fix

This documents commit aec64798, "Cygwin: add flag to indicate reparse
points unknown to WinAPI".

3 years agoCygwin: pty: Set input_available_event only for cygwin pipe.
Takashi Yano via Cygwin-patches [Fri, 15 Jan 2021 09:26:31 +0000 (18:26 +0900)]
Cygwin: pty: Set input_available_event only for cygwin pipe.

- cat exits immediately in the following senario.
    1) Execute env CYGWIN=disable_pcon script
    2) Execute cmd.exe
    3) Execute cat in cmd.exe.
  This is caused by setting input_available_event for the pipe for
  non-cygwin app. This patch fixes the issue.

3 years agoCygwin: pty: Make master thread functions be static.
Takashi Yano via Cygwin-patches [Fri, 15 Jan 2021 08:32:13 +0000 (17:32 +0900)]
Cygwin: pty: Make master thread functions be static.

- The functions pty_master_thread() and pty_master_fwd_thread()
  should be static (i.e. should not access class member) because
  the instance is deleted if the master is dup()'ed and the first
  master is closed. In this case, because the dup()'ed instance
  still exists, these master threads are also still alive even
  though the instance has been deleted. As a result, accesing
  class members in these functions causes accessi violation.

  Addresses:
  https://cygwin.com/pipermail/cygwin-developers/2021-January/012030.html

3 years agoCygwin: pty: Prevent pty from changing code page of parent console.
Takashi Yano via Cygwin-patches [Mon, 18 Jan 2021 13:10:57 +0000 (22:10 +0900)]
Cygwin: pty: Prevent pty from changing code page of parent console.

- After commit 232fde0e, pty changes console code page when the first
  non-cygwin app is executed. If pty is started in real console device,
  pty changes the code page of root console. This causes very annoying
  result because changing code page changes the font of command prompt
  if console is in legacy mode. This patch avoids this by creating a
  new invisible console for the first pty started in console device.

3 years agocxx.cc: Fix dynamic initialization for static local variables
Ben Wijen [Fri, 15 Jan 2021 13:45:29 +0000 (14:45 +0100)]
cxx.cc: Fix dynamic initialization for static local variables

The old implementation for __cxa_guard_acquire did not return 1,
therefore dynamic initialization was never performed.

If concurrent-safe dynamic initialisation is ever needed, CXX ABI
must be followed when re-implementing __cxa_guard_acquire (et al.)

3 years agosyscalls.cc: Use EISDIR
Ben Wijen [Fri, 15 Jan 2021 13:45:27 +0000 (14:45 +0100)]
syscalls.cc: Use EISDIR

This is the non-POSIX value returned by Linux since 2.1.132.

3 years agosyscalls.cc: Fix num_links
Ben Wijen [Fri, 15 Jan 2021 13:45:26 +0000 (14:45 +0100)]
syscalls.cc: Fix num_links

NtQueryInformationFile on fh_ro needs FILE_READ_ATTRIBUTES
to succeed.

3 years agoCygwin: Add Ben Wijen to list of contributors
Corinna Vinschen [Mon, 18 Jan 2021 11:01:11 +0000 (12:01 +0100)]
Cygwin: Add Ben Wijen to list of contributors

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
3 years agoCygwin: pty: Make close_pseudoconsole() be a static member function.
Takashi Yano via Cygwin-patches [Fri, 15 Jan 2021 08:32:11 +0000 (17:32 +0900)]
Cygwin: pty: Make close_pseudoconsole() be a static member function.

- The function close_pseudoconsole() should be static so that it
  can be safely called in spawn.cc even after the fhandler_pty_slave
  instance has been deleted. That is, there is a problem with the
  current code. This patch fixes the issue.

3 years agoCygwin: console: Revise the code to switch xterm mode.
Takashi Yano via Cygwin-patches [Fri, 15 Jan 2021 08:32:10 +0000 (17:32 +0900)]
Cygwin: console: Revise the code to switch xterm mode.

- If application changes the console mode, mode management introduced
  by commit 10d8c278 will be corrupted. For example, stdout of jansi
  v2.0.1 or later is piped to less, jansi resets the xterm mode flag
  ENABLE_VIRTUAL_TERMINA_PROCESSING when jansi is terminated. This
  causes garbled output in less because less needs this flag enabled.
  This patch fixes the issue.

3 years agoCygwin: pty: Add workaround for rlwrap 0.40 or later.
Takashi Yano via Cygwin-patches [Fri, 15 Jan 2021 08:32:09 +0000 (17:32 +0900)]
Cygwin: pty: Add workaround for rlwrap 0.40 or later.

- The workaround for rlwrap introduced by commit 8199b0cc does not
  take effect for rlwrap 0.40 or later. This patch add a workaround
  for rlwrap 0.40 or later as well.

3 years agoCygwin: fstatat: call fstat64 instead of fstat
Ken Brown [Tue, 12 Jan 2021 19:18:28 +0000 (14:18 -0500)]
Cygwin: fstatat: call fstat64 instead of fstat

This fixes a bug on 32-bit Cygwin that was introduced in commit
84252946, "Cygwin: fstatat, fchownat: support the AT_EMPTY_PATH flag".

Add a comment explaining why fstat should not be called.

Addresses: https://cygwin.com/pipermail/cygwin/2021-January/247399.html

3 years agoRTEMS: Add <poll.h> and <sys/poll.h>
Sebastian Huber [Mon, 4 Jan 2021 18:41:43 +0000 (19:41 +0100)]
RTEMS: Add <poll.h> and <sys/poll.h>

Add the POSIX header file <poll.h> which is used by the GCC 11 Ada
runtime support.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
3 years agoBump up newlib version to 4.1.0 newlib-4.1.0
Jeff Johnston [Fri, 18 Dec 2020 23:50:49 +0000 (18:50 -0500)]
Bump up newlib version to 4.1.0

3 years agofixes to make compilation succeeds
Paul Zimmermann [Fri, 18 Dec 2020 08:52:40 +0000 (09:52 +0100)]
fixes to make compilation succeeds

3 years agoUpdate gamma functions from code in picolibc
Jeff Johnston [Thu, 17 Dec 2020 20:58:49 +0000 (15:58 -0500)]
Update gamma functions from code in picolibc

- fixes issue with inf sign when x is -0

3 years agofhandler_proc.cc(format_proc_cpuinfo): report Intel SGX bits
Brian Inglis [Thu, 17 Dec 2020 07:11:28 +0000 (00:11 -0700)]
fhandler_proc.cc(format_proc_cpuinfo): report Intel SGX bits

Update to Linux next 5.10 cpuinfo flags for Intel SDM 36.7.1 Software
Guard Extensions, and 38.1.4 SGX Launch Control Configuration.
Launch control restricts what software can run with enclave protections,
which helps protect the system from bad enclaves.

3 years agoRISC-V: Add semihosting support
Craig Blackmore [Tue, 15 Dec 2020 12:00:27 +0000 (12:00 +0000)]
RISC-V: Add semihosting support

3 years agoAdd declarations for __ieee754_tgamma functions to fdlibm.h
Jeff Johnston [Wed, 16 Dec 2020 20:25:25 +0000 (15:25 -0500)]
Add declarations for __ieee754_tgamma functions to fdlibm.h

3 years agoCygwin: pty: Revise the workaround for rlwrap.
Takashi Yano via Cygwin-patches [Wed, 16 Dec 2020 09:10:58 +0000 (18:10 +0900)]
Cygwin: pty: Revise the workaround for rlwrap.

- Previous workaround has a problem that screen is distorted if up
  arrow key is pressed at the first line after running "rlwrap cmd".
  This patch fixes the issue.

3 years agoCygwin: pty: Check response for CSI6n more strictly.
Takashi Yano via Cygwin-patches [Wed, 16 Dec 2020 09:10:15 +0000 (18:10 +0900)]
Cygwin: pty: Check response for CSI6n more strictly.

- Previous code to read response for CSI6n allows invalid response
  such as "CSI Pl; Pc H" other than correct response "CSI Pl; Pc R".
  With this patch, the response is checked more strictly.

3 years agoCygwin: Make sure newer apps get uname_x even when loading uname dynamically
Corinna Vinschen [Mon, 14 Dec 2020 11:29:23 +0000 (12:29 +0100)]
Cygwin: Make sure newer apps get uname_x even when loading uname dynamically

if an application built after API version 334 loads uname dynamically,
it actually gets the old uname, rather than the new uname_x.  Fix this by
checking the apps API version in uname and call uname_x instead, if it's
a newer app.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
3 years agoarm: Fix memchr() for Armv8-R
Sebastian Huber [Fri, 4 Dec 2020 07:42:04 +0000 (08:42 +0100)]
arm: Fix memchr() for Armv8-R

The Cortex-R52 processor is an Armv8-R processor with a NEON unit.  This
fix prevents conflicting architecture profiles A/R errors issued by the
linker.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
3 years agoCygwin: pty: Add a workaround for rlwrap.
Takashi Yano via Cygwin-patches [Mon, 14 Dec 2020 08:26:47 +0000 (17:26 +0900)]
Cygwin: pty: Add a workaround for rlwrap.

- If rlwrap is used with non-cygwin apps, it fails to setup pseudo
  console. This patch adds a workaround for this issue.

3 years agoCygwin: pty: Revise the code for timeout in term_has_pcon_cap().
Takashi Yano via Cygwin-patches [Mon, 14 Dec 2020 08:26:09 +0000 (17:26 +0900)]
Cygwin: pty: Revise the code for timeout in term_has_pcon_cap().

- Sometimes timeout period in term_has_pcon_cap() may not be enough
  when the machine slows down for some reason. This patch eases the
  issue. In the new code, effective timeout period is expected to be
  extended as a result due to slowing-down the wait loop as well when
  the machine gets into busy.

3 years agoCygwin: pty: Skip term_has_pcon_cap() if pseudo console is disabled.
Takashi Yano via Cygwin-patches [Mon, 14 Dec 2020 08:25:33 +0000 (17:25 +0900)]
Cygwin: pty: Skip term_has_pcon_cap() if pseudo console is disabled.

- This patch skips unnecessary term_has_pcon_cap() call if pseudo
  console is disabled.

3 years agoFix error in powf for x close to 1 and large y
Fabian Schriever [Fri, 11 Dec 2020 15:57:35 +0000 (16:57 +0100)]
Fix error in powf for x close to 1 and large y

This patch fixes the error found by Paul Zimmermann (see
https://homepages.loria.fr/PZimmermann/papers/#accuracy) regarding x
close to 1 and rather large y (specifically he found the case
powf(0x1.ffffeep-1,-0x1.000002p+27) which returns +Inf instead of the
correct value). We found 2 more values for x which show the same faulty
behaviour, and all 3 are fixed with this patch. We have tested all
combinations for x in [+1.fffdfp-1, +1.00020p+0] and y in
[-1.000007p+27, -1.000002p+27] and [1.000002p+27,1.000007p+27].

3 years agoBump newlib release to 4.0.0
Jeff Johnston [Tue, 17 Nov 2020 21:47:35 +0000 (16:47 -0500)]
Bump newlib release to 4.0.0

3 years agocygwin: use CREATE_DEFAULT_ERROR_MODE in spawn
Jeremy Drake via Cygwin-patches [Wed, 9 Dec 2020 19:27:11 +0000 (11:27 -0800)]
cygwin: use CREATE_DEFAULT_ERROR_MODE in spawn

This allows native processes to get Windows-default error handling
behavior (such as invoking the registered JIT debugger).

3 years agoCygwin: dtable::dup_worker: update comment and debug output
Ken Brown [Mon, 7 Dec 2020 21:19:57 +0000 (16:19 -0500)]
Cygwin: dtable::dup_worker: update comment and debug output

The comment and debug output became obsolete in commit 23771fa1f7 when
dup_worker started calling fhandler_base::clone instead of build_fh_pc
and fhandler_base::operator=.

3 years agoCygwin: Allow to set SO_PEERCRED zero (v2)
Mark Geisert [Mon, 7 Dec 2020 10:29:36 +0000 (02:29 -0800)]
Cygwin: Allow to set SO_PEERCRED zero (v2)

The existing code errors as EINVAL any attempt to set a value for
SO_PEERCRED via setsockopt() on an AF_UNIX/AF_LOCAL socket.  But to
enable the workaround set_no_getpeereid behavior for Python one has
to be able to set SO_PEERCRED to zero.  Ergo, this patch.  Python has
no way to specify a NULL pointer for 'optval'.

This v2 of patch allows the original working (i.e., allow NULL,0 for
optval,optlen to mean turn off SO_PEERCRED) in addition to the new
working described above.  The sense of the 'if' stmt is reversed for
readability.

3 years agoCygwin: Launch cygmagic with bash, not sh
Mark Geisert [Mon, 7 Dec 2020 06:17:15 +0000 (22:17 -0800)]
Cygwin: Launch cygmagic with bash, not sh

On some systems /bin/sh is not /bin/bash and cygmagic has bash-isms in
it.  So even though cygmagic has a /bin/bash shebang, it also needs to be
launched with bash from within Makefile.in.

3 years agoFix trace output for getdomainname()
Anton Lavrentiev via Cygwin-patches [Fri, 4 Dec 2020 22:58:01 +0000 (17:58 -0500)]
Fix trace output for getdomainname()

3 years agowinsup/doc/Makefile.in: create man5 dir and install proc.5
Brian Inglis [Wed, 25 Nov 2020 06:49:31 +0000 (23:49 -0700)]
winsup/doc/Makefile.in: create man5 dir and install proc.5

3 years agospecialnames.xml: add proc(5) Cygwin man page
Brian Inglis [Wed, 25 Nov 2020 06:49:30 +0000 (23:49 -0700)]
specialnames.xml: add proc(5) Cygwin man page

3 years agoCygwin: Fix remaining warnings building path testsuite
Corinna Vinschen [Tue, 1 Dec 2020 09:10:40 +0000 (10:10 +0100)]
Cygwin: Fix remaining warnings building path testsuite

3 years agoCygwin: Fix building of utils testsuite
Jon Turney [Mon, 30 Nov 2020 16:58:02 +0000 (16:58 +0000)]
Cygwin: Fix building of utils testsuite

Avoid referencing undefined max_mount_entry.

3 years agoCygwin: add flag to indicate reparse points unknown to WinAPI
Corinna Vinschen [Wed, 2 Dec 2020 15:12:58 +0000 (16:12 +0100)]
Cygwin: add flag to indicate reparse points unknown to WinAPI

https://cygwin.com/pipermail/cygwin/2020-December/246938.html
reports a problem where, when adding a Cygwin default symlink
to $PATH since Cygwin 3.1.5, $PATH handling appears to be broken.

3.1.5 switched to WSL symlinks as Cygwin default symlinks.

A piece of code in path handling skips resolving reparse points
if they are the last component in the path.  Thus a reparse point
in $PATH is not resolved but converted to Windows path syntax
verbatim.

If you do this with a WSL symlink, certain WinAPI functions fail.
The underlying $PATH handling fails to recognize the reparse
point in $PATH and returns with STATUS_IO_REPARSE_TAG_NOT_HANDLED.
As a result, the calling WinAPI function fails, most prominently
so CreateProcess.

Fix this problem by adding a PATH_REP_NOAPI bit to path_types
and a matching method path_conv::is_winapi_reparse_point().

Right now this flag is set for WSL symlinks and Cygwin AF_UNIX
sockets (new type implemented as reparse points).

The aforementioned code skipping repare point path resolution calls
is_winapi_reparse_point() rather than is_known_reparse_point(),
so now path resolution is only skipped for reparse points known
to WinAPI.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
3 years agoCygwin: path.h: add comments to briefly explain path_types
Corinna Vinschen [Wed, 2 Dec 2020 14:57:39 +0000 (15:57 +0100)]
Cygwin: path.h: add comments to briefly explain path_types

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
3 years agoCygwin: testsuite: libltp: fix warnings showing up with -Wall
Corinna Vinschen [Wed, 2 Dec 2020 13:12:24 +0000 (14:12 +0100)]
Cygwin: testsuite: libltp: fix warnings showing up with -Wall

This libltp is old as old dirt and still using K&R style.
If it's really to be used again at all, it needs a serious
refresh.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
3 years agoCygwin: /proc/sys FS: don't export NFS and DFS as block devices
Corinna Vinschen [Tue, 1 Dec 2020 08:37:07 +0000 (09:37 +0100)]
Cygwin: /proc/sys FS: don't export NFS and DFS as block devices

Network filesystems are not block devices.  Apparently this code
hasn't been executed anyway, given how network filesystems are
hidden behind \Device\Mup.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
3 years agoCygwin: Fix access to block devices below /proc/sys.
Christian Franke [Sat, 28 Nov 2020 21:09:23 +0000 (22:09 +0100)]
Cygwin: Fix access to block devices below /proc/sys.

Use fhandler_dev_floppy instead of fhandler_procsys for such devices.
The read()/write() functions from fhandler_procsys do not ensure
sector aligned transfers and lseek() fails always.

Signed-off-by: Christian Franke <franke@computer.org>
3 years agoCygwin: Have cygmagic not create output if an error occurs
Jon Turney [Thu, 12 Nov 2020 17:58:58 +0000 (17:58 +0000)]
Cygwin: Have cygmagic not create output if an error occurs

Improve the 'cygmagic' script, so it doesn't create the output file if
an error occurs, even in one of the backtick-enclosed pipelines it runs.

3 years agoCygwin: Use standard CXXFLAGS when compiling localtime_wrapper.c
Jon Turney [Thu, 19 Nov 2020 21:38:47 +0000 (21:38 +0000)]
Cygwin: Use standard CXXFLAGS when compiling localtime_wrapper.c

This has an separate, explicit compilation rule which omits CXXFLAGS, so
expected flags like '-g -O2' aren't being used.

3 years agoCygwin: Drop libgmon.a build dependency on gcrt0.o
Jon Turney [Thu, 19 Nov 2020 21:34:44 +0000 (21:34 +0000)]
Cygwin: Drop libgmon.a build dependency on gcrt0.o

libgmon.a depends on gcrt0.o, but doesn't include it.

3 years agoCygwin: pty: Fix minor style issue.
Takashi Yano via Cygwin-patches [Mon, 23 Nov 2020 11:03:04 +0000 (20:03 +0900)]
Cygwin: pty: Fix minor style issue.

3 years agoCygwin: pty: Discard "OSC Ps; ? BEL/ST" in pseudo console output.
Takashi Yano via Cygwin-patches [Mon, 23 Nov 2020 11:03:03 +0000 (20:03 +0900)]
Cygwin: pty: Discard "OSC Ps; ? BEL/ST" in pseudo console output.

- If vim is executed in WSL in mintty, some garbage string caused
  by "OSC Ps;? BEL/ST" will be shown in some situations. This patch
  fixes the issue by removing "OSC Ps;? BEL/ST" from pseudo console
  output.

3 years agoCygwin: pty: Fix a bug in the code removing "CSI > Pm m".
Takashi Yano via Cygwin-patches [Mon, 23 Nov 2020 11:03:02 +0000 (20:03 +0900)]
Cygwin: pty: Fix a bug in the code removing "CSI > Pm m".

- The code added by 8121b606e843c001d5ca5213d24099e04ebc62ca has a
  bug which fails to remove multiple "CSI > Pm m" sequences. This
  patch fixes the bug.

3 years agoCygwin: Remove surplus autoconf auxiliary files
Jon Turney [Wed, 21 Oct 2020 19:41:58 +0000 (20:41 +0100)]
Cygwin: Remove surplus autoconf auxiliary files

Since we are now only configuring once, in winsup, with
AC_CONFIG_AUX_DIR(..), the auxiliary files are taken from the top-level.

(Previously we had a random assorment of AC_CONFIG_AUX_DIR(..) and
AC_CONFIG_AUX_DIR(../..) in winsup subdirectories, so auxiliary files
would be taken from winsup or the top-level.)

3 years agoCygwin: Remove recursive configure
Jon Turney [Tue, 6 Oct 2020 15:22:02 +0000 (16:22 +0100)]
Cygwin: Remove recursive configure

There's doesn't seem to be much use in independently distributing these
subdirectories, so allowing them to be independently configured seems
pointless and overcomplicated.

The order in which the subdirectories are built is still a little odd,
as cygwin is linked with libcygserver, and cygserver is then linked with
cygwin. So, we build the cygwin directory first, which invokes a build
of libcygserver in the cygserver directory, and then build in the
cygserver directory to build the cygserver executable.

Drop AC_CONFIGURE_ARGS, since we don't need to recursively call
configure with the same arguments anymore.

Slightly refine when we build utils: Previously we didn't build any
utils if MinGW compiler use was avoided, now we just avoid building
those utils which require that compiler.

Greatly simplify how winsup_srcdir and target_builddir are set, since
we're only configuring from one directory.  (These are still kept
absolute, since we don't adjust them where used for being used in a
subdirectory).

Remove configure.cygwin and put it's (greatly reduced) contents inline
in the one place it's used now.

Remove generated configure and aclocal.m4 in subdirectories.

3 years agoCygwin: fhandler_fifo::cleanup_handlers: improve efficiency
Ken Brown [Thu, 19 Nov 2020 20:22:56 +0000 (15:22 -0500)]
Cygwin: fhandler_fifo::cleanup_handlers: improve efficiency

Traverse the fifo_client_handler list from the top down to try to
avoid copying.

3 years agoCygwin: Testsuite Makefile cleanup
Jon Turney [Thu, 12 Nov 2020 15:40:44 +0000 (15:40 +0000)]
Cygwin: Testsuite Makefile cleanup

Drop unused variables CC_FOR_TARGET, GCC_INCLUDE, ALL_CFLAGS
Stop exporting CC, CFLAGS
Drop unused, empty targets force, dll_ofiles, all_target

3 years agoCygwin: Fix 'make check' in utils
Jon Turney [Thu, 12 Nov 2020 14:56:09 +0000 (14:56 +0000)]
Cygwin: Fix 'make check' in utils

This has a test of the path translation code used in various utilities
(mount, cygpath, strace).

MOUNT_BINARY is replaced with the absence of MOUNT_TEXT since 26e0b37e.
The issys member of mnt_t struct was removed in b677a99b.

> $ make check
[...]
> total tests: 63
> pass       : 63 (100.0%)
> fail       : 0 (0.0%)

3 years agoCygwin: Drop duplicate C++ flags used to build utils
Jon Turney [Wed, 11 Nov 2020 14:03:58 +0000 (14:03 +0000)]
Cygwin: Drop duplicate C++ flags used to build utils

'-fno-exceptions -fno-rtti' are already present in the compile command
COMPILE.cc set by Makefile.common, so we don't need to add them to
CXXFLAGS as well.

3 years agoCygwin: Use grep in text mode to look for version strings
Jon Turney [Wed, 28 Oct 2020 20:59:53 +0000 (20:59 +0000)]
Cygwin: Use grep in text mode to look for version strings

Invoke grep in text mode when looking for version strings inside the
cygwin DLL, so it outputs something more informative than:

  Binary file ../cygwin/cygwin0.dll matches

3 years agoRISC-V: Add machine-specific implementation for lrint[f], lround[f], llrint[f] and...
Kito Cheng [Wed, 18 Nov 2020 03:35:43 +0000 (11:35 +0800)]
RISC-V: Add machine-specific implementation for lrint[f], lround[f], llrint[f] and llround[f].

3 years agoRISC-V: Add machine-specific implementation for isnan[f] and copysign[f]
Kito Cheng [Wed, 18 Nov 2020 03:35:42 +0000 (11:35 +0800)]
RISC-V: Add machine-specific implementation for isnan[f] and copysign[f]

3 years agoRISC-V: Add missing compile rule for s_finite.c, sf_finite.c, s_isinf.c and sf_isinf.c
Kito Cheng [Wed, 18 Nov 2020 03:35:41 +0000 (11:35 +0800)]
RISC-V: Add missing compile rule for s_finite.c, sf_finite.c, s_isinf.c and sf_isinf.c

3 years agomalloc/nano-malloc: correctly check for out-of-bounds allocation reqs
Corinna Vinschen [Tue, 17 Nov 2020 09:50:57 +0000 (10:50 +0100)]
malloc/nano-malloc: correctly check for out-of-bounds allocation reqs

The overflow check in mEMALIGn erroneously checks for INT_MAX,
albeit the input parameter is size_t.  Fix this to check for
__SIZE_MAX__ instead.  Also, it misses to check the req against
adding the alignment before calling mALLOc.

While at it, add out-of-bounds checks to pvALLOc, nano_memalign,
nano_valloc, and Cygwin's (unused) dlpvalloc.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
3 years agoFix return type of __locale_ctype_ptr_l()
Sebastian Huber [Mon, 16 Nov 2020 13:38:22 +0000 (14:38 +0100)]
Fix return type of __locale_ctype_ptr_l()

This prevents warnings like this:

ctype.h:118:9: warning: return discards 'const' qualifier from pointer
  target type

3 years agoCygwin: testsuite: fix insecure usage of printf in libltp
Corinna Vinschen [Mon, 16 Nov 2020 14:55:15 +0000 (15:55 +0100)]
Cygwin: testsuite: fix insecure usage of printf in libltp

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
3 years agolibc/include/newlib.h: Fix C++ compilation issue
Joel Sherrill [Mon, 9 Nov 2020 21:33:02 +0000 (15:33 -0600)]
libc/include/newlib.h: Fix C++ compilation issue

3 years agoCygwin: path_conv::eq_worker: add NULL pointer checks
Ken Brown [Sat, 14 Nov 2020 14:02:43 +0000 (09:02 -0500)]
Cygwin: path_conv::eq_worker: add NULL pointer checks

Don't call cstrdup on NULL pointers.

This fixes a crash that was observed when cloning an fhandler whose
path_conv member had freed its strings.

3 years agoCygwin: Fix testsuite tmpdir creation with non-default cygdrive prefix
Jon Turney [Mon, 9 Nov 2020 13:48:38 +0000 (13:48 +0000)]
Cygwin: Fix testsuite tmpdir creation with non-default cygdrive prefix

3 years agoCygwin: fhandler_fifo: reduce size
Ken Brown [Sun, 8 Nov 2020 17:02:39 +0000 (12:02 -0500)]
Cygwin: fhandler_fifo: reduce size

Replace the 'WCHAR pipe_name_buf[48]' class member by 'PWCHAR
pipe_name_buf', and allocate space for the latter as needed.

Change the default constructor to accommodate this change, and add a
destructor that frees the allocated space.

Also change get_pipe_name and clone to accommodate this change.

3 years agoCygwin: Ensure temporary directory used by tests exists
Jon Turney [Thu, 29 Oct 2020 14:43:32 +0000 (14:43 +0000)]
Cygwin: Ensure temporary directory used by tests exists

By default, libltp tests will create temporary files in a subdirectory
of /tmp, which will (nowadays) be located relative to the test DLL (by
assuming that it is in /bin).  This will evaluate to the directory
$target_builddir/winsup/tmp, which doesn't exist.

The location used for these temporary files can be explicitly controlled
by setting the TDIRECTORY env var.  Arrange to set that env var to the
/cygdrive path of a tmp subdirectory of the build directory.

Unfortunately, libltp doesn't clean the temporary directory if
TDIRECTORY is set, and some tests assume they are started in a clean
directory, so we need to do that in tcl.

3 years agoCygwin: Set PATH for tests to pick up cygwin0.dll
Jon Turney [Wed, 28 Oct 2020 16:14:55 +0000 (16:14 +0000)]
Cygwin: Set PATH for tests to pick up cygwin0.dll

Set the PATH so that tests can pick up cygwin0.dll.  Looks like this was
dropped by accident in 2e488e95 ("Don't rely on in-build tools"), so
restore it as it was prior to 9d89f634.

3 years agoCygwin: Check exit code of a test, rather than stdout
Jon Turney [Fri, 16 Oct 2020 23:36:26 +0000 (00:36 +0100)]
Cygwin: Check exit code of a test, rather than stdout

In winsup.exp, don't consider a command failed if it produced any output
(e.g. if the compiler produced warnings).  Instead check the exit code.

3 years agoCygwin: Use absolute path to libltp includes
Jon Turney [Wed, 28 Oct 2020 20:20:27 +0000 (20:20 +0000)]
Cygwin: Use absolute path to libltp includes

Use an absolute path to libltp includes, to allow for the fact that
we'll be compiling tests in a subdirectory.

3 years agoCygiwn: Detect and use MinGW compilers for testsuite wrappers
Jon Turney [Wed, 28 Oct 2020 19:22:56 +0000 (19:22 +0000)]
Cygiwn: Detect and use MinGW compilers for testsuite wrappers

Drop MINGW_FE, which I can't find any trace of, and instead detect and
use MinGW compilers.

This requires adding AC_CANONICAL_TARGET, to set $target_cpu.

3 years agoCygwin: Define target_builddir autoconf and Makefile variables
Jon Turney [Wed, 28 Oct 2020 19:11:02 +0000 (19:11 +0000)]
Cygwin: Define target_builddir autoconf and Makefile variables

This is now required as cygwin_build is defined in terms of
target_builddir.

(Note that in other subdirectories, the autoconf variable
target_builddir is AC_SUBST-ed as a side-effect of using a macro from
winsup/acinclude.m4, which is perhaps less than ideal)

3 years agoCygwin: Move adding libltp to VPATH after Makefile.common
Jon Turney [Wed, 28 Oct 2020 16:42:09 +0000 (16:42 +0000)]
Cygwin: Move adding libltp to VPATH after Makefile.common

Move adding libltp to the VPATH after Makefile.common, which sets VPATH.

3 years agoCygwin: Avoid 'Makefile.in seems to ignore the --datarootdir setting' warning
Jon Turney [Tue, 3 Nov 2020 14:50:40 +0000 (14:50 +0000)]
Cygwin: Avoid 'Makefile.in seems to ignore the --datarootdir setting' warning

Avoid a 'Makefile.in seems to ignore the --datarootdir setting' warning
when configuring in testsuite directory.

3 years agoCygwin: Add rule to testsuite Makefile to regenerate it when needed
Jon Turney [Mon, 2 Nov 2020 21:53:37 +0000 (21:53 +0000)]
Cygwin: Add rule to testsuite Makefile to regenerate it when needed

3 years agoCygwin: Always configure in testsuite subdirectory
Jon Turney [Wed, 28 Oct 2020 17:02:40 +0000 (17:02 +0000)]
Cygwin: Always configure in testsuite subdirectory

Doing this properly using AC_CONFIG_SUBDIRS is necessary to get the
correct paths in flags given to the compiler specified in CC/CXX.

3 years agoCygwin: Add testsuite directory to autogen.sh
Jon Turney [Mon, 2 Nov 2020 21:45:07 +0000 (21:45 +0000)]
Cygwin: Add testsuite directory to autogen.sh

Also remove unneeded aclocal.m4 for an old aclocal version.

3 years agoCygwin: FIFO: update_my_handlers: fix handle leak
Ken Brown [Fri, 6 Nov 2020 13:16:45 +0000 (08:16 -0500)]
Cygwin: FIFO: update_my_handlers: fix handle leak

4 years agoFix 32-bit integer overflow when calculating TZ rules
Ivan Grokhotov [Wed, 4 Nov 2020 18:30:58 +0000 (13:30 -0500)]
Fix 32-bit integer overflow when calculating TZ rules

4 years agoCygwin: Drop passing '-c' compiler flag into gentls_offsets
Jon Turney [Mon, 26 Oct 2020 17:53:06 +0000 (17:53 +0000)]
Cygwin: Drop passing '-c' compiler flag into gentls_offsets

That script appends a '-E', since we only use $(CC) to preprocess, and
thus adding '-c' is having no effect.

4 years agoCygwin: Remove rules for building libcygwin_s.a
Jon Turney [Mon, 26 Oct 2020 17:51:32 +0000 (17:51 +0000)]
Cygwin: Remove rules for building libcygwin_s.a

Untouched since added in 66a83f3e, and described as 'non-working'.

4 years agoCygwin: Remove Makefile contents conditional on PREPROCESS, which is never defined
Jon Turney [Mon, 26 Oct 2020 17:48:17 +0000 (17:48 +0000)]
Cygwin: Remove Makefile contents conditional on PREPROCESS, which is never defined

4 years agoCygwin: Drop autoconf variable all_host
Jon Turney [Mon, 26 Oct 2020 13:56:51 +0000 (13:56 +0000)]
Cygwin: Drop autoconf variable all_host

The autoconf variable all_host is used to make building of the stub
library used by the testsuite conditional on not cross-compiling.

Make it unconditional, so we will notice if it's broken when
cross-compiling.

4 years agoCygwin: Remove autoconf variable DLL_NAME
Jon Turney [Fri, 23 Oct 2020 14:33:39 +0000 (15:33 +0100)]
Cygwin: Remove autoconf variable DLL_NAME

Remove autoconf variable DLL_NAME, which has a constant value which is
only used in one place.

4 years agoCygwin: Drop AC_SUBST(build_exeext)
Jon Turney [Wed, 21 Oct 2020 18:59:26 +0000 (19:59 +0100)]
Cygwin: Drop AC_SUBST(build_exeext)

The autoconf variable build_exeext isn't defined, and (since the doc
subdirectory doesn't build any executables) it's value isn't used.

4 years agoCygwin: Remove intro2man.stamp on clean
Jon Turney [Wed, 21 Oct 2020 17:26:58 +0000 (18:26 +0100)]
Cygwin: Remove intro2man.stamp on clean

4 years agoRevert "Cygwin: gendef generates sigfe.s and cygwin.def"
Jon Turney [Wed, 28 Oct 2020 15:31:27 +0000 (15:31 +0000)]
Revert "Cygwin: gendef generates sigfe.s and cygwin.def"

This reverts commit 74a164f1c162645f4389bbd9edb2f89a630853af.

Shame we can't use '&:' for a grouped target here, since that requires
GNU make 4.3

4 years agoRISC-V: Fix wrong including file in s_isinf.c
Kito Cheng [Wed, 28 Oct 2020 15:41:27 +0000 (23:41 +0800)]
RISC-V: Fix wrong including file in s_isinf.c

4 years agoRISC-V: NaN should return 0 for finite[f]
Kito Cheng [Wed, 28 Oct 2020 15:41:26 +0000 (23:41 +0800)]
RISC-V: NaN should return 0 for finite[f]

4 years agoCygwin: Restore setting CC and CXX Makefile variables
Jon Turney [Tue, 27 Oct 2020 15:31:06 +0000 (15:31 +0000)]
Cygwin: Restore setting CC and CXX Makefile variables

b55e3f19 was a bit too aggressive in dropping, rather than just
un-exporting these Makefile variables.  We need to set these to the
configured host compiler if we are cross-compiling, otherwise they
default to the build compiler.

Also export CC to the mkvers.sh script (which requires it since
4eca5e6a).  It's unclear why we can't just cause windres to use the
build 'cpp' as the pre-processor there.

4 years agolibc/sys/rtems/include/machine/_types.h: Define daddr_t to be 64 bits for RTEMS
Joel Sherrill [Tue, 27 Oct 2020 19:07:08 +0000 (14:07 -0500)]
libc/sys/rtems/include/machine/_types.h: Define daddr_t to be 64 bits for RTEMS

This type needs to be able to represent a position on a disk or
file system.

This page took 0.066632 seconds and 5 git commands to generate.