]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
18 months agoadd glob/fnmatch equivalence class support to release notes
Corinna Vinschen [Wed, 15 Feb 2023 21:37:32 +0000 (22:37 +0100)]
add glob/fnmatch equivalence class support to release notes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: glob: handle equivalence class expressions
Corinna Vinschen [Wed, 15 Feb 2023 21:34:46 +0000 (22:34 +0100)]
Cygwin: glob: handle equivalence class expressions

Handle [=x=] expressions in range brackets.  Use the new
is_unicode_equiv() function to perform the check.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: fnmatch: handle equivalence class expressions
Corinna Vinschen [Wed, 15 Feb 2023 21:31:49 +0000 (22:31 +0100)]
Cygwin: fnmatch: handle equivalence class expressions

Handle [=x=] expressions in range brackets.  Use the new
is_unicode_equiv() function to perform the check.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: is_unicode_equiv: implement Unicode equivalence class check
Corinna Vinschen [Wed, 15 Feb 2023 21:00:39 +0000 (22:00 +0100)]
Cygwin: is_unicode_equiv: implement Unicode equivalence class check

is_unicode_equiv compares two UTF-32 values and returns 1 if
both are member of the same Unicode equivalence class, 0 otherwise.

Note that this function only works with precomposed characters
per Unicode normalization form C.  It doesn't handle decomposed
characters, just like its counterpart in glibc.  I.e., equivalence
class comparison using decomposed chars won't work.  Example:

  fnmatch("[=n=]", "ñ") == 0
  fnmatch("[=ñ=]", "n") == 0

but

  fnmatch("[=n=]", "n\x0303") == 1
  fnmatch("[=n\x0303=]", "n") == 1
  fnmatch("[=n\x0303=]", "n\x0303") == 1

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: Makefile.am: fix rule to create version from git describe
Corinna Vinschen [Wed, 15 Feb 2023 14:04:16 +0000 (15:04 +0100)]
Cygwin: Makefile.am: fix rule to create version from git describe

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: add glob/fnmatch named class support to release notes
Corinna Vinschen [Wed, 15 Feb 2023 13:22:26 +0000 (14:22 +0100)]
Cygwin: add glob/fnmatch named class support to release notes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: glob: handle named character classes
Corinna Vinschen [Wed, 15 Feb 2023 13:11:45 +0000 (14:11 +0100)]
Cygwin: glob: handle named character classes

Handle [:<character-class>:] expressions in range brackets.

