Commit Graph

19449 Commits

Author SHA1 Message Date
Corinna Vinschen f095752167 libm: machine: Add missing sparc and mips configuration
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-03 10:45:44 +02:00
Eshan dhawan via Newlib 65918715a0 mips fenv support
Signed-off-by: Eshan dhawan <eshandhawan51@gmail.com>
2020-07-03 10:41:45 +02:00
Eshan dhawan via Newlib 03bf9f431c SPARC fenv support
Signed-off-by: Eshan dhawan <eshandhawan51@gmail.com>
2020-07-03 10:41:45 +02:00
Eshan dhawan via Newlib fd5e27d362 fenv aarch64 support
Signed-off-by: Eshan dhawan <eshandhawan51@gmail.com>
2020-07-02 12:12:39 +02:00
Dimitar Dimitrov 70cd4cbe65 pru: Fix memory corruption on syscall return
In the initial code I missed one level of pointer indirection. Instead
of storing errno in impure_data, _impure_ptr was corrupted.

Only simulator is impacted. Real targets have no OS and no syscalls.

This resolves a bunch of stdio cases from the GCC testsuite:
  FAIL->PASS: gcc.c-torture/execute/printf-2.c   -O0  execution test

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2020-07-02 11:00:33 +02:00
Corinna Vinschen 5266248285 Cygwin: add new IPPROTO_TCP options to release notes
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-01 21:33:15 +02:00
Corinna Vinschen ee22924137 Cygwin: tcp: Support TCP_QUICKACK
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-01 21:26:59 +02:00
Corinna Vinschen ffb07b41bc Cygwin: tcp: Support TCP_USER_TIMEOUT
Use TCP_MAXRTMS on newer systems, TCP_MAXRT on older systems.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-01 20:30:52 +02:00
Corinna Vinschen 8ccffddc91 Cygwin: tcp: Support TCP_KEEPIDLE, TCP_KEEPCNT, TCP_KEEPINTVL
Use WSAIoctl(SIO_KEEPALIVE_VALS) on older systems.

Make sure that keep-alive timeout is equivalent to
TCP_KEEPIDLE + TCP_KEEPCNT * TCP_KEEPINTVL on older systems,
even with TCP_KEEPCNT being a fixed value on those systems.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-01 20:30:52 +02:00
Corinna Vinschen 0feb77c260 Cygwin: tcp: Support TCP_FASTOPEN
TCP_FASTOPEN is supported since W10 1607.  Fake otherwise.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-01 20:30:40 +02:00
Corinna Vinschen e037192b50 Cygwin: tcp: fix IPPROTO_TCP option handling
- Drop definitions from <cygwin/sockets.h>
- Drop options only available on BSD
- Fix value of TCP_MAXSEG.  It was still defined as the BSD value
  while WinSock uses another value
- Handle the fact that TCP_MAXSEG is a R/O value in WinSock

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-01 09:25:54 +02:00
Takashi Yano via Cygwin-patches c11b0343c0 Cygwin: pty, termios: Unify thoughts of read ahead beffer handling.
- Return value of eat_readahead() is redefined. The return values
  of fhandler_termios::eat_readahead() and fhandler_pty_slave::
  eat_readahead() were little bit different. This patch unifies
  them to number of bytes eaten by eat_readahead().
- Considerration for raixget() is added to fhandler_pty_master::
  accept_input() code.
- Transfering contents of read ahead buffer in
  fhandler_pty_master::transfer_input_to_pcon() is removed since
  it is not necessary.
- fhandler_pty_slave::eat_readahead() ckecks EOL only when ICANON
  is set.
- Guard for _POSIX_VDISABLE is added in checking EOL.
2020-07-01 09:25:54 +02:00
Takashi Yano via Cygwin-patches 8121b606e8 Cygwin: pty: Discard CSI > Pm m sequence from native windows apps.
- If vim is started from WSL (Ubuntu) which is executed in pseudo
  console in mintty, shift key and ctrl key do not work. Though
  this issue is similar to the issue resolved by commit
  4527541ec6, that commit is not
  effective for this issue. This patch fixes the issue by discarding
  "CSI > Pm m" in fhandler_pty_master::pty_master_fwd_thread().
