]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
2 years agoCygwin: fhandler_fifo::raw_read: handle STATUS_PENDING
Ken Brown [Tue, 23 Nov 2021 16:40:56 +0000 (11:40 -0500)]
Cygwin: fhandler_fifo::raw_read: handle STATUS_PENDING

NtReadFile can return STATUS_PENDING occasionally even in non-blocking
mode.  Check for this and wait for NtReadFile to complete.  To avoid
code repetition, do this in a static helper function nt_read.

2 years agoCygwin: fhandler_pipe::raw_read: fix handle leak
Ken Brown [Tue, 23 Nov 2021 15:13:43 +0000 (10:13 -0500)]
Cygwin: fhandler_pipe::raw_read: fix handle leak

Slightly rearrange the code to avoid returning without closing the
event handle.

2 years agoCygwin: Fix release note 3.3.3.
Takashi Yano [Mon, 22 Nov 2021 16:08:49 +0000 (01:08 +0900)]
Cygwin: Fix release note 3.3.3.

- Removes the bug fix entry that was accidentally added to the
  release notes 3.3.3, even though it had been already fixed in
  3.3.2.

2 years agoCygwin: sigproc: Fix potential race issue regarding exit_state.
Takashi Yano [Fri, 19 Nov 2021 18:24:18 +0000 (03:24 +0900)]
Cygwin: sigproc: Fix potential race issue regarding exit_state.

- If sig_send() is called while another thread is processing exit(),
  race issue regarding exit_state may occur. This patch fixes the
  issue.

2 years agoldtoa: don't restrict outbuf size to ndigits
Corinna Vinschen [Mon, 22 Nov 2021 12:57:16 +0000 (13:57 +0100)]
ldtoa: don't restrict outbuf size to ndigits

https://cygwin.com/pipermail/cygwin/2021-November/249930.html
reported a regression introduce by using a dynamically sized local
char array in favor of a statically sized array.

Fix this by reverting to a statically sized array, using a small
buffer on the stack for a reasonable number of requested digits, a
big mallocated buffer otherwise.  This should work for small targets
as well, given that malloc is used in printf anyway right now.

This is *still* hopefully just a temporary measure, unless somebody
actually provides a new ldtoa.

Fixes: 4d90e53359145 ("ldtoa: fix dropping too many digits from output")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: add release message for raise fix
Corinna Vinschen [Mon, 22 Nov 2021 11:37:01 +0000 (12:37 +0100)]
Cygwin: add release message for raise fix

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: raise: align return value and error checking to Linux
Corinna Vinschen [Mon, 22 Nov 2021 11:35:39 +0000 (12:35 +0100)]
Cygwin: raise: align return value and error checking to Linux

raise(2) on Linux returns the same values and sets errno
independent of calling kill(2) or pthread_kill(3).  Align
code to behave the same.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: raise: fix check for multithreaded process
Corinna Vinschen [Mon, 22 Nov 2021 11:33:47 +0000 (12:33 +0100)]
Cygwin: raise: fix check for multithreaded process

The check for the pthread self pointer in TLS is misleading,
given the main thread has this pointer initialized as well.
Check for the global __isthreaded flag as well.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: pthread_kill: check for invalid signal number
Corinna Vinschen [Mon, 22 Nov 2021 11:19:02 +0000 (12:19 +0100)]
Cygwin: pthread_kill: check for invalid signal number

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: fhandler_netdrive: improve debug output
Corinna Vinschen [Fri, 19 Nov 2021 11:19:31 +0000 (12:19 +0100)]
Cygwin: fhandler_netdrive: improve debug output

Add debug output for errors when calling WNet functions.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: sigproc: Do not send signal to myself if exiting.
Takashi Yano [Fri, 19 Nov 2021 17:32:12 +0000 (02:32 +0900)]
Cygwin: sigproc: Do not send signal to myself if exiting.

- This patch fixes the issue that process sometimes hangs for 60
  seconds with the following scenario.
    1) Open command prompt.
    2) Run "c:\cygwin64\bin\bash -l"
    3) Compipe the following source with mingw compiler.
       /*--- Begin ---*/
       #include <stdio.h>
       int main() {return getchar();}
       /*---- End ----*/
    4) Run "tcsh -c ./a.exe"
    5) Hit Ctrl-C.

2 years agoCygwin: console: Fix interference issue regarding master thread.
Takashi Yano [Thu, 18 Nov 2021 03:28:53 +0000 (12:28 +0900)]
Cygwin: console: Fix interference issue regarding master thread.

- This patch fixes the issue that ReadConsoleInputW() call in the
  master thread interferes with the input process of non-cygwin apps.

2 years agoCygwin: pipe: Suppress unnecessary set_pipe_non_blocking() call.
Takashi Yano [Wed, 17 Nov 2021 03:39:04 +0000 (12:39 +0900)]
Cygwin: pipe: Suppress unnecessary set_pipe_non_blocking() call.

- Call set_pipe_non_blocking(false) only if the pipe will be really
  inherited to non-cygwin process.

2 years agoCygwin: Correct the release notes 3.3.3.
Takashi Yano [Wed, 17 Nov 2021 03:39:38 +0000 (12:39 +0900)]
Cygwin: Correct the release notes 3.3.3.

- Fix incorrect description of the bug fixes part.

2 years agoCygwin: pipe: Handle STATUS_PENDING even for nonblocking mode.
Takashi Yano [Tue, 16 Nov 2021 23:13:17 +0000 (08:13 +0900)]
Cygwin: pipe: Handle STATUS_PENDING even for nonblocking mode.

- NtReadFile() and NtWriteFile() seems to return STATUS_PENDING
  occasionally even in nonblocking mode. This patch adds handling
  for STATUS_PENDING in nonblocking mode.

Addresses:
  https://cygwin.com/pipermail/cygwin/2021-November/249910.html

2 years agoCygwin: fix up cached DOS file attributes after file creation
Corinna Vinschen [Tue, 16 Nov 2021 18:44:21 +0000 (19:44 +0100)]
Cygwin: fix up cached DOS file attributes after file creation

The file attributes after creating a file are not necessarily
identical to the attributes we passed as argument to NtCreateFile.
This results in subsequent operations like fchmod or facl to
set the DOS file attributes to unexpected values.

The fix is to request file attributes from the OS after file creation
and cache those.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoRevert "Cygwin: set the FILE_ATTRIBUTE_ARCHIVE DOS attribute on file creation"
Corinna Vinschen [Tue, 16 Nov 2021 17:36:27 +0000 (18:36 +0100)]
Revert "Cygwin: set the FILE_ATTRIBUTE_ARCHIVE DOS attribute on file creation"

This reverts commit 2b28977149b1e8858b597890906f21cdecde84ce.