TODO: Collating symbols [.<collsym>'.] and Equivalence class
expressions [=<equiv-class>=] are recognized but skipped as if
they are not present at all.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: fnmatch: handle named character classes
Corinna Vinschen [Tue, 14 Feb 2023 19:22:54 +0000 (20:22 +0100)]
Cygwin: fnmatch: handle named character classes

Handle [:<character-class>:] expressions in range brackets.

TODO: Collating symbols [.<collsym>'.] and Equivalence class
expressions [=<equiv-class>=] are recognized but skipped as if
they are not present at all.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: mbrtowi: fix return type
Corinna Vinschen [Tue, 14 Feb 2023 19:18:42 +0000 (20:18 +0100)]
Cygwin: mbrtowi: fix return type

bad typo: change wint_t to size_t

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: dumper: also link with libzstd, as libbfd may require it
Jon Turney [Tue, 14 Feb 2023 13:52:39 +0000 (13:52 +0000)]
Cygwin: dumper: also link with libzstd, as libbfd may require it

Also allow that linkage to be dynamic, as libzstd-devel doesn't
currently provide a static library.

18 months agoCygwin: regex: convert wchar_t to wint_t
Corinna Vinschen [Tue, 14 Feb 2023 12:02:15 +0000 (13:02 +0100)]
Cygwin: regex: convert wchar_t to wint_t

- call mbrtowi instead of mbrtowc
- drop Cygwin-only surrogate handling from wgetnext and xmbrtowc since
  it's encapsulated in mbrtowi.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: glob: convert wchar_t to wint_t
Corinna Vinschen [Tue, 14 Feb 2023 11:48:03 +0000 (12:48 +0100)]
Cygwin: glob: convert wchar_t to wint_t

...thus handling all Unicode values sanely.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: fnmatch: convert wchar_t to wint_t
Corinna Vinschen [Tue, 14 Feb 2023 11:47:54 +0000 (12:47 +0100)]
Cygwin: fnmatch: convert wchar_t to wint_t

...thus handling all Unicode values sanely.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: __collate_range_cmp: handle Unicode values >= 0x10000
Corinna Vinschen [Tue, 14 Feb 2023 11:22:36 +0000 (12:22 +0100)]
Cygwin: __collate_range_cmp: handle Unicode values >= 0x10000

So far the input to __collate_range_cmp was handled as a wchar_t.
Change that to handle it as wint_t holding a UTF-32 value and
add creating surrogate pairs for the call to wcscoll.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: mbrtowi: define replacement for mbrtowc, returning UTF-32 value
Corinna Vinschen [Tue, 14 Feb 2023 11:20:20 +0000 (12:20 +0100)]
Cygwin: mbrtowi: define replacement for mbrtowc, returning UTF-32 value

Given how UTF-16 isn't capable to hold all Unicode chars in a single
wchar_t, we need a function returning a wint_t value representing
a UTF-32 value for comparison functions.  Fortunately the important
wide character functions like towupper/towlower, isw<class>, iswctype,
etc, already take wint_t values and newlib handles them as UTF-32.

If only we had switched wchar_t to 32 bit way back when... sigh.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: socket.h: define missing IPTOS_LOWCOST/IPTOS_MINCOST
Corinna Vinschen [Sun, 12 Feb 2023 20:42:26 +0000 (21:42 +0100)]
Cygwin: socket.h: define missing IPTOS_LOWCOST/IPTOS_MINCOST

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: fix default info selector evaluation
Corinna Vinschen [Sat, 11 Feb 2023 11:58:13 +0000 (12:58 +0100)]
Cygwin: cygcheck: fix default info selector evaluation

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: fix dependency search
Corinna Vinschen [Sat, 11 Feb 2023 11:53:34 +0000 (12:53 +0100)]
Cygwin: cygcheck: fix dependency search

Spaces are filtered out by PathMatchSpecA so they can't
be used as pattern anchors.  Overwrite all spaces with
commas and fix the search expresion accordingly.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: get_posix_access: Make mode_t parameter mandatory
Corinna Vinschen [Thu, 9 Feb 2023 20:55:18 +0000 (21:55 +0100)]
Cygwin: get_posix_access: Make mode_t parameter mandatory

Avoid the mistake fixed in the preceeding commit by passing
the mode_t argument by reference.  This also affects a couple
other functions calling get_posix_access in turn.

Fixes: bc444e5aa4ca ("Reapply POSIX ACL changes.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: chmod: don't drop default ACEs from directory ACLs
Corinna Vinschen [Thu, 9 Feb 2023 20:47:15 +0000 (21:47 +0100)]
Cygwin: chmod: don't drop default ACEs from directory ACLs

commit bc444e5aa4ca introduced a call to get_posix_access()
with a NULL pointer for the mode_t parameter because the value
is not needed later on... entirely ignoring the fact that the
mode_t bits are checked for the object being a directory.

In turn, the get_posix_access() call never checked for default
ACEs and returned only the standard ACEs.  Thus, every chmod call
on a directory dropped the default ACEs from its permissions, as
well as the default NULL deny-ACE used to store specific bits.
It got also impossible to set the sgid bit on directories.

Fixes: bc444e5aa4ca ("Reapply POSIX ACL changes.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: mkdir: use correct default permissions filtered by umask
Corinna Vinschen [Thu, 9 Feb 2023 20:25:03 +0000 (21:25 +0100)]
Cygwin: mkdir: use correct default permissions filtered by umask

Older coreutils created directories with mode bits filtered through
umask.  Newer coreutils creates directories with full permissions,
0777 by default.

This new coreutils behaviour uncovered the fact that default ACEs for
newly created directories were not filtered by umask starting with
commit bc444e5aa4ca.

Fix it by applying umask on the default ACEs.

Fixes: bc444e5aa4ca ("Reapply POSIX ACL change.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: improve OS output
Corinna Vinschen [Thu, 9 Feb 2023 13:41:12 +0000 (14:41 +0100)]
Cygwin: cygcheck: improve OS output

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: add dependency output
Corinna Vinschen [Wed, 8 Feb 2023 20:05:18 +0000 (21:05 +0100)]
Cygwin: cygcheck: add dependency output

-e --requires   search packages depending on packages given as PATTERN
-e --build-reqs search packages with build dependency matching PATTERN

-i --depends    print dependencies
-i --build-deps print build dependencies (if available)

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: print categories in --info output
Corinna Vinschen [Wed, 8 Feb 2023 19:43:15 +0000 (20:43 +0100)]
Cygwin: cygcheck: print categories in --info output

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: collect build-depends info
Corinna Vinschen [Tue, 7 Feb 2023 21:49:38 +0000 (22:49 +0100)]
Cygwin: cygcheck: collect build-depends info

TODO: implement options to print all deps, all build-deps,
all packages depending on packages matching the search string
and so on.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: add latest product codes
Corinna Vinschen [Tue, 7 Feb 2023 21:19:33 +0000 (22:19 +0100)]
Cygwin: cygcheck: add latest product codes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agosetlocale: create LC_ALL string when changing locale
Corinna Vinschen [Mon, 6 Feb 2023 10:27:44 +0000 (11:27 +0100)]
setlocale: create LC_ALL string when changing locale

This patch is for the sake of gnulib.

gnulib implements some form of a thread-safe setlocale variant
called setlocale_null_r, which is supposed to return the locale
strings in a thread-safe manner.  This only succeeds if the system's
setlocale already handles this thread-safe, otherwise gnulib adds
some locking on its own.

Newlib's setlocale always writes the global string array holding the
LC_ALL value anew on each invocation of setlocale(LC_ALL, NULL).
Since that doesn't allow to call setlocale(LC_ALL, NULL) in a
thread-safe manner, so locking in gnulib is required.

And here's the problem...

The lock is decorated as dllexport when building for Cygwin.  This
collides with the default behaviour of ld to export all symbols.
If it finds one decorated symbol, it will only export this symbol
to the DLL import lib.

Change setlocale so that it writes the global string array
holding the LC_ALL value at the time the locale gets changed.
On setlocale(LC_ALL, NULL), just return the pointer to the
global LC_ALL string array, just as in GLibc.  The burden of
doing so is negligibly for all targets, but adds thread-safety
for gnulib's setlocal_null_r() function, and gnulib can drop
the lock entirely when building for Cygwin.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agolibc: arm: Implement setjmp GCC backwards compatibility.
Victor L. Do Nascimento [Fri, 3 Feb 2023 11:15:26 +0000 (11:15 +0000)]
libc: arm: Implement setjmp GCC backwards compatibility.

When compiling Newlib for arm targets with GCC 12.1 onward, the
passing of architecture extension information to the assembler is
automatic, making the use of .fpu and .arch_extension directives
in assembly files redundant.

With older versions of GCC, however, these directives must be
hard-coded into the `arm/setjmp.S' file to allow the assembly of
instructions concerning the storage and subsequent reloading of the
floating point registers to/from the jump buffer, respectively.

This patch conditionally adds the `.fpu vfpxd' and `.arch_extension
mve' directives based on compile-time preprocessor macros concerning
GCC version and target architectural features, such that both the
assembly and linking of setjmp.S succeeds for older versions of
Newlib.

18 months agodumper: avoid linker problem when `libbfd` depends on `libsframe`
Johannes Schindelin [Wed, 1 Feb 2023 14:08:16 +0000 (15:08 +0100)]
dumper: avoid linker problem when `libbfd` depends on `libsframe`

A recent binutils version introduced `libsframe` and made it a
dependency of `libbfd`. This caused a linker problem in the MSYS2
project, and once Cygwin upgrades to that binutils version it would
cause the same problems there.

Let's preemptively detect the presence of `libsframe` and if detected,
link to it in addition to `libbfd`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
18 months agoCygwin: dsp: Implement SNDCTL_DSP_SETFRAGMENT ioctl().
Takashi Yano [Sat, 28 Jan 2023 04:07:32 +0000 (13:07 +0900)]
Cygwin: dsp: Implement SNDCTL_DSP_SETFRAGMENT ioctl().

Previously, SNDCTL_DSP_SETFRAGMENT was just a fake. In this patch,
it has been implemented to allow latency control in some apps.

Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
18 months agoCygwin: cygcheck: lower setup.ini expiration time to 3 hours
Corinna Vinschen [Sun, 29 Jan 2023 20:32:25 +0000 (21:32 +0100)]
Cygwin: cygcheck: lower setup.ini expiration time to 3 hours

...as is default for dnf

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: find_url: fix error handling
Corinna Vinschen [Sun, 29 Jan 2023 19:35:45 +0000 (20:35 +0100)]
Cygwin: cygcheck: find_url: fix error handling

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: add new cygcheck capabilities to release notes
Corinna Vinschen [Sun, 29 Jan 2023 17:40:14 +0000 (18:40 +0100)]
Cygwin: add new cygcheck capabilities to release notes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: improve documentation
Corinna Vinschen [Sun, 29 Jan 2023 16:52:13 +0000 (17:52 +0100)]
Cygwin: cygcheck: improve documentation

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: simplify output when fetching setup.ini
Corinna Vinschen [Sun, 29 Jan 2023 16:51:42 +0000 (17:51 +0100)]
Cygwin: cygcheck: simplify output when fetching setup.ini

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: add human readable package size output
Corinna Vinschen [Sun, 29 Jan 2023 16:21:28 +0000 (17:21 +0100)]
Cygwin: cygcheck: add human readable package size output

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: package info / available package search, take 2
Corinna Vinschen [Sun, 29 Jan 2023 13:13:25 +0000 (14:13 +0100)]
Cygwin: cygcheck: package info / available package search, take 2

- if the user has no perms to write to /etc/setup, don't try
  to fetch user homedir from Cygwin (crashes galore).  Use
  LOCALAPPDATA path instead.
- info is more rpm like
- print info of installed package
- added info selectors --inst, --curr, --prev, --test
- add installation date

TODO:

- Human-readable filesize
- url and license needs to be added to setup.ini yet
-

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: cygcheck: package info / available package search, take 1
Corinna Vinschen [Sat, 28 Jan 2023 13:59:39 +0000 (14:59 +0100)]
Cygwin: cygcheck: package info / available package search, take 1

cygcheck -i == dnf info <pattern...>
cygcheck -e == dnf search <pattern...>

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoRISC-V: Fix floating-point environment support for soft float
Maciej W. Rozycki [Fri, 27 Jan 2023 08:53:35 +0000 (08:53 +0000)]
RISC-V: Fix floating-point environment support for soft float

We don't have floating-point exception or non-default rounding mode
support for the RISC-V soft-float environment, `feraiseexcept' and
`fesetround' do nothing unless the `__riscv_flen' macro has been set.
Therefore following ISO C language requirements[1] only define macros
for soft float that correspond to actually supported floating-point
environment features, removing failures from GCC testing such as:

FAIL: gcc.dg/torture/fp-int-convert-timode-3.c   -O0  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c   -O0  execution test

References:

[1] "Programming languages -- C", ISO/IEC 9899:2023, working draft --
    September 3, 2022, Section 7.6 "Floating-point environment <fenv.h>"

Fixes: 7040b2de0883 ("Add RISC-V port for libm")
Signed-off-by: Maciej W. Rozycki <macro@embecosm.com>
18 months agoCygwin: cygcheck: split out fetching data from cygwin.com
Corinna Vinschen [Thu, 26 Jan 2023 18:58:24 +0000 (19:58 +0100)]
Cygwin: cygcheck: split out fetching data from cygwin.com

In preparation of new functionality, split fetching data
from cygwin.com out of the package_grep() function.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
18 months agoCygwin: dsp: Fix hang on close() if another thread calls write().
Takashi Yano [Wed, 25 Jan 2023 09:30:50 +0000 (18:30 +0900)]
Cygwin: dsp: Fix hang on close() if another thread calls write().

fhandler_dev_dsp (OSS) has a problem that waitforallsent(), which is
called from close(), falls into infinite loop if another thread calls
write() accidentally after close(). This patch fixes the issue.

Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
19 months agoCygwin: mount: differ allowed server name chars from allowed share name chars
Corinna Vinschen [Mon, 23 Jan 2023 13:01:43 +0000 (14:01 +0100)]
Cygwin: mount: differ allowed server name chars from allowed share name chars

The list of invalid chars for server names differs from the
list of invalid chars for share names.  Apart from that,
we don't allow control chars in both kinds of names.

Fixes: 6338d2f24a60 ("Cygwin: mount: allow any valid character in UNC paths")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: mount: allow any valid character in UNC paths
Corinna Vinschen [Sun, 22 Jan 2023 19:11:59 +0000 (20:11 +0100)]
Cygwin: mount: allow any valid character in UNC paths

The current code only allows server and share names to
start with ASCII chars [a-zA-Z0-9],, which is not correct.
Rather, check for a valid share character.

Fixes: 1fd5e000ace55 ("import winsup-2000-02-17 snapshot")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: fsync: Fix EINVAL for block device.
Takashi Yano [Sat, 21 Jan 2023 12:33:03 +0000 (21:33 +0900)]
Cygwin: fsync: Fix EINVAL for block device.

The commit af8a7c13b516 has a problem that fsync returns EINVAL for
block device. This patch treats block devices as a special case.
https://cygwin.com/pipermail/cygwin/2023-January/252916.html

Fixes: af8a7c13b516 ("Cygwin: fsync: Return EINVAL for special files.")
Reported-by: Yano Ray <yanorei@hotmail.co.jp>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
19 months agoCygwin: tape: tapes are character devices, not block devices
Corinna Vinschen [Sat, 21 Jan 2023 17:25:56 +0000 (18:25 +0100)]
Cygwin: tape: tapes are character devices, not block devices

Fixes: 727a81f4d93f ("* devices.h (device::exists_func): Redefine field.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoBump up newlib to 4.3.0 newlib-4.3.0
Jeff Johnston [Fri, 20 Jan 2023 21:01:54 +0000 (16:01 -0500)]
Bump up newlib to 4.3.0

19 months agonvptx: In offloading execution, map '_exit' to 'abort' [GCC PR85463]
Thomas Schwinge [Thu, 19 Jan 2023 17:24:50 +0000 (18:24 +0100)]
nvptx: In offloading execution, map '_exit' to 'abort' [GCC PR85463]

This is still not properly resolving <https://gcc.gnu.org/PR85463>
'[nvptx] "exit" in offloaded region doesn't terminate process', but is
one step into that direction, and allows for simplifying some GCC code.

19 months agonvptx: Provide stub 'getpid', 'kill', 'stat'
Thomas Schwinge [Wed, 21 Sep 2022 16:58:34 +0000 (18:58 +0200)]
nvptx: Provide stub 'getpid', 'kill', 'stat'

... as implemented for GCN in 'newlib/libc/sys/amdgcn/*' files, but (for now)
still adding to the catch-all 'newlib/libc/machine/nvptx/misc.c' file.

This is necessary for the GCC/Fortran I/O system, for example.

Co-authored-by: Andrew Stubbs <ams@codesourcery.com>
19 months agonvptx: Remove newlib ELIX level 1 restriction
Thomas Schwinge [Wed, 21 Sep 2022 16:58:34 +0000 (18:58 +0200)]
nvptx: Remove newlib ELIX level 1 restriction

Such a hard-coded ELIX level restriction is only being applied for nvptx
newlib -- but we'd actually like higher levels' functions available there,
too.  (Users continue to be able to override this via newlib 'configure',
as for every other newlib target.)

This already enables GCC test cases that currently FAIL due to
'unresolved symbol strndup' ('gcc.dg/builtin-dynamic-object-size-0.c'), or
'unresolved symbol mempcpy' ('gcc.dg/torture/pr45636.c'), for example.

Co-authored-by: Andrew Stubbs <ams@codesourcery.com>
19 months agonvptx: Don't use global constructor for SSP setup
Thomas Schwinge [Tue, 11 Oct 2022 21:34:19 +0000 (23:34 +0200)]
nvptx: Don't use global constructor for SSP setup

Given that nvptx newlib currently restricts itself to ELIX level 1, this
is not already a problem.  However, in the following we'd like to lift
that restriction, and then run into:

    [...]/newlib/libc/ssp/stack_protector.c: In function ‘__stack_chk_init’:
    [...]/newlib/libc/ssp/stack_protector.c:31:1: sorry, unimplemented: global constructors not supported on this target
       31 | }
          | ^

GCC patch "nvptx: Support global constructors/destructors via 'collect2'"
has been posted, but not yet accepted.  Until that is resolved, use the
same manual SSP setup as for GCN.

19 months agonvptx: Provide stub 'gettimeofday'
Thomas Schwinge [Tue, 17 Jan 2023 15:01:02 +0000 (16:01 +0100)]
nvptx: Provide stub 'gettimeofday'

Instead of them FAILing due to 'unresolved symbol gettimeofday', this
makes PASS a number of GCC 'gfortran.dg' test cases, for example.

19 months agoAdd amdgcn vectorized math routines to NEWS
Jeff Johnston [Thu, 19 Jan 2023 20:13:43 +0000 (15:13 -0500)]
Add amdgcn vectorized math routines to NEWS

19 months agoCOPYING.NEWLIB: Arm licence entry amendment
Victor L. Do Nascimento [Thu, 19 Jan 2023 17:17:39 +0000 (17:17 +0000)]
COPYING.NEWLIB: Arm licence entry amendment

Add relevant SPDX-License-Identifier to Arm licence entry in
COPYING.NEWLIB.

19 months agoNEWS: report arm ABI break
Victor L. Do Nascimento [Thu, 19 Jan 2023 17:19:09 +0000 (17:19 +0000)]
NEWS: report arm ABI break

Add details of ABI-conformance fix to setjmp implementation under
Major changes in newlib version 4.3.0

19 months agoNEWS: Add news items
Sebastian Huber [Thu, 19 Jan 2023 18:38:42 +0000 (19:38 +0100)]
NEWS: Add news items

19 months agoCygwin: Add 3.4.5 release message
Corinna Vinschen [Thu, 19 Jan 2023 17:33:40 +0000 (18:33 +0100)]
Cygwin: Add 3.4.5 release message

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: fix build of cygcheck and strace
Corinna Vinschen [Thu, 19 Jan 2023 17:24:15 +0000 (18:24 +0100)]
Cygwin: fix build of cygcheck and strace

adding <target>_LDFLAGS overrides AM_LDFLAGS and thus fails to
build cygcheck and strace statically.  Fix it.

Fixes: 8d318bf142f7 ("Cygwin: disable high-entropy VA for cygcheck and strace")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: dsp: Fix a problem that fcntl() does not take effect.
Takashi Yano [Thu, 19 Jan 2023 13:02:47 +0000 (22:02 +0900)]
Cygwin: dsp: Fix a problem that fcntl() does not take effect.

Previously, fhandler_dev_dsp (OSS) has a problem that fcntl() does
not take effect at all. This patch fixes the issue.

Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: fix two comments in heap.cc and memory_layout.h
Corinna Vinschen [Wed, 18 Jan 2023 19:07:54 +0000 (20:07 +0100)]
Cygwin: fix two comments in heap.cc and memory_layout.h

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: memory_init: initialize user heap here
Corinna Vinschen [Wed, 18 Jan 2023 19:07:10 +0000 (20:07 +0100)]
Cygwin: memory_init: initialize user heap here

Eventually move user heap initialization to memory_init.
The call order is not changed. Drop a now useless comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: open_shared: always bump next_address
Corinna Vinschen [Wed, 18 Jan 2023 18:59:48 +0000 (19:59 +0100)]
Cygwin: open_shared: always bump next_address

The new loop in open_shared has a subtil performance problem.
Next_address is bumped only if mapping at this address
failed.  Every subsequent call to open_shared has a high probability
having to call MapViewOfFileEx twice, because next_address is still
set to the address of the last successful mapping.

Avoid this by bumping next_address every time.

While at it, fix a comment.

Fixes: dc0fe7742b8c ("Cygwin: open_shared: try harder allocating a shared region")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoamdgcn: Add vectorized math routines
Kwok Cheung Yeung [Fri, 2 Dec 2022 20:00:11 +0000 (20:00 +0000)]
amdgcn: Add vectorized math routines

This implements a set of vectorized math routines to be used by the
compiler auto-vectorizer.  Versions for vectors with 2 lanes up to
64 lanes (in powers of 2) are provided.

These routines are based on the scalar versions of the math routines in
libm/common, libm/math and libm/mathfp.  They make extensive use of the GCC
C vector extensions and GCN-specific builtins in GCC.

19 months agoCygwin: drop fixed addresses for standard shared regions
Corinna Vinschen [Wed, 18 Jan 2023 12:16:50 +0000 (13:16 +0100)]
Cygwin: drop fixed addresses for standard shared regions

With the previous commit 9ddd48ee1b8d ("Cygwin: /proc/<PID>/maps:
print real shared region addresses"), the real addresses of
the standard shared regions (cygwin, user, myself, shared console)
are read from the printed process itself.  We don't need fixed
addresses anymore, so drop the definitions and simplify open_shared.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: /proc/<PID>/maps: print real shared region addresses
Corinna Vinschen [Tue, 17 Jan 2023 20:58:06 +0000 (21:58 +0100)]
Cygwin: /proc/<PID>/maps: print real shared region addresses

So far, the addresses printed for the shared regions of a process
were faked.  The assumption was that the shared regions are always
in the same place in all processes, so we just printed the addresses
of the current process.  This is no safe bet.  The only safe bet is
the address of the cygheap.  So keep track of the addresses in the
cygheap and read the addresses from the cygheap of the observed
processes.  Add output for the shared console.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: disable high-entropy VA for cygcheck and strace
Corinna Vinschen [Tue, 17 Jan 2023 16:43:21 +0000 (17:43 +0100)]
Cygwin: disable high-entropy VA for cygcheck and strace

It's not a good idea to enable high-entropy VA for tools loading the
Cygwin DLL dynamically.  The addresses used by HEVA tend to collide with
fixed address areas managed by Cygwin.

Fixes: 60675f1a7eb2 ("Cygwin: decouple shared mem regions from Cygwin DLL")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: open_shared: try harder allocating a shared region
Corinna Vinschen [Tue, 17 Jan 2023 09:18:51 +0000 (10:18 +0100)]
Cygwin: open_shared: try harder allocating a shared region

For fixed regions (cygwin/user/myself/shared console), try fixed
address first.  Fallback to non-fixed region.  Don't even try fixed
address if the Cygwin DLL gets dynamically loaded.

For non-fixed regions, try to allocate in a loop within the area
from SHARED_REGIONS_ADDRESS_LOW to SHARED_REGIONS_ADDRESS_HIGH.

Fixes: 60675f1a7eb2 ("Cygwin: decouple shared mem regions from Cygwin DLL")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: Move shared regions, rename PINFO... to MYSELF_REGION_ADDRESS
Corinna Vinschen [Mon, 16 Jan 2023 21:20:48 +0000 (22:20 +0100)]
Cygwin: Move shared regions, rename PINFO... to MYSELF_REGION_ADDRESS

Fix comments accordingly.

This is in preparation for a change in open_shared, handling shared
regions more cleanly.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: open_shared: don't reuse shared_locations parameter as output
Corinna Vinschen [Mon, 16 Jan 2023 21:25:42 +0000 (22:25 +0100)]
Cygwin: open_shared: don't reuse shared_locations parameter as output

For ages, open_shared uses the shared_locations parameter as
output to indicate if the mapping for a shared region has been
created or just opened.  Split this into two parameters.  Use
the shared_locations parameter as input only, return the creation
state of the mapping in a bool reference parameter.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: autoload: clean up arguments to LoadDllFunc*
Corinna Vinschen [Tue, 17 Jan 2023 15:28:01 +0000 (16:28 +0100)]
Cygwin: autoload: clean up arguments to LoadDllFunc*

The number of args multiplied by 4 was only required for
32 bit x86 to construct the symbol name correctly.  Drop it.

In the assembler code, split the numerical values for "notimp"
and "err" into half words for cleaner layout.

Fix description accordingly.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: /proc/cpuinfo: always print trailing empty line, as on Linux
Corinna Vinschen [Mon, 16 Jan 2023 20:40:59 +0000 (21:40 +0100)]
Cygwin: /proc/cpuinfo: always print trailing empty line, as on Linux

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: /proc/cpuinfo: Always print topology info
Corinna Vinschen [Mon, 16 Jan 2023 13:23:38 +0000 (14:23 +0100)]
Cygwin: /proc/cpuinfo: Always print topology info

vmstat from proc-ps-4.0.x prints "Unable to create system stat structure"
if the /proc/cpuinfo output fails to contain topology info.  While
Linux always prints topology info if the kernel has been built with
CONFIG_SMP, Cygwin only prints topology info if the CPU is known to
be multi-core (i. e., the HT feature flag is set).

Fix that by printing topology info all the time, even for single-core
CPUs.

Fixes: e0d48debedfa ("Fix /proc/cpuinfo topology and cache size info")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: newgrp: improve doumentation
Corinna Vinschen [Sat, 14 Jan 2023 19:13:54 +0000 (20:13 +0100)]
Cygwin: newgrp: improve doumentation

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: add newgrp(1) to release message for 3.5.0
Corinna Vinschen [Sat, 14 Jan 2023 17:00:35 +0000 (18:00 +0100)]
Cygwin: add newgrp(1) to release message for 3.5.0

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: newgrp: first full version
Corinna Vinschen [Sat, 14 Jan 2023 16:46:55 +0000 (17:46 +0100)]
Cygwin: newgrp: first full version

- add '-' option
- make group argument optional
- drop ability to take a numerical group argument
- simplify usage output to bare minimum
- Add manpage and documentation

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agolibgloss: csky: fix pointer-to-integer warning
Mike Frysinger [Fri, 13 Jan 2023 04:36:07 +0000 (23:36 -0500)]
libgloss: csky: fix pointer-to-integer warning

parameters is an array of integers, so assigning NULL (a pointer)
doesn't make sense.  Use 0 instead which produces the same code.

19 months agolibgloss: merge csky into top-level Makefile
Mike Frysinger [Fri, 13 Jan 2023 04:34:59 +0000 (23:34 -0500)]
libgloss: merge csky into top-level Makefile

Avoid a recursive make to speed things up a bit.
A csky-elf build shows installed objects & libs produce same code.

19 months agoCygwin: add very simple newgrp(1) tool
Corinna Vinschen [Fri, 13 Jan 2023 19:59:07 +0000 (20:59 +0100)]
Cygwin: add very simple newgrp(1) tool

This tool allows to change the primary group for a child process.
The new primary group MUST be part of the supplementary group list
of newgrp's user token.

The command started as child process is specified on the command line.
If it's missing, start the user's default shell with the new primary
group.

TODO: Implement '-' option.
      Add command description to documentation.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: CI: Run cygserver for tests
Jon Turney [Thu, 1 Sep 2022 13:07:26 +0000 (14:07 +0100)]
Cygwin: CI: Run cygserver for tests

Note that cygserver must be run using the same cygwin1.DLL as test
programs, as they communicate over a named pipe whose name contains the
'installation key' (which is a hash of the cygwin1.dll's path).

We run cygserver via 'cmd' to avoid the special code which handles a
cygwin parent process starting a cygwin child process, which assumes the
same version of cygwin in both.

19 months agoCygwin: testsuite: Drop appending 'ntsec' to CYGWIN in cygrun wrapper
Jon Turney [Tue, 30 Aug 2022 16:08:27 +0000 (17:08 +0100)]
Cygwin: testsuite: Drop appending 'ntsec' to CYGWIN in cygrun wrapper

Don't append 'ntsec' to the CYGWIN env var in the cygrun wrapper. It
doesn't have any effect anymore.

19 months agoCygwin: testsuite: Update pthread tests for default SCHED_FIFO
Jon Turney [Wed, 31 Aug 2022 19:48:08 +0000 (20:48 +0100)]
Cygwin: testsuite: Update pthread tests for default SCHED_FIFO

Update for default (and only) thread scheduler policy is SCHED_FIFO.

19 months agoCygwin: testsuite: Update mutex tests for changed default mutex type
Jon Turney [Wed, 31 Aug 2022 19:32:47 +0000 (20:32 +0100)]
Cygwin: testsuite: Update mutex tests for changed default mutex type

Default mutex type is PTHREAD_MUTEX_NORMAL.

Attempting to unlock an unowned mutex of that type is specified as
undefined behaviour, not returning EPERM.

mutex7e verfies that attempting to unlock an unowned mutex of type
PTHREAD_MUTEX_ERRORCHECK returns EPERM.

19 months agoCygwin: testsuite: 64-bit fixes in pthread testcases
Jon Turney [Wed, 31 Aug 2022 13:53:45 +0000 (14:53 +0100)]
Cygwin: testsuite: 64-bit fixes in pthread testcases

Fix warnings and 64-bit issues in pthread testcases.

See pthread-win32 commit 1183e5ac etc.

19 months agoCygwin: testsuite: Fix compilation warnings
Jon Turney [Tue, 30 Aug 2022 13:22:55 +0000 (14:22 +0100)]
Cygwin: testsuite: Fix compilation warnings

Fix the warnings the previous change surfaces.

See ltp commit d5c2112f for mmap fixes.

19 months agoCygwin: testsuite: Build testcases using automake
Jon Turney [Wed, 24 Aug 2022 15:01:52 +0000 (16:01 +0100)]
Cygwin: testsuite: Build testcases using automake

Build all the testcase executables directly using automake, rather than
passing the compiler information into DejaGnu to have it build them.

(This means you get build avoidance for these executables, so they only
get built once, rather than every time you run the test, and makes it
much easier to run them in isolatation against the installed Cygwin,
which is really nice to have when trying to fix broken tests...)

Rename the 'cygrun' subdirectory to 'mingw', and build all the testsuite
MinGW executables there.

Drop sample-miscompile.c (testing that compile failure is detected is
perhaps useful, but not here...)

19 months agoCygwin: testsuite: automake doesn't define objdir
Jon Turney [Mon, 29 Aug 2022 15:11:59 +0000 (16:11 +0100)]
Cygwin: testsuite: automake doesn't define objdir

objdir isn't a predefined output variable in Automake (any more?), so
this was just using the absolute path /testsuite as the test's temporary
directory.  Use builddir instead.

19 months agolibgloss: csky: use atexit to call fini-array functions.
Xianmiao Qu [Fri, 13 Jan 2023 12:46:47 +0000 (20:46 +0800)]
libgloss: csky: use atexit to call fini-array functions.

__libc_fini_array should be called upon exit to call the
global termination functions in fini-array, use atexit to
register it at __start.

19 months agolibgloss: merge nios2 into top-level Makefile
Mike Frysinger [Thu, 12 Jan 2023 02:11:59 +0000 (21:11 -0500)]
libgloss: merge nios2 into top-level Makefile

Avoid a recursive make to speed things up a bit.
A nios2-elf build shows installed objects & libs produce same code.

19 months agoCygwin: wincap.h: clarify NO_COPY_RO usage
Corinna Vinschen [Thu, 12 Jan 2023 09:51:39 +0000 (10:51 +0100)]
Cygwin: wincap.h: clarify NO_COPY_RO usage

...and drop one unnecessary usage of NO_COPY_RO.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agoCygwin: wincap: make capability flags readonly
Corinna Vinschen [Thu, 12 Jan 2023 09:33:52 +0000 (10:33 +0100)]
Cygwin: wincap: make capability flags readonly

So far the capability bits were stored in the .cygwin_dll_common
R/W section because we overwrite the is_server bit.  Just don't.
Move the bit to class wincapc instead and define all wincaps
bitfields const.

Fixes: 8937c103ed141 ("* wincap.cc (all wincaps): Store in .cygwin_dll_common section same as wincap. Add comment to explain why.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
19 months agolibgloss: merge d30v into top-level Makefile
Mike Frysinger [Wed, 14 Dec 2022 23:58:01 +0000 (18:58 -0500)]
libgloss: merge d30v into top-level Makefile

Avoid a recursive make to speed things up a bit.

19 months agolibgloss: merge arc into top-level Makefile
Mike Frysinger [Wed, 14 Dec 2022 23:54:45 +0000 (18:54 -0500)]
libgloss: merge arc into top-level Makefile

Avoid a recursive make to speed things up a bit.

19 months agolibgloss: merge arm into top-level Makefile
Mike Frysinger [Wed, 14 Dec 2022 03:27:35 +0000 (22:27 -0500)]
libgloss: merge arm into top-level Makefile

Avoid a recursive make to speed things up a bit.

19 months agolibgloss: arm: break newlib dependency
Mike Frysinger [Wed, 14 Dec 2022 08:20:32 +0000 (03:20 -0500)]
libgloss: arm: break newlib dependency

The libgloss port has been reaching back into newlib internals for a
single header whose contents have been frozen for almost a decade.
To break this backwards libgloss->newlib dependency, move the acle
header to the srcroot include/ so everyone can use the same copy.

19 months agonewlib: libc: setjmp M-profile PACBTI-enablement
Victor L. Do Nascimento [Tue, 10 Jan 2023 14:02:08 +0000 (14:02 +0000)]
newlib: libc: setjmp M-profile PACBTI-enablement

Add function prologue/epilogue to conditionally add BTI landing pads
and/or PAC code generation & authentication instructions depending on
compilation flags.  Save the PAC value in the jump buffer so that
longjmp can only return to the authenticated location.

19 months agonewlib: libc: aeabi_memset M-profile PACBTI-enablement
Victor L. Do Nascimento [Wed, 21 Dec 2022 11:28:01 +0000 (11:28 +0000)]
newlib: libc: aeabi_memset M-profile PACBTI-enablement

Add function prologue/epilogue to conditionally add BTI landing pads
and/or PAC code generation & authentication instructions depending on
compilation flags.

19 months agonewlib: libc: aeabi_memmove M-profile PACBTI-enablement
Victor L. Do Nascimento [Wed, 21 Dec 2022 11:27:01 +0000 (11:27 +0000)]
newlib: libc: aeabi_memmove M-profile PACBTI-enablement

Add function prologue/epilogue to conditionally add BTI landing pads
and/or PAC code generation & authentication instructions depending on
compilation flags.

19 months agonewlib: libc: memcpy M-profile PACBTI-enablement
Victor L. Do Nascimento [Wed, 21 Dec 2022 11:25:36 +0000 (11:25 +0000)]
newlib: libc: memcpy M-profile PACBTI-enablement

Add function prologue/epilogue to conditionally add BTI landing pads
and/or PAC code generation & authentication instructions depending on
compilation flags.

19 months agonewlib: libc: memchr M-profile PACBTI-enablement
Victor L. Do Nascimento [Wed, 21 Dec 2022 11:24:00 +0000 (11:24 +0000)]
newlib: libc: memchr M-profile PACBTI-enablement

Add function prologue/epilogue to conditionally add BTI landing pads
and/or PAC code generation & authentication instructions depending on
compilation flags.

19 months agonewlib: libc: strlen M-profile PACBTI-enablement
Victor L. Do Nascimento [Wed, 21 Dec 2022 11:22:36 +0000 (11:22 +0000)]
newlib: libc: strlen M-profile PACBTI-enablement

Add function prologue/epilogue to conditionally add BTI landing pads
and/or PAC code generation & authentication instructions depending on
compilation flags.

This patch enables PACBTI for all relevant variants of strlen:
     * Newlib for armv8.1-m.main+pacbti
     * Newlib for armv8.1-m.main+pacbti+mve
     * Newlib-nano

19 months agonewlib: libc: strcmp M-profile PACBTI-enablement
Victor L. Do Nascimento [Wed, 21 Dec 2022 11:21:22 +0000 (11:21 +0000)]
newlib: libc: strcmp M-profile PACBTI-enablement

Add function prologue/epilogue to conditionally add BTI landing pads
and/or PAC code generation & authentication instructions depending on
compilation flags.

This patch enables PACBTI for all relevant variants of strcmp:
     * Newlib for armv8.1-m.main+pacbti
     * Newlib for armv8.1-m.main+pacbti+mve
     * Newlib-nano

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