2020-07-01 09:25:54 +02:00
Eshan dhawan via Newlib a97bdf100f fenv support arm
Signed-off-by: Eshan dhawan <eshandhawan51@gmail.com>
2020-06-09 21:13:17 -04:00
Jeff Johnston bc5087298d Regenerate libm/machine configuration files for powerpc 2020-06-09 20:59:04 -04:00
Takashi Yano via Cygwin-patches 8014dc7099 Cygwin: pty: Fix screen distortion after less for native apps again.
- Commit c4b060e3fe seems to be not
  enough. Moreover, it does not work as expected at all in Win10
  1809. This patch essentially reverts that commit and add another
  fix. After all, the cause of the problem was a race issue in
  switch_to_pcon_out flag. That is, this flag is set when native
  app starts, however, it is delayed by wait_pcon_fwd(). Since the
  flag is not set yet when less starts, the data which should go
  into the output_handle accidentally goes into output_handle_cyg.
  This patch fixes the problem more essentially for the cause of
  the problem than previous one.
2020-06-05 21:34:52 -04:00
Eshan dhawan via Newlib e6ce6f1430 hard float support for PowerPC taken from FreeBSD
Signed-off-by: Eshan dhawan <eshandhawan51@gmail.com>
2020-06-03 11:17:47 +02:00
Corinna Vinschen 8873f073c8 Bump version to 3.1.6
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-06-01 10:48:11 +02:00
Takashi Yano via Cygwin-patches c4b060e3fe Cygwin: pty: Fix screen distortion after using less for native apps.
- If the output of non-cygwin apps is browsed using less, screen is
  ocasionally distorted after less exits. This frequently happens
  if cmd.exe is executed after less. This patch fixes the issue.
2020-06-01 10:13:57 +02:00
Takashi Yano via Cygwin-patches d212bdc400 Cygwin: pty: Revise the code which prevents undesired window title.
- In current pty, the window title can not be set from non-cygwin
  program due to the code which prevents overwriting the window
  title to "cygwin-console-helper.exe" in fhandler_pty_master::pty_
  master_fwd_thread(). This patch fixes the issue.
2020-05-31 10:33:55 +02:00
Takashi Yano via Cygwin-patches ac1f63ef28 Cygwin: pty: Clean up fhandler_pty_master::pty_master_fwd_thread().
- Remove the code which is not necessary anymore.
2020-05-31 10:33:55 +02:00
Takashi Yano via Cygwin-patches 4527541ec6 Cygwin: console: Discard some unsupported escape sequences.
- If the cygwin vim is started from a non-cygwin process which is
  executed in pseudo console, shift key and ctrl key do not work.
  In this case, vim is executed under /dev/cons*. If vim outputs
  escape sequence which is not supported by pseudo console, the
  escape sequence is leaked into the parent pty. This causes
  unexpected results. This patch fixes the issue by discarding
  "CSI > Pm m". "OSC 10;? BEL/ST" and "OSC 11;? BEL/ST" are
  discarded as well.
2020-05-31 10:33:55 +02:00
Takashi Yano via Cygwin-patches 0f7193f4fb Cygwin: pty: Prevent garbage remained in read ahead buffer.
- After commit 29431fcb5b, the issue
  reported in https://cygwin.com/pipermail/cygwin/2020-May/245057.html
  occurs. This is caused by the following mechanism. Cygwin less
  called from non-cygwin git is executed under /dev/cons* rather
  than /dev/pty* because parent git process only inherits pseudo
  console handle. Therefore, less sets ICANON flag for /dev/cons*
  rather than original /dev/pty*. When pty is switched to non-cygwin
  git process, line_edit() is used in fhandler_pty_master::write()
  only to set input_available_event and read ahead buffer is supposed
  to be flushed in accept_input(). However, ICANON flag is not set
  for /dev/pty*, so accept_input() is not called unless newline
  is entered. As a result, the input data remains in the read ahead
  buffer. This patch fixes the issue.
2020-05-31 10:33:55 +02:00
Corinna Vinschen d6242d8733 Cygwin: update C++ dialect to gnu++14
Disable -std option since gnu++14 is default anyway, but keep
it available as comment.

Update dynamic exception specifications deprecated with
C++11 to C++11-introduced noexcept expression.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-05-30 19:41:18 +02:00
Takashi Yano via Cygwin-patches 0c5aab9c99 Cygwin: console: Make cursor keys work in vim under ConEmu.
- After commit 774b8996d1, cursor
  keys do not work in vim under ConEmu without cygwin-connector.
  This patch fixes the issue.
