4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-09 02:29:07 +08:00

19805 Commits

Author SHA1 Message Date
Jon Turney
09a7bf22cd 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.
2020-11-09 08:50:08 -05:00
Jon Turney
cfb3e51ea7 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.
2020-11-09 08:50:07 -05:00
Jon Turney
fbff9f73b5 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.
2020-11-09 08:50:07 -05:00
Jon Turney
70a8dca5b0 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.
2020-11-09 08:50:07 -05:00
Jon Turney
75b2397b62 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)
2020-11-09 08:50:07 -05:00
Jon Turney
89c5b2144f Cygwin: Move adding libltp to VPATH after Makefile.common
Move adding libltp to the VPATH after Makefile.common, which sets VPATH.
2020-11-09 08:50:07 -05:00
Jon Turney
bc15d0677e 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.
2020-11-09 08:50:07 -05:00
Jon Turney
39575cb8f9 Cygwin: Add rule to testsuite Makefile to regenerate it when needed 2020-11-09 08:50:07 -05:00
Jon Turney
4ec848904e 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.
2020-11-09 08:50:07 -05:00
Jon Turney
bcbf19b04d Cygwin: Add testsuite directory to autogen.sh
Also remove unneeded aclocal.m4 for an old aclocal version.
2020-11-09 08:50:07 -05:00
Ken Brown
410810968b Cygwin: FIFO: update_my_handlers: fix handle leak 2020-11-06 08:19:21 -05:00
Ivan Grokhotov
0fa86823a0 Fix 32-bit integer overflow when calculating TZ rules 2020-11-06 08:19:21 -05:00
Jon Turney
903cf7af11 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.
2020-11-06 08:19:21 -05:00
Jon Turney
b96d9a4a55 Cygwin: Remove rules for building libcygwin_s.a
Untouched since added in 66a83f3e, and described as 'non-working'.
2020-11-06 08:19:21 -05:00
Jon Turney
7209c26c97 Cygwin: Remove Makefile contents conditional on PREPROCESS, which is never defined 2020-11-06 08:19:21 -05:00
Jon Turney
3aa3626e2f 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.
2020-11-06 08:19:21 -05:00
Jon Turney
4898c47419 Cygwin: Remove autoconf variable DLL_NAME
Remove autoconf variable DLL_NAME, which has a constant value which is
only used in one place.
2020-11-06 08:19:21 -05:00
Jon Turney
e1c696f310 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.
2020-11-06 08:19:20 -05:00
Jon Turney
abe34adfa5 Cygwin: Remove intro2man.stamp on clean 2020-11-06 08:19:20 -05:00
Jon Turney
e7ecf188fa 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
2020-11-06 08:19:20 -05:00
Ken Brown
3d37fd9cef Cygwin: AF_UNIX: improve control message handling
This includes various changes to create_cmsg_data and
evaluate_cmsg_data.  The most important are:

- create_cmsg_data now allows only one SCM_RIGHTS message and one
  SCM_CREDENTIALS message.

- evaluate_cmsg_data now truncates the ancillary data to the number of
  control messages that will fit in the supplied buffer.  Previously
  it discarded all control messages if the buffer was too small.

See https://man7.org/linux/man-pages/man7/unix.7.html.
2020-11-02 11:50:46 -05:00
Ken Brown
d42acb9bc8 Cygwin: AF_UNIX: recv_peer_info: fix return value
The variable 'ret' was being used with two different meanings.  As a
result, setting ret to an error code was not actualy setting the
return value.
2020-11-01 21:58:34 -05:00
Ken Brown
6da65394a3 Cygwin: AF_UNIX: update tests 2020-11-01 21:58:34 -05:00
Ken Brown
852fb2afba Cygwin: AF_UNIX: allow more than one control message
Previously, create_cmsg_data and evaluate_cmsg_data required the
ancillary data to contain only a single control message, of type
SCM_CREDENTIALS.  In preparation for supporting SCM_RIGHTS in the
future, allow more than one.