This patch fixes the symptoms, but not the actual problem.  Revert
and try again.

2 years agoCygwin: Drop 'make check' from AppVeyor
Jon Turney [Tue, 16 Nov 2021 16:48:10 +0000 (16:48 +0000)]
Cygwin: Drop 'make check' from AppVeyor

Appveyor has quite restrictive concurrent job limits for free projects,
so reduce the job's runtime by dropping 'make check' to avoid blocking
(since we're now also running that in a GitHub action).

2 years agoCygwin: Extend GitHub workflow to also build on Windows
Jon Turney [Thu, 29 Apr 2021 19:16:48 +0000 (20:16 +0100)]
Cygwin: Extend GitHub workflow to also build on Windows

2 years agoFix 'make man' after 67208d9e
Jon Turney [Tue, 16 Nov 2021 12:41:30 +0000 (12:41 +0000)]
Fix 'make man' after 67208d9e

Remove a left over use of doc/Makefile after 67208d9e ('newlib: merge
doc into top-level Makefile') to fix 'make man'.

2 years agoCygwin: console: Handle Unicode surrogate pairs.
Johannes Schindelin [Tue, 16 Nov 2021 10:26:10 +0000 (11:26 +0100)]
Cygwin: console: Handle Unicode surrogate pairs.

When running Cygwin's Bash in the Windows Terminal (see
https://docs.microsoft.com/en-us/windows/terminal/ for details), Cygwin
is receiving keyboard input in the form of UTF-16 characters.

UTF-16 has that awkward challenge that it cannot map the full Unicode
range, and to make up for it, there are the ranges U+D800-U+DBFF and
U+DC00-U+DFFF which are illegal except when they come in a pair encoding
for Unicode characters beyond U+FFFF.

Cygwin does not handle such surrogate pairs correctly at the moment, as
can be seen e.g. when running Cygwin's Bash in the Windows Terminal and
then inserting an emoji (e.g. via Windows + <dot>, which opens an emoji
picker on recent Windows versions): Instead of showing an emoji, this
shows the infamous question mark in a black triangle, i.e. the invalid
Unicode character.

Let's special-case surrogate pairs in this scenario.

This fixes https://github.com/git-for-windows/git/issues/3281

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 years agocleanup Unicode data files after generating updated tables
Thomas Wolff [Sun, 14 Nov 2021 23:00:00 +0000 (00:00 +0100)]
cleanup Unicode data files after generating updated tables

2 years agoupdate to Unicode 14.0
Thomas Wolff [Wed, 10 Nov 2021 23:00:00 +0000 (00:00 +0100)]
update to Unicode 14.0

2 years agonewlib: merge doc into top-level Makefile
Mike Frysinger [Thu, 11 Nov 2021 02:04:31 +0000 (21:04 -0500)]
newlib: merge doc into top-level Makefile

Avoid a recursive make with this tiny subdir to speed things up a bit.

2 years agochange _COMPILING_NEWLIB to _LIBC
Mike Frysinger [Tue, 9 Nov 2021 03:22:27 +0000 (22:22 -0500)]
change _COMPILING_NEWLIB to _LIBC

Use the same name as glibc & gnulib to indicate "newlib itself is
being compiled".  This also harmonizes the codebase a bit in that
_LIBC was already used in places instead of _COMPILING_NEWLIB.

Building for bfin-elf, mips-elf, and x86_64-pc-cygwin produces
the same object code.

2 years agoCygwin: set the FILE_ATTRIBUTE_ARCHIVE DOS attribute on file creation
Corinna Vinschen [Mon, 15 Nov 2021 19:31:51 +0000 (20:31 +0100)]
Cygwin: set the FILE_ATTRIBUTE_ARCHIVE DOS attribute on file creation

Do this for normal files and symlinks, not for temporary files,
device files or unix sockets.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: dllfixdbg: create .gnu_debuglink section in the right spot
Corinna Vinschen [Mon, 15 Nov 2021 12:32:03 +0000 (13:32 +0100)]
Cygwin: dllfixdbg: create .gnu_debuglink section in the right spot

A recent change in binutils marks the .gnu_debuglink_overlay section
as debug section.  When dllfixdbg calls objcopy -g, the section
is removed and the --add-gnu-debuglink option on the same command line
appends the section consequentially at the end of the sections.
This in turn breaks Windows Version info and, potentially, raising
the cygheap size at runtime.

Fix this by adding an explicit --keep-section=.gnu_debuglink_overlay
to the objcopy command line.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agonewlib: ignore _FORTIFY_SOURCE when building newlib
Mike Frysinger [Tue, 9 Nov 2021 02:42:12 +0000 (21:42 -0500)]
newlib: ignore _FORTIFY_SOURCE when building newlib

Some distros enable _FORTIFY_SOURCE by default which upsets building
newlib which itself implements the logic for this define.  For example,
building gets.c fails because the includes set up a gets() macro which
expands in the definition.

Since newlib isn't prepared to build itself with _FORTIFY_SOURCE, and
it's not clear if it's even useful, ignore it when building the code.
This also matches what glibc is doing.

2 years agodefine _COMPILING_NEWLIB for all targets when compiling
Mike Frysinger [Tue, 9 Nov 2021 00:23:33 +0000 (19:23 -0500)]
define _COMPILING_NEWLIB for all targets when compiling

The _COMPILING_NEWLIB symbol is for declaring "the code is being
compiled for newlib itself" so headers can change behavior vs the
header being used by users (who should get the normal clean API).
Unfortunately, this symbol is defined inconsistently leading to it
only being useful for a few subsections of the tree.

Pull it out so that it's defined all the time for all targets.

2 years agoctype: use less short names in public header
Mike Frysinger [Tue, 9 Nov 2021 00:28:16 +0000 (19:28 -0500)]
ctype: use less short names in public header

We're seeing a build failure in GNU sim code which is using _P locally
but the ctype.h define clashes with it.  Rename these to use the same
symbols that glibc does.  They're a bit more verbose, but seems likely
that we'll have fewer conflicts if glibc isn't seeing them.

However, these shortnames are still used internally by ctype modules
to produce pretty concise source code, so move the short names to the
internal ctype_.h where short name conflicts shouldn't show up.

2 years agoCygwin: add 3.3.3 release notes
Corinna Vinschen [Thu, 11 Nov 2021 10:01:23 +0000 (11:01 +0100)]
Cygwin: add 3.3.3 release notes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: introduce isabspath_strict macro
Corinna Vinschen [Wed, 10 Nov 2021 20:17:30 +0000 (21:17 +0100)]
Cygwin: introduce isabspath_strict macro

isabspath handles a path "X:", without trailing slash or backslash,
as absolute path.  This breaks some scenarios with relative paths
starting with "X:".  For instance, fstatat will mishandle a call
with valid dirfd and "c:" as path.

The reason is that gen_full_path_at() will check for isabspath("C:")
which returns true.  So the path will be used verbatim in fstatat,
rather than being converted to a path "<dirfd-path>/c:".

So, introduce isabspath_strict, which returns true for paths starting
with "X:" only if the next char is actually a slash or backslash.
Use it from gen_full_path_at().

This still fixes only half the problem.  The right thing would have been
to disallow using DOS paths in the first place.  Unfortunately it's much
too late for that.

Addresses: https://cygwin.com/pipermail/cygwin/2021-November/249837.html
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: drop unused isabspath_u and iswabspath macros
Corinna Vinschen [Wed, 10 Nov 2021 20:08:11 +0000 (21:08 +0100)]
Cygwin: drop unused isabspath_u and iswabspath macros

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: pipe: Fix raw_write() for non-cygwin pipe with size zero.
Takashi Yano [Thu, 11 Nov 2021 03:30:24 +0000 (12:30 +0900)]
Cygwin: pipe: Fix raw_write() for non-cygwin pipe with size zero.

- Currently, raw_write() fails to handle size zero pipe which may
  be created by non-cygwin apps (e.g. Windows native ninja). This
  patch fixes the issue.

Addresses:
  https://cygwin.com/pipermail/cygwin/2021-November/249844.html

2 years agowinsup: delete old _LIBC logic
Mike Frysinger [Wed, 10 Nov 2021 00:25:22 +0000 (19:25 -0500)]
winsup: delete old _LIBC logic

This logic has never been used as we don't define _LIBC and the
reentrant.h header doesn't exist, so delete it all.

2 years agoetc: switch to automake
Mike Frysinger [Thu, 9 Sep 2021 20:43:28 +0000 (16:43 -0400)]
etc: switch to automake

There's no content in here currently, so switching to automake is
pretty easy with a stub file.

2 years agoetc: rename configure.in to configure.ac
Mike Frysinger [Thu, 9 Sep 2021 20:40:36 +0000 (16:40 -0400)]
etc: rename configure.in to configure.ac

The .in name has been deprecated for a long time in favor of .ac.

2 years agotexi2pod.pl: add no-op --no-split option support [PR28144]
Sergei Trofimovich [Mon, 26 Jul 2021 21:51:18 +0000 (22:51 +0100)]
texi2pod.pl: add no-op --no-split option support [PR28144]

Change 2faf902da ("generate single html manual page by default")
added use of --no-split option to makeinfo. binutils reuses
makeinfo options for texi2pod.pl wrapper. Unsupported option
led to silent manpage truncation.

The change adds no-op option support.

etc/

* texi2pod.pl: Handle no-op --no-split option.

2 years agoUpdate year range in copyright notice of binutils files
Alan Modra [Thu, 31 Dec 2020 22:58:58 +0000 (09:28 +1030)]
Update year range in copyright notice of binutils files

2 years agoAdd libctf to update-copyright.py
Alan Modra [Thu, 31 Dec 2020 22:53:40 +0000 (09:23 +1030)]
Add libctf to update-copyright.py

2 years agotexi2pod.pl: import support for @t{...} from gcc
Simon Marchi [Wed, 15 Jan 2020 17:58:08 +0000 (12:58 -0500)]
texi2pod.pl: import support for @t{...} from gcc

GDB's man page source (in gdb.texinfo) contains:

    @t{++}

The @t{...} part is supposed to display the wrapped text with a
fixed-width font.  The texi2pod.pl script currently doesn't handle
@t{...}, so it appears as-is in the man page:

    You can use GDB to debug programs written in C, C@t{++}, Fortran and Modula-2.

gcc's version of texi2pod.pl (at contrib/texi2pod.pl in gcc's repo)
replaces @t{...} with the wrapped text as-is, which I think is an
acceptable behavior.  The fixed-width font distinction is not really
important for a man page, where the text will be displayed with whatever
font the user is using.

Import the line that does that from gcc's version.

I have verified that there is no other, unwanted change in man pages
generated in binutils' and GDB's doc, with this patch applied.

etc/ChangeLog:

* texi2pod.pl: Handle @t{...} tags.

2 years agoUpdate year range in copyright notice of binutils files
Alan Modra [Tue, 1 Jan 2019 10:31:27 +0000 (21:01 +1030)]
Update year range in copyright notice of binutils files

2 years agoBump to autoconf 2.69 and automake 1.15.1
Simon Marchi [Tue, 19 Jun 2018 20:54:48 +0000 (16:54 -0400)]
Bump to autoconf 2.69 and automake 1.15.1

When trying to run the update-gnulib.sh script in gdb, I get this:

Error: Wrong automake version (Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^      =:+{}]+)}/ at /opt/automake/1.11.1/bin/automake line 4113.), we need 1.11.1.
Aborting.