2020-05-30 17:05:17 +02:00
Ken Brown 41ae84e6dc Cygwin: stat: fix st_mode of fifos again
This partially reverts commit
f36262d56a.  That commit incorrectly
made the st_mode of a fifo reflect the Windows permissions of the disk
file underlying the fifo.
2020-05-28 13:34:19 -04:00
Takashi Yano via Cygwin-patches b5089f339a Cygwin: pty: Prevent meaningless ResizePseudoConsole() calls.
- This patch prevents to call ResizePseudoConsole() unless the pty
  is resized.
2020-05-28 16:44:36 +02:00
Takashi Yano via Cygwin-patches 25987b2c2a Cygwin: pty: Fix a bug in free_attached_console().
- After commit 7659ff0f5a, nohup does
  not work as expected. This patch fixes the issue.

  Addresses:
  https://cygwin.com/pipermail/cygwin-developers/2020-May/011885.html
2020-05-28 09:25:49 +02:00
Corinna Vinschen 50d7dcaa0b Cygwin: FAQ: fix Cygwin build requirements
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-05-26 19:15:37 +02:00
Corinna Vinschen 4914c426c7 Cygwin: drop useless comment
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-05-26 10:22:41 +02:00
Corinna Vinschen 36b8811c3e Cygwin: add missing files to 'clean' build rule
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-05-26 10:19:35 +02:00
Corinna Vinschen 4d5efe1e1d Cygwin: revamp localtime.o build rule
Rename localtime.c.patched to localtime.patched.c to keep the correct
language suffix.