create_cmsg_data now iterates through the specified control messages
and allows both SCM_CREDENTIALS and SCM_RIGHTS.  If no SCM_CREDENTIALS
message is present, it creates one.  This was previously done in
sendmsg.

evaluate_cmsg_data also iterates through the received control messages
and allows both SCM_CREDENTIALS and SCM_RIGHTS.  Control messages of
type SCM_CREDENTIALS are discarded unless the SO_PASSCRED option has
been set.

Update tests.
2020-11-01 15:58:00 -05:00
Kito Cheng
ac8ef88787 RISC-V: Fix wrong including file in s_isinf.c 2020-10-29 12:28:59 -04:00
Kito Cheng
906849c4f9 RISC-V: NaN should return 0 for finite[f] 2020-10-29 12:28:59 -04:00
Jon Turney
67f6939275 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.
2020-10-29 12:28:59 -04:00
Joel Sherrill
600d1902f4 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.
2020-10-29 12:28:59 -04:00
Ken Brown
a55b1a60c5 Cygwin: AF_UNIX: recvmsg: fix MSG_PEEK support for datagrams
Add a new HANDLE argument to peek_pipe and peek_pipe_poll so that the
caller can specify a pipe handle to use in lieu of get_handle().  Use
this in recvmsg to make the MSG_PEEK flag work for unbound datagram
sockets.

Untested.
2020-10-29 12:27:24 -04:00
Ken Brown
d68d091944 Cygwin: AF_UNIX: recvmsg: support the MSG_TRUNC flag
This is in Linux since Linux 3.4 but not in Posix.

Not tested.
2020-10-29 11:39:00 -04:00
Ken Brown
c69c850df4 Cygwin: AF_UNIX: sendmsg: always send credentials
If the caller doesn't specify ancillary data, add credentials to the
outgoing packet.