Apparently, it's an issue with a regex in automake that triggers a
warning starting with Perl 5.22.  It has been fixed in automake 1.15.1.
So I think it's a good excuse to bump the versions of autoconf and
automake used in the gnulib import.  And to avoid requiring multiple
builds of autoconf/automake, it was suggested that we bump the required
version of those tools for all binutils-gdb.

For autoconf, the 2.69 version is universally available, so it's an easy
choice.  For automake, different distros and distro versions have
different automake versions.  But 1.15.1 seems to be the most readily
available as a package.  In any case, it's easy to build it from source.

I removed the version checks from AUTOMAKE_OPTIONS and AC_PREREQ,
because I don't think they are useful in our case.  They only specify a
lower bound for the acceptable version of automake/autoconf.  That's
useful if you let the user choose the version of the tool they want to
use, but want to set a minimum version (because you use a feature that
was introduced in that version).  In our case, we force people to use a
specific version anyway.  For the autoconf version, we have the check in
config/override.m4 that enforces the version we want.  It will be one
less thing to update next time we change autotools version.

I hit a few categories of problems that required some changes.  They are
described below along with the chosen solutions.

Problem 1:

  configure.ac:17: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
  configure.ac:17: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation

Solution 1:

  Adjust the code based on the example at that URL.

Problem 2 (in zlib/):

  Makefile.am: error: required file './INSTALL' not found
  Makefile.am:   'automake --add-missing' can install 'INSTALL'
  Makefile.am: error: required file './NEWS' not found
  Makefile.am: error: required file './AUTHORS' not found
  Makefile.am: error: required file './COPYING' not found
  Makefile.am:   'automake --add-missing' can install 'COPYING'

Solution 2:

  Add the foreign option to AUTOMAKE_OPTIONS.

Problem 3:

  doc/Makefile.am:20: error: support for Cygnus-style trees has been removed

Solution 3:

  Remove the cygnus options.

Problem 4:

  Makefile.am:656: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

