]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
2 years agolibgloss: clean up redundant shared lib warnings
Mike Frysinger [Mon, 17 Jan 2022 08:58:13 +0000 (03:58 -0500)]
libgloss: clean up redundant shared lib warnings

Use standard AC_MSG_WARN macro in the top-level configure, and delete
the message from all the subdirs.  There's no need to issue this more
than once per libgloss build.

2 years agoMerge autoconf / automake update changes from GCC.
Joseph Myers [Wed, 31 Oct 2018 17:10:56 +0000 (17:10 +0000)]
Merge autoconf / automake update changes from GCC.

Top level:
Merge from GCC:
PR bootstrap/82856
* multilib.am: New file.  From automake.

config:
Merge from GCC:
PR bootstrap/82856
* math.m4, tls.m4: Use AC_LANG_SOURCE.

zlib:
Merge from GCC.
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* Makefile.in: Regenerate.

2 years agonewlib: update to automake-1.15
Mike Frysinger [Fri, 31 Dec 2021 00:22:10 +0000 (19:22 -0500)]
newlib: update to automake-1.15

This matches what the other GNU toolchain projects have done already.
The generated diff in practice isn't terribly large.  This will allow
more use of subdir local.mk includes due to fixes & improvements that
came after the 1.11 release series.

2 years agorequire autoconf-2.69 exactly
Mike Frysinger [Thu, 30 Dec 2021 18:29:02 +0000 (13:29 -0500)]
require autoconf-2.69 exactly

The newlib & libgloss dirs are already generated using autoconf-2.69.
To avoid merging new code and/or accidental regeneration using diff
versions, leverage config/override.m4 to pin to 2.69 exactly.  This
matches what gcc/binutils/gdb are already doing.

The README file already says to use autoconf-2.69.

To accomplish this, it's just as simple as adding -I flags to the
top-level config/ dir when running aclocal.  This is because the
override.m4 file overrides AC_INIT to first require the specific
autoconf version before calling the real AC_INIT.

2 years agoCygwin: pty: Fix race issue between closing and opening master.
Takashi Yano [Fri, 14 Jan 2022 10:35:12 +0000 (19:35 +0900)]
Cygwin: pty: Fix race issue between closing and opening master.

- If the from_master is closed before cleaning up other pipes, such
  as from_slave_nat, the same pty may be allocated and pty master may
  try to open the pipe which is not closed yet, and it will fail.
  This patch fixes the issue.

2 years agoCygwin: console: Fix potential deadlock regarding acuqiring mutex.
Takashi Yano [Thu, 13 Jan 2022 11:57:15 +0000 (20:57 +0900)]
Cygwin: console: Fix potential deadlock regarding acuqiring mutex.

- Acquiring input_mutex and attach_mutex in console code has potential
  risk of deadlock. This patch fixes the issue.

2 years agoCygwin: pty: Stop closing and recreating attach_mutex.
Takashi Yano [Thu, 13 Jan 2022 10:44:43 +0000 (19:44 +0900)]
Cygwin: pty: Stop closing and recreating attach_mutex.

- Closing attach_mutex and recreating it causes the race issue
  between pty and console codes. With this patch, attach_mutex
  is created only once in a process which opens pty, and never
  closed in order to avoid this issue.

Addresses:
  https://cygwin.com/pipermail/cygwin-developers/2021-December/012548.html

2 years agoCygwin: pty: Fix memory leak in master_fwd_thread.
Takashi Yano [Thu, 13 Jan 2022 09:18:00 +0000 (18:18 +0900)]
Cygwin: pty: Fix memory leak in master_fwd_thread.

- If master_fwd_thread is terminated by cygthread::terminate_thread(),
  the opportunity to release tmp_pathbuf is missed, resulting in a
  memory leak. This patch fixes the issue.

2 years agoCygwin: pty, console: Fix deadlock in GDB regarding mutex.
Takashi Yano [Thu, 13 Jan 2022 09:16:31 +0000 (18:16 +0900)]
Cygwin: pty, console: Fix deadlock in GDB regarding mutex.

- GDB inferior may be suspended while the inferior grabs mutex.
  This causes deadlock in terminal I/O. With this patch, timeout
  for waiting mutex is set to 0 for the debugger process when the
  process calls CreateProcess() with DEBUG_PROCESS flag to avoid
  deadlock. This may cause the race issue in GDB, however, there
  is no other way than that.

Addresses:
 https://cygwin.com/pipermail/cygwin-developers/2021-December/012542.html

2 years agoCygwin: doc: drop mention of 32-bit installer
Jon Turney [Mon, 10 Jan 2022 18:22:17 +0000 (18:22 +0000)]
Cygwin: doc: drop mention of 32-bit installer

Drop mention of 32-bit installer, since it's offically discouraged, and
planned to be dropped soon.

Adjust various references to be something more generic, like 'the Cygwin
Setup program' to accommodate this.