Create localtime.patched.c in the build dir rather than in the source
dir.  Decouple the build rule for creating localtime.patched.c from
the rule to build localtime.o, so we don't have to rebuild the patched
source file all the time.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-05-26 10:06:49 +02:00
Corinna Vinschen 49a843b407 Cygwin: convert localtime_wrapper.c to plain C source
That also requires a small tweak to localtime.c.patch, otherwise
GCC complains about the position of the 'trydefrules' label.
Also, simplify includes.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-05-26 09:56:57 +02:00
Corinna Vinschen 57625ac256 Cygwin: rename localtime.cc to localtime_wrapper.c
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-05-25 13:46:24 +02:00
Corinna Vinschen 2ce569ec92 Cygwin: move localtime.o build rule to end of file
otherwise a simple `make' in the cygwin dir won't build
the DLL anymore.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-05-25 13:45:17 +02:00
Mark Geisert 63ff2b84ff Cygwin: tzcode resync: details
Add tz_posixrules.h with data generated from most recent Cygwin tzdata
package.  Establish localtime.cc as primarily a wrapper around a patched
copy of localtime.c.  See README for more information.
2020-05-25 13:32:49 +02:00
Mark Geisert 2452e0b806 Cygwin: tzcode resync: imports
Import most recent NetBSD localtime.c, private.h, and tzfile.h.  An
empty namespace.h suffices for Cygwin.
2020-05-25 13:32:49 +02:00
Mark Geisert c66f16b2ff Cygwin: tzcode resync: basics
Modifies winsup/cygwin/Makefile.in to build localtime.o from items in
new winsup/cygwin/tzcode subdirectory.  Compiler option "-fpermissive"
is used to accept warnings about missing casts on the return values of
malloc() calls.  This patch also removes existing localtime.cc and
tz_posixrules.h from winsup/cygwin as they are superseded by the
subsequent patches in this set.
2020-05-25 13:32:49 +02:00
Corinna Vinschen 5489240c1b Cygwin: fix declaration of __small_{v}sprintf
Both functions are declared as extern "C" functions in
sys/smallprint.h, but as C++ funcs in winsup.h and in the
source itself.

Add extern "C to definitions, remove declarations in winsup.h
and include sys/smallprint.h instead.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-05-25 13:32:49 +02:00
Takashi Yano via Cygwin-patches 8d7a5b39d2 Cygwin: pty: Stop counting number of slaves attached to pseudo console.
- The number of slaves attached to pseudo console is used only for
  triggering redraw screen. Counting was not only needless, but also
  did not work as expected. This patch removes the code for counting.
2020-05-25 11:01:28 +02:00
Takashi Yano via Cygwin-patches c26e08095d Cygwin: pty: Revise code to make system_printf() work after close.
- After commit 0365031ce1, the issue
  https://cygwin.com/pipermail/cygwin-patches/2020q2/010259.html
  occurs. This patch fixes the issue.
2020-05-25 10:51:54 +02:00
Ken Brown bf07202e16 Cygwin: FIFO: add missing unlock
There was a missing call to reader_opening_unlock on one of the error
exits in fhandler_fifo::open.
2020-05-22 10:30:54 -04:00
Ken Brown fe937e21ad Cygwin: FIFO: Revert "take ownership on exec"
This reverts commit 39a9cd9465.

There is no need to explicitly take ownership in fixup_after_exec; if
ownership transfer is needed, it will be taken care of by
fhandler_fifo::close when the parent closes.  Moreover, closing the
parent's fifo_reader_thread can cause problems, such as the one
reported here:

  https://cygwin.com/pipermail/cygwin-patches/2020q2/010235.html
2020-05-22 10:30:54 -04:00
Takashi Yano via Cygwin-patches 0365031ce1 Cygwin: pty: Make system_printf() work after closing pty slave.
- Current pty cannot show system_printf() output after closing pty
  slave. This patch fixes the issue.
2020-05-19 15:28:21 +02:00
Takashi Yano via Cygwin-patches 7659ff0f5a Cygwin: pty: Call FreeConsole() only if attached to current pty.
- After commit 071b8e0cbd, the problem
  reported in https://cygwin.com/pipermail/cygwin/2020-May/244873.html
  occurs. This is due to freeing console device accidentally rather
  than pseudo console. This patch makes sure to call FreeConsole()
  only if the process is attached to the pseudo console of the current
  pty.
2020-05-19 15:27:31 +02:00
Szabolcs Nagy 0f785536f3 Reimplement aligned_alloc
The original implementation had multiple issues:

- Only worked when posix_memalign was available (Linux, RTEMS).
- Violated C11 link namespace rules by calling posix_memalign.
- Failed to set errno on error.

These can be fixed by essentially using the same implementation
for aligned_alloc as for memalign, i.e. simply calling _memalign_r
(which is always available and a "more reserved name" although
technically still not in the reserved link namespace, at least
code written in c cannot define a colliding symbol, newlib has
plenty such namespace issues so this is fine).

It is not clear what the right policy is when MALLOC_PROVIDED is set,
currently that does not cover aligned_alloc so it is kept that way.

Tested on aarch64-none-elf
2020-05-19 15:19:33 +02:00
Takashi Yano via Cygwin-patches 5f5810e01c Cygwin: termios: Set ECHOE, ECHOK, ECHOCTL and ECHOKE by default.
- Backspace key does not work correctly in linux session opend by
  ssh from cygwin console if the shell is bash. This is due to lack
  of these flags.

  Addresses: https://cygwin.com/pipermail/cygwin/2020-May/244837.html.
2020-05-19 12:05:02 +02:00
David Macek via Cygwin-patches 6867660301 cygwin: doc: Add keywords for ACE order issues
Windows Explorer shows a warning with Cygwin-created DACLs, but putting
the text of the warning into Google doesn't lead to the relevant Cygwin
docs.  Let's copy the warning text into the docs in the hopes of helping
confused users.  Most of the credit for the wording belongs to Yaakov
Selkowitz.

Latest inquiry: <https://cygwin.com/pipermail/cygwin/2020-May/244814.html>

Signed-off-by: David Macek <david.macek.0@gmail.com>
2020-05-19 11:42:02 +02:00
Ken Brown e637d53617 Cygwin: FIFO: improve the interruptibility of raw_read
During a blocking read, we sleep for 1 ms after each iteration through
the connected writers.  Currently we do this by calling Sleep (1).
Remove this call to Sleep and instead change the timeout in the
cygwait call from 0 to 1, so that raw_read can be interrupted while
sleeping.
2020-05-11 09:52:23 -04:00
Ken Brown 1f27345947 Cygwin: FIFO: code simplification
There are currently three functions that call NtQueryInformationFile
to determine the state of a pipe instance.  Do this only once, in a
new fifo_client_handler::set_state () function, and call that when
state information is needed.

Remove the fifo_client_handler methods pipe_state and get_state, which
are no longer needed.

Make fhandler_fifo::get_fc_handler return a reference, for use in
select.cc:peek_fifo.

Make other small changes to ensure that this commit doesn't change any
decisions based on the state of a fifo_client_handler.

The tricky part is interpreting FILE_PIPE_CLOSING_STATE, which we
translate to fc_closing.  Our current interpretation, which is not
changing as a result of this commit, is that the writer at the other
end of the pipe instance is viewed as still connected from the point
of view of raw_read and determining EOF.

But it is not viewed as still connected if we are deciding whether to
unblock a new reader that is trying to open.
2020-05-11 09:52:16 -04:00