Solution 4:

  Rename "INCLUDES = " to "AM_CPPFLAGS += " (because AM_CPPFLAGS is
  already defined earlier).

Problem 5:

  doc/Makefile.am:71: warning: suffix '.texinfo' for Texinfo files is discouraged; use '.texi' instead
  doc/Makefile.am: warning: Oops!
  doc/Makefile.am:     It appears this file (or files included by it) are triggering
  doc/Makefile.am:     an undocumented, soon-to-be-removed automake hack.
  doc/Makefile.am:     Future automake versions will no longer place in the builddir
  doc/Makefile.am:     (rather than in the srcdir) the generated '.info' files that
  doc/Makefile.am:     appear to be cleaned, by e.g. being listed in CLEANFILES or
  doc/Makefile.am:     DISTCLEANFILES.
  doc/Makefile.am:     If you want your '.info' files to be placed in the builddir
  doc/Makefile.am:     rather than in the srcdir, you have to use the shiny new
  doc/Makefile.am:     'info-in-builddir' automake option.

Solution 5:

  Rename .texinfo files to .texi.

Problem 6:

  doc/Makefile.am: warning: Oops!
  doc/Makefile.am:     It appears this file (or files included by it) are triggering
  doc/Makefile.am:     an undocumented, soon-to-be-removed automake hack.
  doc/Makefile.am:     Future automake versions will no longer place in the builddir
  doc/Makefile.am:     (rather than in the srcdir) the generated '.info' files that
  doc/Makefile.am:     appear to be cleaned, by e.g. being listed in CLEANFILES or
  doc/Makefile.am:     DISTCLEANFILES.
  doc/Makefile.am:     If you want your '.info' files to be placed in the builddir
  doc/Makefile.am:     rather than in the srcdir, you have to use the shiny new
  doc/Makefile.am:     'info-in-builddir' automake option.

Solution 6:

  Remove the hack at the bottom of doc/Makefile.am and use
  the info-in-builddir automake option.

Problem 7:

  doc/Makefile.am:35: error: required file '../texinfo.tex' not found
  doc/Makefile.am:35:   'automake --add-missing' can install 'texinfo.tex'

Solution 7:

  Use the no-texinfo.tex automake option.  We also have one in
  texinfo/texinfo.tex, not sure if we should point to that, or move it
  (or a newer version of it added with automake --add-missing) to
  top-level.

Problem 8:

  Makefile.am:131: warning: source file 'config/tc-aarch64.c' is in a subdirectory,
  Makefile.am:131: but option 'subdir-objects' is disabled
  automake: warning: possible forward-incompatibility.
  automake: At least a source file is in a subdirectory, but the 'subdir-objects'
  automake: automake option hasn't been enabled.  For now, the corresponding output
  automake: object file(s) will be placed in the top-level directory.  However,
  automake: this behaviour will change in future Automake versions: they will
  automake: unconditionally cause object files to be placed in the same subdirectory
  automake: of the corresponding sources.
  automake: You are advised to start using 'subdir-objects' option throughout your
  automake: project, to avoid future incompatibilities.

Solution 8:

  Use subdir-objects, that means adjusting references to some .o that will now
  be in config/.

Problem 9:

  configure.ac:375: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
  ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
  ../../lib/autoconf/general.m4:2601: _AC_COMPILE_IFELSE is expanded from...
  ../../lib/autoconf/general.m4:2617: AC_COMPILE_IFELSE is expanded from...
  ../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
  ../../lib/autoconf/general.m4:2042: AC_CACHE_VAL is expanded from...
  ../../lib/autoconf/general.m4:2063: AC_CACHE_CHECK is expanded from...
  configure.ac:375: the top level

Solution 9:

  Use AC_LANG_SOURCE, or use proper quoting.

Problem 10 (in intl/):

  configure.ac:7: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
  /usr/share/aclocal/threadlib.m4:36: gl_THREADLIB_EARLY_BODY is expanded from...
  /usr/share/aclocal/threadlib.m4:29: gl_THREADLIB_EARLY is expanded from...
  /usr/share/aclocal/threadlib.m4:318: gl_THREADLIB is expanded from...
  /usr/share/aclocal/lock.m4:9: gl_LOCK is expanded from...
  /usr/share/aclocal/intl.m4:211: gt_INTL_SUBDIR_CORE is expanded from...
  /usr/share/aclocal/intl.m4:25: AM_INTL_SUBDIR is expanded from...
  /usr/share/aclocal/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
  configure.ac:7: the top level

Solution 10:

  Add AC_USE_SYSTEM_EXTENSIONS in configure.ac.

ChangeLog:

* libtool.m4: Use AC_LANG_SOURCE.
* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
* README-maintainer-mode: Update version requirements.
* ar-lib: New file.
* test-driver: New file.
* configure: Re-generate.

bfd/ChangeLog:

* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
(INCLUDES): Rename to ...
(AM_CPPFLAGS): ... this.
* configure.ac: Remove AC_PREREQ.
* doc/Makefile.am (AUTOMAKE_OPTIONS): Remove 1.9, cygnus, add
info-in-builddir no-texinfo.tex.
(info_TEXINFOS): Rename bfd.texinfo to bfd.texi.
* doc/bfd.texinfo: Rename to ...
* doc/bfd.texi: ... this.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* config.in: Re-generate.
* configure: Re-generate.
* doc/Makefile.in: Re-generate.

binutils/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* doc/Makefile.am (AUTOMAKE_OPTIONS): Remove cygnus, add
info-in-builddir no-texinfo.tex.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* config.in: Re-generate.
* configure: Re-generate.
* doc/Makefile.in: Re-generate.

config/ChangeLog:

* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.

etc/ChangeLog:

* configure.in: Remove AC_PREREQ.
* configure: Re-generate.

gas/ChangeLog:

* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11, add subdir-objects.
(TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O): Add config/ prefix.
* configure.ac (TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O, emfiles,
extra_objects): Add config/ prefix.
* doc/as.texinfo: Rename to...
* doc/as.texi: ... this.
* doc/Makefile.am: Rename as.texinfo to as.texi throughout.
Remove DISTCLEANFILES hack.
(AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add no-texinfo.tex and
info-in-builddir.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* config.in: Re-generate.
* configure: Re-generate.
* doc/Makefile.in: Re-generate.

gdb/ChangeLog:

* common/common-defs.h (PACKAGE_NAME, PACKAGE_VERSION,
PACKAGE_STRING, PACKAGE_TARNAME): Undefine.
* configure.ac: Remove AC_PREREQ, add missing quoting.
* gnulib/configure.ac: Modernize usage of
AC_INIT/AM_INIT_AUTOMAKE.  Remove AC_PREREQ.
* gnulib/update-gnulib.sh (AUTOCONF_VERSION): Bump to 2.69.
(AUTOMAKE_VERSION): Bump to 1.15.1.
* configure: Re-generate.
* config.in: Re-generate.
* aclocal.m4: Re-generate.
* gnulib/aclocal.m4: Re-generate.
* gnulib/config.in: Re-generate.
* gnulib/configure: Re-generate.
* gnulib/import/Makefile.in: Re-generate.

gdb/gdbserver/ChangeLog:

* configure.ac: Remove AC_PREREQ, add missing quoting.
* configure: Re-generate.
* config.in: Re-generate.
* aclocal.m4: Re-generate.

gdb/testsuite/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.

gold/ChangeLog:

* configure.ac: Remove AC_PREREQ, add missing quoting and usage
of AC_LANG_SOURCE.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.
* testsuite/Makefile.in: Re-generate.

gprof/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* Makefile.am: Remove DISTCLEANFILES hack.
(AUTOMAKE_OPTIONS): Remove 1.11, add info-in-builddir.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.
* gconfig.in: Re-generate.

intl/ChangeLog:

* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
* configure: Re-generate.
* config.h.in: Re-generate.
* aclocal.m4: Re-generate.

ld/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* Makefile.am: Remove DISTCLEANFILES hack, rename ld.texinfo to
ld.texi, ldint.texinfo to ldint.texi throughout.
(AUTOMAKE_OPTIONS): Add info-in-builddir.
* README: Rename ld.texinfo to ld.texi, ldint.texinfo to
ldint.texi throughout.
* gen-doc.texi: Likewise.
* h8-doc.texi: Likewise.
* ld.texinfo: Rename to ...
* ld.texi: ... this.
* ldint.texinfo: Rename to ...
* ldint.texi: ... this.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* config.in: Re-generate.
* configure: Re-generate.

libdecnumber/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.
* aclocal.m4.

libiberty/ChangeLog:

* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.
* config.in: Re-generate.

opcodes/ChangeLog:

* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
* configure.ac: Remove AC_PREREQ.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.

readline/ChangeLog.gdb:

* configure: Re-generate.
* examples/rlfe/configure: Re-generate.

sim/ChangeLog:

* All configure.ac: Remove AC_PREREQ.
* All configure: Re-generate.

zlib/ChangeLog.bin-gdb:

* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add
foreign.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.

2 years agoUpdate year range in copyright notice of binutils files
Alan Modra [Wed, 3 Jan 2018 05:17:27 +0000 (15:47 +1030)]
Update year range in copyright notice of binutils files

2 years agoUpdate the address of the FSF in the copyright notice of files which were using the...
Nick Clifton [Thu, 14 Dec 2017 12:48:55 +0000 (12:48 +0000)]
Update the address of the FSF in the copyright notice of files which were using the old address.

top * COPYING.LIBGLOSS: Update address of FSF in copyright notice.

bfd * cpu-mt.c: Update address of FSF in copyright notice.
* elf32-m32c.c: Likewise.
* elf32-mt.c: Likewise.
* elf32-rl78.c: Likewise.
* elf32-rx.c: Likewise.
* elf32-rx.h: Likewise.
* elf32-spu.h: Likewise.
* hosts/x86-64linux.h: Likewise.

etc * add-log.el: Update address of FSF in copyright notice.

gas * config/tc-m32c.c: Update address of FSF in copyright notice.
* config/tc-m32c.h: Likewise.
* config/tc-mt.c: Likewise.
* config/tc-mt.h: Likewise.
* config/tc-visium.c: Likewise.
* config/tc-visium.h: Likewise.
* testsuite/gas/rx/explode: Likewise.

ld * testsuite/ld-mn10300/mn10300.exp: Update address of FSF in
copyright notice.

2 years agoupdate-copyright.py for binutils
Alan Modra [Wed, 4 Jan 2017 13:19:58 +0000 (23:49 +1030)]
update-copyright.py for binutils

This is a modified form of gcc's contrib/update-copyright.py.

* update-copyright.py: New file.
* add-log.el: Update copyright year range.
* texi2pod.pl: Likewise.

2 years agoFix compile time warning messages building with gcc v6.1.1
Nick Clifton [Mon, 13 Jun 2016 09:49:26 +0000 (10:49 +0100)]
Fix compile time warning messages building with gcc v6.1.1

etc * texi2pod.pl: Escape curly braces, whilst searching for keyword
strong.

gas * config/tc-arm.c: For non-ELF based targets skip ARM feature sets
that are not supported.

* config/tc-arc.c (md_apply_fix): Avoid left shifting a signed
constant.
* config/tc-cr16.c (check_range): Likewise.
* config/tc-nios2.c (nios2_check_overflow): Likewise.

2 years agoCygwin: pipe: Handle WAIT_CANCELED when waiting read_mtx.
Takashi Yano [Wed, 10 Nov 2021 03:24:53 +0000 (12:24 +0900)]
Cygwin: pipe: Handle WAIT_CANCELED when waiting read_mtx.

- Add missing handling for WAIT_CANCELED in cygwait() for read_mtx
  in raw_read().

2 years agonewlib: mips: delete glibc-specific logic
Mike Frysinger [Tue, 9 Nov 2021 03:18:43 +0000 (22:18 -0500)]
newlib: mips: delete glibc-specific logic

This code looks like it's written to be copied & pasted between diff
C libraries and relies on _LIBC only being used with glibc.  This will
break when newlib changes from _COMPILING_NEWLIB to _LIBC, so delete
the glibc-specific logic ahead of time.

2 years agoCygwin: pipe: Avoid false EOF while reading output of C# programs.
Takashi Yano [Sun, 7 Nov 2021 03:47:18 +0000 (12:47 +0900)]
Cygwin: pipe: Avoid false EOF while reading output of C# programs.

- If output of C# program is redirected to pipe, pipe reader falsely
  detects EOF. This happens after overhaul of pipe implementation.
  This patch fixes the issue.

Addresses:
  https://cygwin.com/pipermail/cygwin/2021-November/249777.html

2 years agolibgloss: regenerate aclocal.m4 & configure w/newer versions
Mike Frysinger [Wed, 15 Sep 2021 04:22:54 +0000 (00:22 -0400)]
libgloss: regenerate aclocal.m4 & configure w/newer versions

Regenerate the files using automake-1.15 & autoconf-2.69 to match the
binutils/gdb/gcc projects.  Ran:

libgloss $ find -name configure.ac -printf '%h\n' | while read d; do
  (cd $d; export WANT_AUTOCONF=2.69 WANT_AUTOMAKE=1.15;
   aclocal-1.15 -I.. && autoconf-2.69); done

2 years agolibgloss/newlib: update configure.ac in Makefile.in files
Mike Frysinger [Tue, 14 Sep 2021 02:53:54 +0000 (22:53 -0400)]
libgloss/newlib: update configure.ac in Makefile.in files

The maintainer rules refer to configure.in directly, so update that
after renaming all the configure.ac files.

2 years agoCygwin: fix permission problem when writing DAC info on Samba shares
Corinna Vinschen [Thu, 4 Nov 2021 20:48:45 +0000 (21:48 +0100)]
Cygwin: fix permission problem when writing DAC info on Samba shares

Cygwin always requests FILE_WRITE_ATTRIBUTES permissions when trying to
change DAC information.  This can lead to permission problems when
trying to chmod/chown files on Samba shares.  Drop requesting
FILE_WRITE_ATTRIBUTES on Samba shares and go with WRITE_DAC/WRITE_OWNER
only.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: Add a new 3.4.0 rel notes file
Corinna Vinschen [Thu, 4 Nov 2021 10:59:25 +0000 (11:59 +0100)]
Cygwin: Add a new 3.4.0 rel notes file

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: add release note for rounding issue
Corinna Vinschen [Thu, 4 Nov 2021 10:54:22 +0000 (11:54 +0100)]
Cygwin: add release note for rounding issue

Also rename release 3.4.0 to 3.3.2.  It doesn't make sense to
duplicate the issues fixed in 3.3.x into the 3.4.0 relnotes.
Only patches not backported into 3.3.x belong into 3.4.0.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoldtoa: fix dropping too many digits from output
Corinna Vinschen [Thu, 4 Nov 2021 10:30:44 +0000 (11:30 +0100)]
ldtoa: fix dropping too many digits from output

ldtoa cuts the number of digits it returns based on a computation of
number of supported bits (144) divide by log10(2).  Not only is the
integer approximation of log10(2) ~= 8/27 missing a digit here, it
also fails to take really small double and long double values into
account.

Allow for the full potential precision of long double values.  At the
same time, change the local string array allocation to request only as
much bytes as necessary to support the caller-requested number of
digits, to keep the stack size low on small targets.

In the long run a better fix would be to switch to gdtoa, as the BSD
variants, as well as Mingw64 do.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: console: Prevent the exec'ed bash from exiting by Ctrl-C.
Takashi Yano [Wed, 3 Nov 2021 06:14:42 +0000 (15:14 +0900)]
Cygwin: console: Prevent the exec'ed bash from exiting by Ctrl-C.

- Currently, bash occasionally exits by Ctrl-C with the following
  scenario.
    1) Start bash in the command prompt.
    2) Run 'exec bash'.
    3) Press Ctrl-C several times.
  This patch fixes the issue.

