aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-02-20Cygwin: add more UTF-32 helper functionsCorinna Vinschen2-0/+63
wcintowcs: convert UTF-16 to UTF-32 string wcilen: return number of characters in a UTF-32 string wcincmp: compare two fixed-size UTF-32 strings Used in followup patches introducing collating symbols Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-20Cygwin: glob: sort in current locale's collating orderCorinna Vinschen1-1/+1
Follow glibc here. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-20newlib/libc/{ctype, string}/*.t: Unicode 15 character width and property tablesBrian Inglis3-58/+91
2023-02-20newlib/libc/ctype/mkcaseconv: fix POSIX shell invalid == comparisonBrian Inglis1-1/+1
2023-02-19Cygwin: convert __collate_range_cmp to __wcollate_range_cmpCorinna Vinschen6-21/+16
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=179721 After FreeBSD eventually picked up the bugreport from within only 5 years, rename __collate_range_cmp to __wcollate_range_cmp as suggested all along, and make it type safe (wint_t instead of wchar_t for hopefully obvious reasons...) While at it, drop __collate_load_error and fix the checks for it in glob and fnmatch. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-18Cygwin: is_unicode_equiv: fix normalizationCorinna Vinschen1-7/+9
Change normalization to form KD and make room for longer decomposed sequences.
2023-02-16Cygwin: is_unicode_equiv: fix commentCorinna Vinschen1-1/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-16Cygwin: dsp: Fix SNDCTL_DSP_GET[IO]SPACE before read()/write().Takashi Yano1-10/+22
Even with the commit 3a4c740f59c0, SNDCTL_DSP_GET[IO]SPACE ioctl() does not return the fragment set by SNDCTL_DSP_SETFRAGMENT if it is issued before read()/write(). This patch fixes the issue. Fixes: 3a4c740f59c0 ("Cygwin: dsp: Implement SNDCTL_DSP_SETFRAGMENT ioctl().") Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-02-15add glob/fnmatch equivalence class support to release notesCorinna Vinschen2-4/+5
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-15Cygwin: glob: handle equivalence class expressionsCorinna Vinschen1-11/+31
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>
2023-02-15Cygwin: fnmatch: handle equivalence class expressionsCorinna Vinschen1-2/+11
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>
2023-02-15Cygwin: is_unicode_equiv: implement Unicode equivalence class checkCorinna Vinschen2-0/+50
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>
2023-02-15Cygwin: Makefile.am: fix rule to create version from git describeCorinna Vinschen1-1/+2
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-15Cygwin: add glob/fnmatch named class support to release notesCorinna Vinschen2-0/+8
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-15Cygwin: glob: handle named character classesCorinna Vinschen1-10/+73
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>
2023-02-14Cygwin: fnmatch: handle named character classesCorinna Vinschen1-0/+23
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>
2023-02-14Cygwin: mbrtowi: fix return typeCorinna Vinschen2-2/+2
bad typo: change wint_t to size_t Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-14Cygwin: dumper: also link with libzstd, as libbfd may require itJon Turney5-10/+11
Also allow that linkage to be dynamic, as libzstd-devel doesn't currently provide a static library.
2023-02-14Cygwin: regex: convert wchar_t to wint_tCorinna Vinschen2-39/+8
- 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>
2023-02-14Cygwin: glob: convert wchar_t to wint_tCorinna Vinschen1-8/+8
...thus handling all Unicode values sanely. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-14Cygwin: fnmatch: convert wchar_t to wint_tCorinna Vinschen1-11/+11
...thus handling all Unicode values sanely. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-14Cygwin: __collate_range_cmp: handle Unicode values >= 0x10000Corinna Vinschen1-2/+14
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>
2023-02-14Cygwin: mbrtowi: define replacement for mbrtowc, returning UTF-32 valueCorinna Vinschen2-0/+36
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>
2023-02-12Cygwin: socket.h: define missing IPTOS_LOWCOST/IPTOS_MINCOSTCorinna Vinschen1-0/+2
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-11Cygwin: cygcheck: fix default info selector evaluationCorinna Vinschen1-1/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-11Cygwin: cygcheck: fix dependency searchCorinna Vinschen1-6/+18
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>
2023-02-09Cygwin: get_posix_access: Make mode_t parameter mandatoryCorinna Vinschen8-36/+31
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>
2023-02-09Cygwin: chmod: don't drop default ACEs from directory ACLsCorinna Vinschen2-1/+5
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>
2023-02-09Cygwin: mkdir: use correct default permissions filtered by umaskCorinna Vinschen2-3/+8
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>
2023-02-09Cygwin: cygcheck: improve OS outputCorinna Vinschen1-10/+14
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-08Cygwin: cygcheck: add dependency outputCorinna Vinschen2-52/+153
-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>
2023-02-08Cygwin: cygcheck: print categories in --info outputCorinna Vinschen1-0/+2
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-07Cygwin: cygcheck: collect build-depends infoCorinna Vinschen1-0/+12
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>
2023-02-07Cygwin: cygcheck: add latest product codesCorinna Vinschen1-7/+65
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-02-06setlocale: create LC_ALL string when changing localeCorinna Vinschen1-4/+10
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>
2023-02-03libc: arm: Implement setjmp GCC backwards compatibility.Victor L. Do Nascimento1-0/+22
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.
2023-02-01dumper: avoid linker problem when `libbfd` depends on `libsframe`Johannes Schindelin2-0/+9
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>
2023-01-31Cygwin: dsp: Implement SNDCTL_DSP_SETFRAGMENT ioctl().Takashi Yano2-39/+42
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>
2023-01-29Cygwin: cygcheck: lower setup.ini expiration time to 3 hoursCorinna Vinschen1-4/+4
...as is default for dnf Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-29Cygwin: cygcheck: find_url: fix error handlingCorinna Vinschen1-11/+27
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-29Cygwin: add new cygcheck capabilities to release notesCorinna Vinschen2-0/+10
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-29Cygwin: cygcheck: improve documentationCorinna Vinschen2-9/+87
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-29Cygwin: cygcheck: simplify output when fetching setup.iniCorinna Vinschen1-1/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-29Cygwin: cygcheck: add human readable package size outputCorinna Vinschen1-4/+33
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-29Cygwin: cygcheck: package info / available package search, take 2Corinna Vinschen3-93/+257
- 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>
2023-01-28Cygwin: cygcheck: package info / available package search, take 1Corinna Vinschen2-18/+503
cygcheck -i == dnf info <pattern...> cygcheck -e == dnf search <pattern...> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-01-27RISC-V: Fix floating-point environment support for soft floatMaciej W. Rozycki1-0/+9
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>
2023-01-26Cygwin: cygcheck: split out fetching data from cygwin.comCorinna Vinschen1-39/+45
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>
2023-01-26Cygwin: dsp: Fix hang on close() if another thread calls write().Takashi Yano2-0/+10
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>
2023-01-23Cygwin: mount: differ allowed server name chars from allowed share name charsCorinna Vinschen1-3/+16
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>