This enables us to satisfy the requirement
(https://man7.org/linux/man-pages/man7/unix.7.html) that a socket with
the SO_PASSCRED option enabled can get the credentials of its peer in
every message it receives.

FIXME: I'm not sure if this is the right way to satisfy that
requirement.  A possible alternative would be to arrange for a socket
to be notified when its peer enables SO_PASSCRED.
2020-10-29 10:14:34 -04:00
Ken Brown
20fd0db075 Cygwin: AF_UNIX: create_cmsg_data: fix credential checking
Require the pid specified by an administrator to be the pid of an
existing process.
2020-10-29 09:17:38 -04:00
Ken Brown
fab8f9b104 Cygwin: AF_UNIX: create_cmsg_data: check credentials
If the user is not an administrator, check that the specified
credentials match the user's credentials.
2020-10-28 12:10:54 -04:00
Ken Brown
e5f2a0b1c8 Cygwin: AF_UNIX: FIXME comments 2020-10-28 10:38:49 -04:00
Ken Brown
d662a977f9 Cygwin: AF_UNIX: socketpair: set blocking mode earlier
Call set_nonblocking before creating the pipe so that the pipe is
created with the correct blocking mode.

Also call set_pipe_non_blocking on the second socket so that the
client end of the pipe has the correct blocking mode.  This also makes
sure that the client end of the pipe is set to message mode for
reading.
2020-10-28 10:01:03 -04:00
Ken Brown
7563d755f4 Cygwin: AF_UNIX: recvmsg: various improvements
If the caller has requested the source address, try to get it on each
iteration of the main read loop, not just the first.  Set msg_namelen
to 0 if it is never received.

If a packet containing control message data is received, don't read
any more packets, even if MSG_WAITALL is set.
2020-10-28 09:25:16 -04:00
Ken Brown
b1593593f0 Cygwin: AF_UNIX: create_cmsg_data: improve error handling
Set an errno before returning false.
2020-10-28 09:06:13 -04:00
Ken Brown
3ef34ca308 Cygwin: AF_UNIX: evaluate_cmsg_data: improve error handling
Set msg_controllen to the number of bytes of ancillary data actually
copied to msg_control.

Set the MSG_CTRUNC flag when appropriate.
2020-10-28 09:06:13 -04:00
Ken Brown
82474332a6 Cygwin: AF_UNIX: recvmsg: set MSG_TRUNC for truncated datagrams
If a datagram is truncated because it is larger than the supplied
buffer, set MSG_TRUNC in the msg_flags field of the (msghdr *)
argument.  See https://man7.org/linux/man-pages/man2/recvmsg.2.html.
2020-10-28 09:06:12 -04:00
Ken Brown
785de1a08d Cygwin: AF_UNIX: recvmsg: fix indentation 2020-10-28 09:06:12 -04:00
Ken Brown
784b811131 Cygwin: fix return value of sqrtl on negative infinity
The return value is now -NaN.

This fixes a bug in the mingw-w64 code that was imported into Cygwin.
The fix is consistent with Posix and Linux.  It is also consistent
with the current mingw-w64 code, with one exception: The mingw-w64
code sets errno to EDOM if the input is -NaN, but this appears to
differ from Posix and Linux.

Addresses: https://cygwin.com/pipermail/cygwin/2020-October/246606.html
2020-10-27 10:50:46 -04:00
Takashi Yano via Cygwin-patches
c5bf5617c0 Cygwin: pty: Disable ResizePseudoConsole() if stdout is redirected.
- Calling ResizePseudoConsole() generates some escape sequences.
  Due to this behaviour, if the output of non-cygwin app is piped
  to less, screen is sometimes distorted when the screen is resized.
  With this patch, ResizePseudoConsole() is not called if stdout is
  redirected.
2020-10-27 10:50:46 -04:00
Kito Cheng
f685416883 RISC-V: Implment finite and fpclassify 2020-10-27 10:50:46 -04:00
Kito Cheng
245b6f20d5 RISC-V: Add fabs[f], fmax[f] and fmin[f]. 2020-10-27 10:50:46 -04:00
dougm
2d3c982b38 Define RB_SET_PARENT to do all assignments
to rb parent pointers. Define RB_SWAP_CHILD to replace the child of a parent
with its twin, and use it in 4 places. Use RB_SET in rb_link_node to remove the
only linuxkpi reference to color, and then drop color- and parent-related
definitions that are defined and used only in rbtree.h.

This is intended to be entirely cosmetic, with no impact on program
behavior, and leave RB_PARENT and RB_SET_PARENT as the only ways to
read and write rb parent pointers.

Reviewed by:	markj, kib
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D25264
2020-10-27 10:50:46 -04:00
dougm
1857fbd2bb In concluding RB_REMOVE_COLOR, in the case when
the sibling of the root of the too-short tree is black and at least one of the
children of that sibling is red, either one or two rotations finish the
rebalancing. In the case when both of the children are red, the current
implementation uses two rotations where only one is necessary. This change
removes that extra rotation, and in that case also removes a needless
black-to-red-to-black recoloring.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D25335
2020-10-27 10:50:46 -04:00
dougm
cc374766cf Linuxkpi uses the rb-tree structures
without using their interfaces, making them break when the representation
changes. Revert changes that eliminated the color field from rb-trees, leaving
everything as it was before.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D25250
2020-10-27 10:50:46 -04:00
dougm
f73d29df76 Fixup r361997 by balancing parens. Duh. 2020-10-27 10:50:45 -04:00
dougm
a48b79b3c1 Restore an RB_COLOR macro, for the benefit of
a bit of DIAGNOSTIC code that depends on it.

Reported by:	rpokala, mjguzik
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D25204
2020-10-27 10:50:45 -04:00
dougm
fa79e63dee To reduce the size of an rb_node, drop the color
field. Set the least significant bit in the pointer to the node from its parent
to indicate that the node is red. Have the tree rotation macros leave the
old-parent/new-child node red and the new-parent/old-child node black.

This change makes RB_LEFT and RB_RIGHT no longer assignable, and
RB_COLOR no longer defined. Any code that modifies the tree or
examines a node color would have to be modified after this change.

Reviewed by:	markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D25105
2020-10-27 10:50:45 -04:00