2 years agoCygwin: add release note
Corinna Vinschen [Tue, 2 Nov 2021 14:10:58 +0000 (15:10 +0100)]
Cygwin: add release note

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: console: Fix yet another bug on input when signalled.
Takashi Yano [Tue, 2 Nov 2021 08:09:40 +0000 (17:09 +0900)]
Cygwin: console: Fix yet another bug on input when signalled.

- Currently, read() returns EINTR due to a bug if signal handler
  is SIG_DFL and the process is suspended by Ctrl-Z and restarted.
  This patch fixes the issue.

2 years agoCygwin: console: Fix a bug on input when signalled.
Takashi Yano [Tue, 2 Nov 2021 03:40:10 +0000 (12:40 +0900)]
Cygwin: console: Fix a bug on input when signalled.

- This patch fixes the bug that Ctrl-C sometimes does not work as
  expected in Windows Terminal.

Addresses:
  https://cygwin.com/pipermail/cygwin/2021-November/249749.html

2 years agoCygwin: remove unused lsaauth authentication function
Corinna Vinschen [Fri, 29 Oct 2021 19:03:07 +0000 (21:03 +0200)]
Cygwin: remove unused lsaauth authentication function

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: remove support for Vista entirely
Corinna Vinschen [Fri, 29 Oct 2021 16:18:24 +0000 (18:18 +0200)]
Cygwin: remove support for Vista entirely

Fix up a few comments while at it

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: drop support for systems not supporting the CONSOLE LOGON SID
Corinna Vinschen [Fri, 29 Oct 2021 16:17:00 +0000 (18:17 +0200)]
Cygwin: drop support for systems not supporting the CONSOLE LOGON SID

i. e. Vista/2008.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: drop support for systems not supporting RFC 4646 locales
Corinna Vinschen [Fri, 29 Oct 2021 16:15:22 +0000 (18:15 +0200)]
Cygwin: drop support for systems not supporting RFC 4646 locales

i. e. Vista/2008.  This drops support for the sr_CS locale.

Regenerate LC_MESSAGES and LC_TIME ERA data from more recent Linux

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: drop support for systems not supporting processor groups
Corinna Vinschen [Fri, 29 Oct 2021 16:11:27 +0000 (18:11 +0200)]
Cygwin: drop support for systems not supporting processor groups

i. e., Vista/2008.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: drop support for simple invisible console code
Corinna Vinschen [Fri, 29 Oct 2021 16:08:32 +0000 (18:08 +0200)]
Cygwin: drop support for simple invisible console code

i. e., Vista/2008.

AllocConsole appears to allow creating a console only on the currently
visible desktop since Windows 7, which broke the simple code opening
the console on an invisible desktop in an invisible window station.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: drop support for systems not supporting QueryUnbiasedInterruptTime
Corinna Vinschen [Fri, 29 Oct 2021 16:01:33 +0000 (18:01 +0200)]
Cygwin: drop support for systems not supporting QueryUnbiasedInterruptTime

i. e., Vista/2008

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: drop Vista WOW64 specific child process handle bug
Corinna Vinschen [Fri, 29 Oct 2021 12:52:58 +0000 (14:52 +0200)]
Cygwin: drop Vista WOW64 specific child process handle bug

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: bump DLL major version cygwin-3.4.0-dev
Corinna Vinschen [Thu, 28 Oct 2021 20:29:42 +0000 (22:29 +0200)]
Cygwin: bump DLL major version

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: bump DLL minor version
Corinna Vinschen [Thu, 28 Oct 2021 11:41:19 +0000 (13:41 +0200)]
Cygwin: bump DLL minor version

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoUnconditionally declare strsignal cygwin-3_3_0-release
Christian Biesinger via Newlib [Wed, 27 Oct 2021 16:41:22 +0000 (12:41 -0400)]
Unconditionally declare strsignal

Currently, newlib does not declare strsignal if DEFS_H is defined,
ostensibly to work around a gdb bug. However, gdb itself compiles
even with this ifndef removed, and this makes sim (another part of
gdb) fail to compile.

Since it is not clear exactly what issue this was working around,
this patch just replaces that ifdef with the correct check,
i.e. __POSIX_VISIBLE >= 200809.