2 years agofhandler_proc.cc(format_proc_cpuinfo): add Linux 5.16 Gobble Gobble flags
Brian Inglis [Wed, 12 Jan 2022 06:04:31 +0000 (23:04 -0700)]
fhandler_proc.cc(format_proc_cpuinfo): add Linux 5.16 Gobble Gobble flags

0x00000007:1 Intel Advanced Matrix eXtensions:
 EAX:22 amx_bf16 Brain Float 16 dot product
 EAX:24 amx_tile Tile matrix multiply
 EAX:25 amx_int8 Int 8 byte dot product
0x80000008:0 AMD EBX:27 cppc      Collaborative Processor Performance Control

2 years agolibtool.m4: fix nm BSD flag detection
Nick Alcock [Mon, 27 Sep 2021 19:31:21 +0000 (20:31 +0100)]
libtool.m4: fix nm BSD flag detection

Libtool needs to get BSD-format (or MS-format) output out of the system
nm, so that it can scan generated object files for symbol names for
-export-symbols-regex support.  Some nms need specific flags to turn on
BSD-formatted output, so libtool checks for this in its AC_PATH_NM.
Unfortunately the code to do this has a pair of interlocking flaws:

 - it runs the test by doing an nm of /dev/null.  Some platforms
   reasonably refuse to do an nm on a device file, but before now this
   has only been worked around by assuming that the error message has a
   specific textual form emitted by Tru64 nm, and that getting this
   error means this is Tru64 nm and that nm -B would work to produce
   BSD-format output, even though the test never actually got anything
   but an error message out of nm -B.  This is fixable by nm'ing *nm
   itself* (since we necessarily have a path to it).

 - the test is entirely skipped if NM is set in the environment, on the
   grounds that the user has overridden the test: but the user cannot
   reasonably be expected to know that libtool wants not only nm but
   also flags forcing BSD-format output.  Worse yet, one such "user" is
   the top-level Cygnus configure script, which neither tests for
   nor specifies any BSD-format flags.  So platforms needing BSD-format
   flags always fail to set them when run in a Cygnus tree, breaking
   -export-symbols-regex on such platforms.  Libtool also needs to
   augment $LD on some platforms, but this is done unconditionally,
   augmenting whatever the user specified: the nm check should do the
   same.

   One wrinkle: if the user has overridden $NM, a path might have been
   provided: so we use the user-specified path if there was one, and
   otherwise do the path search as usual.  (If the nm specified doesn't
   work, this might lead to a few extra pointless path searches -- but
   the test is going to fail anyway, so that's not a problem.)

(Tested with NM unset, and set to nm, /usr/bin/nm, my-nm where my-nm is a
symlink to /usr/bin/nm on the PATH, and /not-on-the-path/my-nm where
*that* is a symlink to /usr/bin/nm.)

ChangeLog
2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

PR libctf/27967
* libtool.m4 (LT_PATH_NM): Try BSDization flags with a user-provided
NM, if there is one.  Run nm on itself, not on /dev/null, to avoid
errors from nms that refuse to work on non-regular files.  Remove
other workarounds for this problem.  Strip out blank lines from the
nm output.

2 years agolibtool.m4: augment symcode for Solaris 11
Nick Alcock [Mon, 27 Sep 2021 19:31:21 +0000 (20:31 +0100)]
libtool.m4: augment symcode for Solaris 11

This reports common symbols like GNU nm, via a type code of 'C'.

ChangeLog
2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

PR libctf/27967
* libtool.m4 (lt_cv_sys_global_symbol_pipe): Augment symcode for
Solaris 11.

2 years agoAdd support for the haiku operating system. These are the os support patches we have...
Alexander von Gluck IV [Thu, 2 Sep 2021 11:19:14 +0000 (12:19 +0100)]
Add support for the haiku operating system. These are the os support patches we have been grooming and maintaining for quite a few years over on git.haiku-os.org. All of these architectures are working and most have been stable for quite some time.

2 years agoGCC: Check if AR works with --plugin and rc
H.J. Lu [Tue, 12 Jan 2021 00:26:39 +0000 (16:26 -0800)]
GCC: Check if AR works with --plugin and rc

AR from older binutils doesn't work with --plugin and rc:

[hjl@gnu-cfl-2 bin]$ touch foo.c
[hjl@gnu-cfl-2 bin]$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
[hjl@gnu-cfl-2 bin]$ ./ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
./ar: no operation specified
[hjl@gnu-cfl-2 bin]$ ./ar --version
GNU ar (Linux/GNU Binutils) 2.29.51.0.1.20180112
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
[hjl@gnu-cfl-2 bin]$

Check if AR works with --plugin and rc before passing --plugin to AR and
RANLIB.

PR ld/27173
* configure: Regenerated.
* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Check if AR works with
--plugin and rc before enabling --plugin.

config/

PR ld/27173
* gcc-plugin.m4 (GCC_PLUGIN_OPTION): Check if AR works with
--plugin and rc before enabling --plugin.

libiberty/

PR ld/27173
* configure: Regenerated.

zlib/

PR ld/27173
* configure: Regenerated.

2 years agoGCC: Pass --plugin to AR and RANLIB
H.J. Lu [Sat, 9 Jan 2021 14:43:11 +0000 (06:43 -0800)]
GCC: Pass --plugin to AR and RANLIB

Detect GCC LTO plugin.  Pass --plugin to AR and RANLIB to support LTO
build.

* Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@
(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
* configure.ac: Include config/gcc-plugin.m4.
AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION.
* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and
RANLIB if possible.
* Makefile.in: Regenerated.
* configure: Likewise.

config/

* gcc-plugin.m4 (GCC_PLUGIN_OPTION): New.

libiberty/

* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
(configure_deps): Depend on ../config/gcc-plugin.m4.
* aclocal.m4: Include ../config/gcc-plugin.m4.
* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
RANLIB_PLUGIN_OPTION.
* configure: Regenerated.

zlib/

* configure: Regenerated.

2 years agolibtool.m4: update GNU/Hurd test from upstream. In upstream libtool, 47a889a4ca20...
Samuel Thibault [Thu, 7 Jan 2021 16:47:36 +0000 (16:47 +0000)]
libtool.m4: update GNU/Hurd test from upstream. In upstream libtool, 47a889a4ca20 ("Improve GNU/Hurd support.") fixed detection of shlibpath_overrides_runpath, thus avoiding unnecessary relink. This backports it.

. * libtool.m4: Match gnu* along other GNU systems.

*/ChangeLog:

* configure: Re-generate.

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 agonewlib: regen aclocal.m4 after autoconf update
Mike Frysinger [Wed, 12 Jan 2022 11:53:06 +0000 (06:53 -0500)]
newlib: regen aclocal.m4 after autoconf update

The configure scripts were regenerated with 2.69 for the newlib-4.2.0
release in 484d2ebf8d825b28af47b8ee88cd845f1d2c7c6e, but the aclocal
files were not.  Do that now to avoid confusion between the two as to
which version of autoconf was used.

2 years agoposix_spawn: fix get/set uid/gid calls for 32 bit Cygwin
Corinna Vinschen [Wed, 12 Jan 2022 10:57:35 +0000 (11:57 +0100)]
posix_spawn: fix get/set uid/gid calls for 32 bit Cygwin

32 bit Cygwin still exports function calls to support old applications.
E. g., when switching from 16 to 32 bit uid/gid values, new function
like getuid32 have been added and the old getuid function still only
provides 16 bit values.  Newly built applications using getuid are
actually calling getuid32.

However, this link magic isn't performed inside Cygwin itself, so if
newlib functions call getuid, they actually call the old getuid, not
the new getuid32.  This leads to truncated uid/gid values.

https://cygwin.com/pipermail/cygwin/2022-January/250453.html reports
how this leads to problems in posix_spawn.

Fix this temporarily. i686 support will go away soon in Cygwin and the
fix can be dropped.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: Makefile: add dependency to newlib's libs
Corinna Vinschen [Wed, 12 Jan 2022 10:45:54 +0000 (11:45 +0100)]
Cygwin: Makefile: add dependency to newlib's libs

We need deps to newlib's libc.a and libm.a, otherwise changes
in newlib code don't trigger a rebuild of the Cygwin DLL.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: ACLs: ignore *_INHERIT flags in file ACLs
Corinna Vinschen [Tue, 11 Jan 2022 21:20:47 +0000 (22:20 +0100)]
Cygwin: ACLs: ignore *_INHERIT flags in file ACLs

get_posix_access() creates DEF_*_OBJ aclent_t entries from Windows ACEs
with INHERIT flags set, independent of the file type.  These flags only
make sense on directory objects, but certain Windows functions don't
check the file type and allow INHERIT ACE flags even on non-directories.

As a fix, make sure to ignore the INHERIT flags on non-directory ACLs
and don't propagate the matching DEF_*_OBJ aclent_t entries to callers.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agopowerpc/setjmp: Improve RTEMS support
Sebastian Huber [Mon, 10 Jan 2022 08:00:59 +0000 (09:00 +0100)]
powerpc/setjmp: Improve RTEMS support

For some RTEMS multilibs, the FPU and Altivec units are disabled during
interrupt handling.  Do not save and restore the corresponding registers in
this case.

2 years agolibgloss: hardcode AC_CONFIG_AUX_DIR path
Mike Frysinger [Fri, 7 Jan 2022 05:53:26 +0000 (00:53 -0500)]
libgloss: hardcode AC_CONFIG_AUX_DIR path

In order to transition to automake, we have to use hardcoded paths in
the AC_CONFIG_AUX_DIR macro call (since automake evaluates the path
itself, and doesn't expand vars), so simplify all the calls here.

2 years agoCygwin: do not build MinGW testsuite/cygrun --with-cross-bootstrap
Yaakov Selkowitz [Mon, 10 Jan 2022 03:32:56 +0000 (22:32 -0500)]
Cygwin: do not build MinGW testsuite/cygrun --with-cross-bootstrap

2 years agoFix documented argv and envp params for posix_spawn
Keith Thompson [Wed, 5 Jan 2022 21:30:16 +0000 (13:30 -0800)]
Fix documented argv and envp params for posix_spawn

2 years agolibnosys: update autoheader usage
Mike Frysinger [Fri, 7 Jan 2022 06:34:44 +0000 (01:34 -0500)]
libnosys: update autoheader usage

The use of acconfig.h templates is deprecated, so migrate away from it
by moving the description text to configure.ac.

2 years agolibgloss: wince: add ACLOCAL_AMFLAGS settings
Mike Frysinger [Fri, 7 Jan 2022 05:55:45 +0000 (00:55 -0500)]
libgloss: wince: add ACLOCAL_AMFLAGS settings

This allows autoreconf to "just work" and find the right macros.

2 years agonewlib: use .texi with libc & libm manuals
Mike Frysinger [Sun, 2 Jan 2022 01:28:37 +0000 (20:28 -0500)]
newlib: use .texi with libc & libm manuals

Newer automake warns that .texinfo extensions are discouraged in favor
of .texi, so rename the manuals to match.

2 years agonewlib: README: libgloss no longer uses '--cygnus' automake option
Jon Turney [Thu, 30 Dec 2021 12:59:39 +0000 (12:59 +0000)]
newlib: README: libgloss no longer uses '--cygnus' automake option

2 years agonewlib: fix silent build in a few subdirs
Mike Frysinger [Sun, 2 Jan 2022 01:22:32 +0000 (20:22 -0500)]
newlib: fix silent build in a few subdirs

A few subdirs have custom compile rules.  Utilize AM_V_xxx settings
so they respect the silent build option.

2 years agonewlib: migrate from INCLUDES to AM_CPPFLAGS
Mike Frysinger [Thu, 30 Dec 2021 19:26:52 +0000 (14:26 -0500)]
newlib: migrate from INCLUDES to AM_CPPFLAGS

Since automake deprecated the INCLUDES name in favor of AM_CPPFLAGS,
change all existing users over.  The generated code is the same since
the two variables have been used in the same exact places by design.

There are other cleanups to be done, but lets focus on just renaming
here so we can upgrade to a newer automake version w/out triggering
new warnings.

2 years agoupdate OpenBSD string functions
Guilherme Janczak [Fri, 31 Dec 2021 09:31:59 +0000 (09:31 +0000)]
update OpenBSD string functions

A lot of the 3rd party code in the string library is around 20 years
old and has been worked on since.
I've updated the OpenBSD functions at least.

2 years agoUpdate newlib to 4.2.0 newlib-snapshot-20211231
Jeff Johnston [Fri, 31 Dec 2021 17:46:13 +0000 (12:46 -0500)]
Update newlib to 4.2.0

2 years agonewlib: require automake-1.11.6
Mike Frysinger [Thu, 30 Dec 2021 19:03:30 +0000 (14:03 -0500)]
newlib: require automake-1.11.6

This is simply reflecting reality: all the subdirs in here are already
using automake-1.11.6, so making it a requirement will allow us to stop
suggesting we might support automake-1.9 or 1.10 (which I'm fairly sure
do not work today).

This is why only acinclude.m4 changes in this patch: the generated files
are exactly the same as the directives here are automake constraints,
not generated code logic.

2 years agoCygwin: Update CI configuration for python version change
Jon Turney [Thu, 30 Dec 2021 00:33:28 +0000 (00:33 +0000)]
Cygwin: Update CI configuration for python version change

Update the python version for python-lxml and python-ply packages.

'dblate' now depends on python39, so that will be installed and made the
default by alternatives, so make sure that these python packages are
also available for that python version.

2 years agolibgloss: wince: update to automake-1.15
Mike Frysinger [Wed, 15 Sep 2021 04:45:17 +0000 (00:45 -0400)]
libgloss: wince: update to automake-1.15

Drop the cygnus options and migrate to current versions of autotools.

2 years agonewlib: Regenerate autotools files
Jon Turney [Tue, 14 Dec 2021 23:24:24 +0000 (23:24 +0000)]
newlib: Regenerate autotools files

2 years agonewlib: Remove automake option 'cygnus'
Jon Turney [Thu, 22 Jul 2021 15:23:31 +0000 (16:23 +0100)]
newlib: Remove automake option 'cygnus'

The 'cygnus' option was removed from automake 1.13 in 2012, so the
presence of this option prevents that or a later version of automake
being used.

A check-list of the effects of '--cygnus' from the automake 1.12
documentation, and steps taken (where possible) to preserve those
effects (See also this thread [1] for discussion on that):

[1] https://lists.gnu.org/archive/html/bug-automake/2012-03/msg00048.html

1. The foreign strictness is implied.

Already present in AM_INIT_AUTOMAKE in newlib/acinclude.m4

2. The options no-installinfo, no-dependencies and no-dist are implied.

Already present in AM_INIT_AUTOMAKE in newlib/acinclude.m4

Future work: Remove no-dependencies and any explicit header dependencies,
and use automatic dependency tracking instead.  Are there explicit rules
which are now redundant to removing no-installinfo and no-dist?

3. The macro AM_MAINTAINER_MODE is required.

Already present in newlib/acinclude.m4

Note that maintainer-mode is still disabled by default.

4. Info files are always created in the build directory, and not in the
source directory.

This appears to be an error in the automake documentation describing
'--cygnus' [2]. newlib's info files are generated in the source
directory, and no special steps are needed to keep doing that.

[2] https://lists.gnu.org/archive/html/bug-automake/2012-04/msg00028.html

5. texinfo.tex is not required if a Texinfo source file is specified.
(The assumption is that the file will be supplied, but in a place that
automake cannot find.)

This effect is overriden by an explicit setting of the TEXINFO_TEX
variable (the directory part of which is fed into texi2X via the
TEXINPUTS environment variable).

6. Certain tools will be searched for in the build tree as well as in the
user's PATH. These tools are runtest, expect, makeinfo and texi2dvi.

For obscure automake reasons, this effect of '--cygnus' is not active
for makeinfo in newlib's configury.

However, there appears to be top-level configury which selects in-tree
runtest, expect and makeinfo, if present. So, if that works as it
appears, this effect is preserved. If not, this may cause problem if
anyone is building those tools in-tree.

This effect is not preserved for texi2dvi. This may cause problems if
anyone is building texinfo in-tree.

If needed, explicit checks for those tools looking in places relative to
$(top_srcdir)/../ as well as in PATH could be added.

7. The check target doesn't depend on all.

This effect is not preseved. The check target now depends on the all
target.

This concern seems somewhat academic given the current state of the
testsuite.

Also note that this doesn't touch libgloss.

2 years agonewlib: Regenerate autotools files
Jon Turney [Tue, 14 Dec 2021 22:01:26 +0000 (22:01 +0000)]
newlib: Regenerate autotools files

2 years agonewlib: Make effects of 'cygnus' explicit
Jon Turney [Tue, 14 Dec 2021 20:30:39 +0000 (20:30 +0000)]
newlib: Make effects of 'cygnus' explicit

Add all the effects of 'cygnus' for which there exists an explicit way
to request that behaviour:

* Implied foreign strictness and options no-installinfo, no-dependencies
and no-dist are added to AM_INIT_AUTOMAKE in newlib/acinclude.m4.

* macro AM_MAINTAINER_MODE is added to newlib/acinclude.m4.

* For the implied TEXINFO_TEX of '$(top_srcdir)/../texinfo/texinfo.tex',
an explicit TEXINFO_TEX is always relative to $(srcdir), so write the
same pathname in that form.

This is to prepare for the removal of the automake option '--cygnus'.

2 years agoCygwin: fhandler_pipe::get_query_hdl_per_process: avoid a crash
Ken Brown [Sun, 26 Dec 2021 21:42:26 +0000 (16:42 -0500)]
Cygwin: fhandler_pipe::get_query_hdl_per_process: avoid a crash

NtQueryInformationProcess(ProcessHandleInformation) can return
STATUS_SUCCESS with invalid handle data for certain processes
("minimal" processes on Windows 10).  This can cause a crash when
there's an attempt to access that data.  Fix that by setting
NumberOfHandles to zero before calling NtQueryInformationProcess.

Addresses: https://cygwin.com/pipermail/cygwin-patches/2021q4/011611.html

2 years agocygwin: Add cocom and patch to build prerequisites in FAQ
Jon Turney [Fri, 17 Dec 2021 19:14:27 +0000 (19:14 +0000)]
cygwin: Add cocom and patch to build prerequisites in FAQ

Add patch, and make cocom unconditional in list of build prerequisites.

Even though the products of these tools are checked in, these tools are
required when building in a fresh git checkout, presumably due to the
order in which git creates the files resulting in timestamps which
indicate that the output of rules using these tools are older than
the inputs.

Addresses: https://cygwin.com/pipermail/cygwin/2021-December/250124.html

Also drop a duplicate sentence about 'fetch sources from git'.

2 years agoCygwin: Conditionally build documentation
Jon Turney [Tue, 7 Dec 2021 14:05:34 +0000 (14:05 +0000)]
Cygwin: Conditionally build documentation

Add a configure option '--disable-doc' to disable building of the
documentation by the 'all' target.

Check for the required tools at configure time, and require them if
building documentation is enabled.

Even if building the documentation was diabled with '--disable-doc',
'make -C doc' at the top-level can still make the documentation, if the
documentation tools were found. If the tools were not found, 'missing'
is used to issue a warning about that.

Update instructions for building Cygwin appropriately.

(Building documentation remains the default to increase the chances of
noticing when building the documentation is broken.)

2 years agoCygwin: pty: Fix input switching failure.
Takashi Yano [Wed, 15 Dec 2021 03:25:58 +0000 (12:25 +0900)]
Cygwin: pty: Fix input switching failure.

- This patch fixes the failure of input switching between io_handle
  and io_handle_nat. This very rarely happens, however, input is
  wrongly switched to io_handle_nat even though the non-cygwin app
  is in the background.

2 years agoCygwin: pty: Fix conditions for input transfer again.
Takashi Yano [Tue, 14 Dec 2021 10:20:34 +0000 (19:20 +0900)]
Cygwin: pty: Fix conditions for input transfer again.

2 years agoCygwin: pty: Fix conditions for input transfer.
Takashi Yano [Tue, 14 Dec 2021 02:58:26 +0000 (11:58 +0900)]
Cygwin: pty: Fix conditions for input transfer.

- The recent commit "Cygwin: pty: Add missing input transfer when
  switch_to_pcon_in state." causes regression that rlwrap cannot
  work with cmd.exe. This patch fixes the issue.

2 years agoREADME: configure.in -> configure.ac
Jon Turney [Wed, 8 Dec 2021 15:40:59 +0000 (15:40 +0000)]
README: configure.in -> configure.ac

These files were renamed from that long deprecated name in commit
92061799.

2 years agoCygwin: Use AS_HELP_STRING for --enable-debugging
Jon Turney [Tue, 7 Dec 2021 14:48:51 +0000 (14:48 +0000)]
Cygwin: Use AS_HELP_STRING for --enable-debugging

Use AS_HELP_STRING in AC_ARG_WITH for --enable-debugging to ensure
correct formatting in 'configure --help' output.

2 years agoCygwin: pty: Fix Ctrl-C handling further for non-cygwin apps.
Takashi Yano [Mon, 13 Dec 2021 10:25:22 +0000 (19:25 +0900)]
Cygwin: pty: Fix Ctrl-C handling further for non-cygwin apps.

- The recent commit: "Cygwin: pty: Fix Ctrl-C handling for non-cygwin
  apps in background." causes the problem that cmd.exe is terminated
  by Ctrl-C even if it is running in pseudo console. This patch fixes
  the issue.

2 years agoCygwin: pipe: Restore blocking mode for cygwin process at startup. topic/pipe github/topic/pipe
Takashi Yano [Wed, 17 Nov 2021 08:08:05 +0000 (17:08 +0900)]
Cygwin: pipe: Restore blocking mode for cygwin process at startup.

- Set blocking mode properly at startup of cygwin process. This is
  needed if the cygwin process is executed from non-cygwin process.

2 years agoCygwin: Document that the pipe_byte option is now set by default
Ken Brown [Thu, 11 Nov 2021 16:01:11 +0000 (11:01 -0500)]
Cygwin: Document that the pipe_byte option is now set by default

2 years agoCygwin: fhandler_pipe::raw_read: minor code cleanup
Ken Brown [Thu, 11 Nov 2021 15:22:41 +0000 (10:22 -0500)]
Cygwin: fhandler_pipe::raw_read: minor code cleanup

Remove references to STATUS_THREAD_SIGNALED and
STATUS_THREAD_CANCELED, which can't occur any more.

2 years agoCygwin: pipe: Adopt FILE_SYNCHRONOUS_IO_NONALERT flag for read pipe.
Takashi Yano [Wed, 10 Nov 2021 12:47:09 +0000 (21:47 +0900)]
Cygwin: pipe: Adopt FILE_SYNCHRONOUS_IO_NONALERT flag for read pipe.

- With this patch, FILE_SYNCHRONOUS_IO_NONALERT flag is applied to
  the read pipe so that native C# programs work with cygwin pipe.
  To handle signals in reading pipe with this flag set, the read
  pipe itself is always set to nonblocking mode and simulates the
  blocking behaviour in raw_read().

- Default to byte mode rather than message mode in order to make
  C# programs work with cygwin pipe.

Addresses: https://cygwin.com/pipermail/cygwin/2021-March/247987.html

2 years agoCygwin: console: Fix console mode of non-cygwin apps in background.
Takashi Yano [Sun, 12 Dec 2021 12:26:57 +0000 (21:26 +0900)]
Cygwin: console: Fix console mode of non-cygwin apps in background.

- If the non-cygwin app is started in the background in console, the
  console mode is broken for the app. This patch fixes the issue.

2 years agoCygwin: pty: Fix console mode of non-cygwin apps in background.
Takashi Yano [Sun, 12 Dec 2021 12:24:15 +0000 (21:24 +0900)]
Cygwin: pty: Fix console mode of non-cygwin apps in background.

- If the non-cygwin app is started in the background in pseudo
  console, the console mode is broken for the app. This patch fixes
  the issue.

2 years agoCygwin: pty: Fix Ctrl-C handling for non-cygwin apps in background.
Takashi Yano [Sun, 12 Dec 2021 12:20:47 +0000 (21:20 +0900)]
Cygwin: pty: Fix Ctrl-C handling for non-cygwin apps in background.

- With pseudo console enabled, if the non-cygwin app is started in
  the background and put it into the foreground, the process cannot
  be stopped by Ctrl-C. This patch fixes the issue.

2 years agoCygwin: pty: Add missing input transfer when switch_to_pcon_in state.
Takashi Yano [Sat, 11 Dec 2021 13:08:25 +0000 (22:08 +0900)]
Cygwin: pty: Add missing input transfer when switch_to_pcon_in state.

- This patch fixes the bug that input is wrongly sent to io_handle_nat
  rather than io_handle when neither read() nor select() is called
  after the cygwin app is started from non-cygwin app. This happens
  only if psuedo console is disabled.

Addresses:
  https://cygwin.com/pipermail/cygwin-patches/2021q4/011587.html

2 years agoCygwin: clipboard: Make intent of the code clearer.
Takashi Yano [Wed, 8 Dec 2021 11:59:05 +0000 (20:59 +0900)]
Cygwin: clipboard: Make intent of the code clearer.

2 years agoCygwin: path: Fix path conversion of virtual drive.
Takashi Yano [Thu, 9 Dec 2021 08:15:23 +0000 (17:15 +0900)]
Cygwin: path: Fix path conversion of virtual drive.

- The last change in path.cc introduced a bug that causes an error
  when accessing a virtual drive which mounts UNC path such as
  "\\server\share\dir" rather than "\\server\share". This patch
  fixes the issue.

2 years agonewlib: Regenerate all autotools files
Jon Turney [Wed, 8 Dec 2021 16:15:33 +0000 (16:15 +0000)]
newlib: Regenerate all autotools files

Regenerate all aclocal.m4, configure and Makefile.in files.

2 years agonewlib: Enable automake silent rules
Jon Turney [Fri, 23 Jul 2021 13:57:24 +0000 (14:57 +0100)]
newlib: Enable automake silent rules

Use AM_SILENT_RULES, to enable automake silent rules (by default), if we
are using a version of automake which supports it (>=1.11).

Silent rules can be disabled by configuring with '--disable-silent-rules',
or invoking 'make V=1'.

For ease of reviewing, this patch doesn't contain configure and
Makefile.in regeneration.

Future work: There are a few compilations which are not silenced by
this, as they use custom rules.

2 years agoCygwin: Update configure.ac to use AC_CONFIG_HEADERS
Jon Turney [Tue, 7 Dec 2021 13:20:27 +0000 (13:20 +0000)]
Cygwin: Update configure.ac to use AC_CONFIG_HEADERS

This avoids warning with autoconf >= 2.70:

  configure.ac:47: warning: The macro `AC_CONFIG_HEADER' is obsolete.

AC_CONFIG_HEADERS has been supported since before autconf 2.59, the
minimum version we can be using, controlled by AC_PREREQ.

2 years agoCygwin: path: Convert UNC path prefix back to drive letter.
Takashi Yano [Wed, 8 Dec 2021 11:15:45 +0000 (20:15 +0900)]
Cygwin: path: Convert UNC path prefix back to drive letter.

- When symlink_info::check() is called with the path having drive
  letter and UNC path is mounted to the drive, the path is replaced
  with UNC path. With this patch, UNC path prefix is converted back
  to drive letter.  This fixes the issue:
  https://cygwin.com/pipermail/cygwin/2021-November/250087.html
  https://cygwin.com/pipermail/cygwin/2021-December/250103.html

2 years agoCygwin: clipboard: Fix a bug in read().
Takashi Yano [Tue, 7 Dec 2021 13:25:34 +0000 (22:25 +0900)]
Cygwin: clipboard: Fix a bug in read().

- Fix a bug in fhandler_dev_clipboard::read() that the second read
  fails with 'Bad address'.

Addresses:
  https://cygwin.com/pipermail/cygwin/2021-December/250141.html

2 years agoldtoa: Import gdtoa from OpenBSD.
Takashi Yano [Tue, 30 Nov 2021 21:11:32 +0000 (06:11 +0900)]
ldtoa: Import gdtoa from OpenBSD.

- This patch uses gdtoa imported from OpenBSD if newlib configure
  option "--enable-newlib-use-gdtoa=no" is NOT specified.  gdtoa
  provides more accurate output and faster conversion than legacy
  ldtoa, while it requires more heap memory.

2 years agofrexpl: Support smaller long double of LDBL_MANT_DIG == 53.
Takashi Yano [Thu, 2 Dec 2021 09:51:21 +0000 (18:51 +0900)]
frexpl: Support smaller long double of LDBL_MANT_DIG == 53.

- Currently, frexpl() supports only the following cases.
    1) LDBL_MANT_DIG == 64 or 113
    2) 'long double' is equivalent to 'double'
  This patch add support for LDBL_MANT_DIG == 53.

2 years agoRevert "ctype: use less short names in public header"
Corinna Vinschen [Thu, 2 Dec 2021 10:21:14 +0000 (11:21 +0100)]
Revert "ctype: use less short names in public header"

This patch fixed a problem which isn't in newlib, but in projects
incorrectly using symbols from the reserved namespace.

This reverts commit 3ba1bd0d9dbc015c14a0aaafcef042f706d1249a.

2 years agoCygwin: Fix typo in new-features.xml
Takashi Yano [Fri, 3 Dec 2021 03:15:17 +0000 (12:15 +0900)]
Cygwin: Fix typo in new-features.xml

2 years agoCygwin: errno: handle ERROR_CASE_DIFFERING_NAMES_IN_DIR
Corinna Vinschen [Thu, 2 Dec 2021 13:13:43 +0000 (14:13 +0100)]
Cygwin: errno: handle ERROR_CASE_DIFFERING_NAMES_IN_DIR

Rather than special case status code 0xc00004b3, add status and matching
error code to ntdll.h and handle it as part of the standard error mapping.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: console: Fix OSC sequence handling.
Takashi Yano [Thu, 2 Dec 2021 03:35:47 +0000 (12:35 +0900)]
Cygwin: console: Fix OSC sequence handling.

- Currently, some OSC escape sequences, such as 'OSC 110 BEL', are
  not handled correctly. This patch fixes the issue.

2 years agoModifying patch from: marian.buschsieweke@ovgu.de
Jeff Johnston [Mon, 29 Nov 2021 22:33:52 +0000 (17:33 -0500)]
Modifying patch from: marian.buschsieweke@ovgu.de

The code accessing the floating point control/status register, namely

#define __cfc1(__fcsr) __asm __volatile("cfc1 %0, $31" : "=r" (__fcsr)

does not compile with mips16. This changed the makefile to pass -mno-mips16 to avoid the following
compiler error:

mips-mti-elf fails with "Error: unrecognized opcode `cfc1 $3,$31'"

2 years agoCygwin: get/setrlimit: move RLIMIT_AS handling into static functions
Corinna Vinschen [Tue, 30 Nov 2021 11:54:03 +0000 (12:54 +0100)]
Cygwin: get/setrlimit: move RLIMIT_AS handling into static functions

To keep getrlimit/setrlimit clean, move the RLIMIT_AS code into
local static functions __set_rlimit_as and __get_rlimit_as.

Also, make adding process to the job the last step, to be able to
close and release the job resources if anything failed.  Add matching
comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: setrlimit: Add a permission check
Corinna Vinschen [Tue, 30 Nov 2021 11:48:34 +0000 (12:48 +0100)]
Cygwin: setrlimit: Add a permission check

If the incoming soft limit is less restrictive than the current
hard limit, bail out with EPERM.  Given the previous sanity check,
this implies trying to raise the hard limit.  While, theoretically,
this should be allowed for privileged processes, Windows has no
matching concept in terms of job limits

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: get_rlimit_stack: add a comment
Corinna Vinschen [Tue, 30 Nov 2021 10:40:24 +0000 (11:40 +0100)]
Cygwin: get_rlimit_stack: add a comment

...just to see what it's used for.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agostdio: Fix issue of printing "%La" format with large exp part.
Takashi Yano [Mon, 29 Nov 2021 12:56:46 +0000 (21:56 +0900)]
stdio: Fix issue of printing "%La" format with large exp part.

- Currently, printf("%La\n", 1e1000L) crashes with segv due to lack
  of frexpl() function. With this patch, frexpl() function has been
  implemented in libm to solve this issue.

Addresses: https://sourceware.org/pipermail/newlib/2021/018718.html

2 years agoCygwin: add 3.4 release messages
Corinna Vinschen [Fri, 26 Nov 2021 16:06:00 +0000 (17:06 +0100)]
Cygwin: add 3.4 release messages

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: get/setrlimit: implement RLIMIT_AS
Corinna Vinschen [Fri, 26 Nov 2021 16:01:28 +0000 (17:01 +0100)]
Cygwin: get/setrlimit: implement RLIMIT_AS

Code based on the idea implemented by the oneTBB project,
see https://github.com/oneapi-src/oneTBB

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoldtoa: Fix insufficient valid output digits for "%f" format.
Takashi Yano [Thu, 25 Nov 2021 21:47:27 +0000 (06:47 +0900)]
ldtoa: Fix insufficient valid output digits for "%f" format.

- If the number has large integer part and small fraction part is
  specified in output format, e.g. printf("%.3f", sqrt(2)*1e60);,
  valid output digits were insufficient. This patch fixes the issue.

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>
This page took 0.084846 seconds and 5 git commands to generate.