2 years agolibgloss/riscv: Fix hard coded reference to configure.in after rename
Lewis Revill [Wed, 27 Oct 2021 13:24:06 +0000 (14:24 +0100)]
libgloss/riscv: Fix hard coded reference to configure.in after rename

The file configure.in was renamed to configure.ac in libgloss/riscv but
the hard coded name in the Makefile for that directory was not updated.
This patch simply renamed this to configure.ac.

2 years agoCygwin: convert malloc lock to SRWLOCK
Corinna Vinschen [Tue, 26 Oct 2021 15:53:08 +0000 (17:53 +0200)]
Cygwin: convert malloc lock to SRWLOCK

Per https://cygwin.com/pipermail/cygwin-developers/2021-October/012429.html,
we may encounter a crash when starting multiple threads during process
startup (here: fhandler_fifo::fixup_after_{fork,exec}) which in turn
allocate memory via malloc.

The problem is concurrent usage of malloc before the malloc muto has
been initialized.

To fix this issue, convert the muto to a SRWLOCK and make sure it is
statically initalized.  Thus, malloc can be called as early as necessary
and malloc_init is only required to check for user space provided malloc.

Note that this requires to implement a __malloc_trylock macro to be
called from fork.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: Make native clipboard layout same for 32- and 64-bit
Mark Geisert [Mon, 25 Oct 2021 09:25:40 +0000 (02:25 -0700)]
Cygwin: Make native clipboard layout same for 32- and 64-bit

This patch unifies the layout of the clipboard descriptor cygcb_t for
32- and 64-bit Cygwin.  It allows correct copy/paste between the two
environments without corruption of user's copied data and without access
violations due to interpreting that data as a size field.

The definitions of CYGWIN_NATIVE and cygcb_t are moved to a new include
file, sys/clipboard.h.  The include file is used by fhandler_clipboard.cc
as well as getclip.c and putclip.c in the Cygwin cygutils package.

When copy/pasting between 32- and 64-bit Cygwin environments, both must
be running version 3.3.0 or later for successful operation.

2 years agoCygwin: document sig2str and str2sig in version.h
Ken Brown [Fri, 22 Oct 2021 17:56:05 +0000 (13:56 -0400)]
Cygwin: document sig2str and str2sig in version.h

2 years agoCygwin: drop outdated -O3 optimization for malloc and sync
Corinna Vinschen [Fri, 22 Oct 2021 10:47:09 +0000 (12:47 +0200)]
Cygwin: drop outdated -O3 optimization for malloc and sync

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: update cygcheck OS information
Corinna Vinschen [Thu, 21 Oct 2021 16:33:35 +0000 (18:33 +0200)]
Cygwin: update cygcheck OS information

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: pipe: Use NtQuerySystemInformation() instead of EnumProcesses().
Takashi Yano [Tue, 19 Oct 2021 08:40:19 +0000 (17:40 +0900)]
Cygwin: pipe: Use NtQuerySystemInformation() instead of EnumProcesses().

- Using EnumProcess() breaks Windows Vista compatibility. This patch
  replaces EnumProcesses() with NtQuerySystemInformation().

Addresses:
https://cygwin.com/pipermail/cygwin-developers/2021-October/012422.html

2 years agostring: Fix buffer overrun in picolibc/newlib/libc/string/strrchr.c (#184)
Keith Packard [Mon, 11 Oct 2021 16:24:54 +0000 (09:24 -0700)]
string: Fix buffer overrun in picolibc/newlib/libc/string/strrchr.c (#184)

Reported by prodisDown:

In picolibc/newlib/libc/string/strrchr.c

if (i) { while ((s=strchr(s, i))) { last = s; s++; } } else { last = strchr(s, i); }

Value (for example 0xFFFFFF00) in if (i) can pass test and
then be typecasted to char inside strchr(). Then s++ and then
buffer overrun.

It can be fixed by preventive typecast i = (int) (char) i; or
typecasting inside expression if ((char) i).

Fixed by casting to char.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoCygwin: pty: Fix handle leak regarding attach_mutex.
Takashi Yano [Sun, 10 Oct 2021 00:49:53 +0000 (09:49 +0900)]
Cygwin: pty: Fix handle leak regarding attach_mutex.

- If the process having master pty opened is forked, attach_mutex
  fails to be closed when master is closed. This patch fixes the
  issue.

2 years agoCygwin: pty: Fix master closing error regarding attach_mutex.
Takashi Yano [Fri, 8 Oct 2021 16:28:54 +0000 (01:28 +0900)]
Cygwin: pty: Fix master closing error regarding attach_mutex.

- If two or more pty masters are opened in a process, closing master
  causes error when closing attach_mutex. This patch fixes the issue.

Addresses:
https://cygwin.com/pipermail/cygwin-developers/2021-October/012418.html

2 years agosys/tree.h: Red child with black sibling rotations
Sebastian Huber [Tue, 5 Oct 2021 13:53:47 +0000 (15:53 +0200)]
sys/tree.h: Red child with black sibling rotations

Add specialized rotations RB_RED_ROTATE_LEFT() and RB_RED_ROTATE_RIGHT() which
may be used if we rotate a red child which has a black sibling.  Such a red
node must have at least two child nodes so that the following red-black tree
invariant is fulfilled:

  Every path from a given node to any of its descendant NULL nodes goes through
  the same number of black nodes.

      PARENT
     /      \
  BLACK     RED
           /   \
        BLACK BLACK

2 years agosys/tree.h: Add parent rotations
Sebastian Huber [Tue, 5 Oct 2021 13:43:34 +0000 (15:43 +0200)]
sys/tree.h: Add parent rotations

Add specialized rotations RB_PARENT_ROTATE_LEFT() and RB_PARENT_ROTATE_RIGHT()
which may be used if the parent node exists and the direction of the child is
known.  The specialized rotations are derived from RB_ROTATE_LEFT() and
RB_ROTATE_RIGHT() where the RB_SWAP_CHILD() was replaced by a simple
assignment.

2 years agosys/tree.h: Simplify chain of conditions
Sebastian Huber [Tue, 5 Oct 2021 13:39:10 +0000 (15:39 +0200)]
sys/tree.h: Simplify chain of conditions

In RB_GENERATE_REMOVE_COLOR() simplify a chain of conditions of the following
pattern

if (x) {
  ...
} else if (!x) {
  ...
}

to

if (x) {
  ...
} else {
  ...
}

2 years agosys/tree.h: Simplify loop condition
Sebastian Huber [Tue, 5 Oct 2021 13:31:22 +0000 (15:31 +0200)]
sys/tree.h: Simplify loop condition

We have

  #define RB_ISRED(elm, field) \
    ((elm) != NULL && RB_COLOR(elm, field) == RB_RED)

So, the RB_ISRED() contains an implicit check for NULL.  In
RB_GENERATE_REMOVE_COLOR() the "elm" pointer cannot be NULL in the while
condition.  Use RB_COLOR(elm) == RB_BLACK instead.

2 years agoCygwin: pipe: Use ProcessHandleInformation if available.
Takashi Yano [Thu, 23 Sep 2021 14:33:55 +0000 (23:33 +0900)]
Cygwin: pipe: Use ProcessHandleInformation if available.

- The commit b531d6b0 introduced temporary_query_hdl() which uses
  SystemHandleInformation. With this patch, ProcessHandleInformation
  rather than SystemHandleInformation is used if it is available.
  This request is faster, however, is only available since Windows 8,
  therefore, SystemHandleInformation is used for Windows Vista and 7
  as before.

2 years agoCygwin: pipe: Introduce temporary query_hdl.
Takashi Yano [Mon, 20 Sep 2021 23:02:43 +0000 (08:02 +0900)]
Cygwin: pipe: Introduce temporary query_hdl.

- The commit f79a4611 introduced query_hdl, which is the read pipe
  handle kept in the write pipe instance in order to determine if
  the pipe is ready to write in select().  This implementation has
  a potential risk that the write side fails to detect the closure
  of the read side if more than one writer exists and one of them
  is a non-cygwin process.

  With this patch, the strategy of commit f79a4611 is used only if
  the process is running as a service.  For a normal process,
  instead of keeping query_hdl in the write pipe instance, it is
  retrieved temporarily when select() is called.  Actually, we
  want to use tenporary query_hdl for all processes, however, it
  does not work for service processes due to OpenProcess()
  failure.

2 years agoCygwin: pipes: remove unnecessary NULL checks for hdl_cnt_mtx
Ken Brown [Sat, 18 Sep 2021 13:25:20 +0000 (09:25 -0400)]
Cygwin: pipes: remove unnecessary NULL checks for hdl_cnt_mtx

In view of the previous changes to open_setup, we can always assume
that hdl_cnt_mtx is non-NULL.

2 years agoCygwin: make callers of open_setup check for failure
Ken Brown [Sat, 18 Sep 2021 13:10:23 +0000 (09:10 -0400)]
Cygwin: make callers of open_setup check for failure

open_setup is called by dtable::init_std_file_from_handle and
fhandler_base::open_with_arch.  In both cases, failure of open_setup
is now a fatal error.

Currently this can only happen in the following situation: A Cygwin
process is started by a non-Cygwin process, one of the standard IO
handles is a pipe handle, and Cygwin is unable to create a required
mutex (read_mtx or hdl_cnt_mtx).

2 years agoCygwin: fhandler_pipe::open_setup: fail on error creating mutexes
Ken Brown [Sat, 18 Sep 2021 12:34:04 +0000 (08:34 -0400)]
Cygwin: fhandler_pipe::open_setup: fail on error creating mutexes

2 years agoCygwin: allow open_setup to fail
Ken Brown [Sat, 18 Sep 2021 12:13:55 +0000 (08:13 -0400)]
Cygwin: allow open_setup to fail

Convert fhandler_base::open_setup to a (virtual) method that returns a
bool result.  For the moment, it and its overrides always return true.

2 years agoCygwin: statically link the tools in winsup/utils/mingw
Ken Brown [Sat, 18 Sep 2021 01:38:07 +0000 (21:38 -0400)]
Cygwin: statically link the tools in winsup/utils/mingw

This fixes the problem reported here:

  https://cygwin.com/pipermail/cygwin-developers/2021-September/012375.html

2 years agoCygwin: fix typos in release notes
Ken Brown [Fri, 17 Sep 2021 20:16:14 +0000 (16:16 -0400)]
Cygwin: fix typos in release notes

2 years agoCygwin: pipe, fifo: Move query_hdl and hdl_cnt_mtx to fhandler_pipe.
Takashi Yano [Thu, 16 Sep 2021 19:23:12 +0000 (04:23 +0900)]
Cygwin: pipe, fifo: Move query_hdl and hdl_cnt_mtx to fhandler_pipe.

- query_hdl and hdl_cnt_mtx are moved from fhandler_pipe_fifo to
  fhandler_pipe. Then reader_closed() is changed to virtual and
  overridden in fhandler_pipe.

2 years agoCygwin: pipe: Fix race issue regarding handle count.
Takashi Yano [Thu, 16 Sep 2021 14:21:57 +0000 (23:21 +0900)]
Cygwin: pipe: Fix race issue regarding handle count.

- This patch fixes the race issue in the handle counting to detect
  closure of read pipe, which is introduced by commit f79a4611.
  A mutex hdl_cnt_mtx is introduced for this issue.

2 years agoCygwin: pipe: Fix error handling in fhandler_pip::create().
Takashi Yano [Thu, 16 Sep 2021 14:15:17 +0000 (23:15 +0900)]
Cygwin: pipe: Fix error handling in fhandler_pip::create().

- Currently, error handling in fhandler_pipe::create() is broken.
  This patch fixes that.

2 years agoCygwin: close_all_files: Do not duplicate stderr for write pipe.
Takashi Yano [Thu, 16 Sep 2021 11:50:54 +0000 (20:50 +0900)]
Cygwin: close_all_files: Do not duplicate stderr for write pipe.

- Currently, the stderr handle is duplicated in close_all_files().
  This interferes the handle counting for detecting closure of read
  pipe, which is introduced by commit f79a4611. This patch stops
  duplicating stderr handle if it is write pipe.

2 years agoCygwin: select: check for negative return from pipe_data_available
Ken Brown [Wed, 15 Sep 2021 16:56:34 +0000 (12:56 -0400)]
Cygwin: select: check for negative return from pipe_data_available

Make sure except_ready is set (if except_selected) on a negative
return from pipe_data_available.

2 years agonewlib: sig2str: use __restrict
Mike Frysinger [Wed, 15 Sep 2021 05:04:14 +0000 (01:04 -0400)]
newlib: sig2str: use __restrict

This matches the header prototype style and most of newlib, and fixes
building with older versions of gcc which only accept the __ form.

2 years agolibgloss: add missing aclocal.m4 files
Mike Frysinger [Wed, 15 Sep 2021 04:27:13 +0000 (00:27 -0400)]
libgloss: add missing aclocal.m4 files

These subdirs were missing aclocal.m4 files pulling in macros from
../acinclude.m4 which caused some macros to not be expanded.  For
example, autoconf complains:

configure.ac:25: error: possibly undefined macro: LIB_AC_PROG_CC
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.

These were generated with aclocal-1.9 as that seems to be what was
used in these dirs previously, and with whatever version of autoconf
the specific subdir was using.  This should minimize diffs.

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