Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-12-17Re: Fix moxie libgloss issues with c99Jeff Law
Two libgloss issues specific to moxie-elf that show up build with GCC trunk. First, putnum.c uses "print" without a prototype. So I added one based on the function's definition in print.c. Second sim-inbyte.c uses read, which comes from unistd.h, so this adds a suitable #include.
2023-12-14Fix fr30 libgloss buildJeff Law
gcc-14 will default to c99 and as a result a fair amount of old code in newlib (particularly libgloss) is failing to build. I don't offhand know how many patches will be necessary to fix the various failures. I'll just pick them off one by one from my tree. This particular patch works around the return-mismatch problem syscalls.c for fr30. That file is a bit odd in that most functions are declared as returning an integer, but the implementations look like: > int > _read (file, ptr, len) > int file; > char * ptr; > int len; > { > asm ("ldi:8 %0, r0" :: "i" (SYS_read) : "r0"); > asm ("int #10"); > > return; > } Note the lack of a value on the "return" statement. The assumption is that the interrupt handler implementing syscalls will put the return value into the proper register, so falling off the end of the C function or returning with no value works in the expected way. It's not good code, but it probably works. Working from that assumption I decided to just use a pragma to disable the upgraded diagnostic from GCC -- essentially preserving existing behavior. This is the only fr30 specific issue that needs to be resolved and the only issue (so far) I've seen of this specific nature.
2023-12-06newlib cris: Fix compilation warnings that recent gcc treats as errorsHans-Peter Nilsson
For the newlib part, warnings are all from lack of sync between libc/machine/cris/sys/signal.h and libc/include/sys/signal.h. This commit gets them sufficiently in sync again, functionality-wise and declaration-wise. Still, nothing is declared that isn't supported at the system level (i.e. in libgloss system calls and handled by the CRIS simulator in the gdb project).
2023-12-06libgloss/cris: Make C declarations present and match themHans-Peter Nilsson
This is the libgloss part. Recently, there was a change in gcc such that implicit function declarations and type mismatches are now errors, no longer just warnings. Fix by adding and correcting declarations warned about; including the right header or adding a declaration (for "main" in lcrt0.c) and adjust to those types as necessary.
2023-12-06Cygwin: fallocate(2): fix debug outputCorinna Vinschen
Fixes: e01c50c7b0a6 ("Cygwin: introduce fallocate(2)") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-06Cygwin: fallocate(2): fix offset and length sanity checkCorinna Vinschen
- len must not be <= 0 - offset + len must not exceed off_t (max. file size) Fixes: e01c50c7b0a6 ("Cygwin: introduce fallocate(2)") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-06Cygwin: posix_fallocate(3): fix offset and length sanity checkCorinna Vinschen
- len must not be <= 0 - offset + len must not exceed off_t (max. file size) Fixes: 7636b5859062 ("* autoload.cc (NtSetInformationFile): Define.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-04pru: libm: Fix incorrect function nameDimitar Dimitrov
Upstream GCC changed -Wimplicit-function-declaration warning into an error. The build break about missing fpclassifyf function prototype exposed a bug in the PRU port of libm. The fix is to use the fpclassify macro for both double and float types. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2023-12-04RISC-V: Support long double mathKito Cheng
Long double for RISC-V is using 128 bit IEEE 754 format like Aarch64, so we reference AArch64 to support that.
2023-12-04RISC-V: Fix -Wint-conversion warningKito Cheng
Upstream GCC has change this warning into error by default, so...we need to explicitly convert the type from pointer from/to integer, generally it's unsafe, but we know what we are doing here. However it's not safe for ilp32 on RV64, but we didn't support that yet, so I think this fix is good enough now :)
2023-12-04Cygwin: fallocate(2): drop useless zeroing pointerCorinna Vinschen
The out pointer is only used if data_chunk_count is > 0, so there's no reason to set it to NULL in the error case. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-03Cygwin: CI: drop IRC notification from AppVeyor via notificoJon Turney
Drop IRC status notification from AppVeyor via notifico, as we no longer run tests there.
2023-12-03newlib: libc: Fix indentationKuan-Wei Chiu
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
2023-12-01newlib: libc: Fix memory leak in computematchjumps()Kuan-Wei Chiu
In cases where malloc fails for the 'g->matchjump' allocation, the code path does not handle the failure gracefully, potentially leading to a memory leak. This fix ensures proper cleanup by freeing the allocated memory for 'pmatches' before returning. Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
2023-12-01Cygwin: drop stray fs_info::check_ssd declarationCorinna Vinschen
This is just a leftover from development Fixes: 8b01c5d6903f ("Cygwin: fs_info: check for SSD") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: doc: add missing change to posix_spawnpCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: sparse support: enable automatic sparsifying of files on SSDsCorinna Vinschen
Given that SSDs don't have a seek penalty, we can enable automatic sparsifying of files on SSDs, even if the "sparse" mount option is not set. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: fs_info: check for SSDCorinna Vinschen
During fs_info::update, check for the file being on an SSD. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: ntdll.h: add missing NtQueryVolumeInformationFile definitionsCorinna Vinschen
In preparation of using the FileFsSectorSizeInformation info class, add a couple of missing definitions. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: ntdll.h: add missing POBJECT_NAME_INFORMATIONCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-12-01Cygwin: revert autoloading of DiscardVirtualMemoryCorinna Vinschen
Commit a3ae2a734892 ("Cygwin: don't autoload some kernel32 functions") erroneously removed DiscardVirtualMemory from the list of autloaded functions. DiscardVirtualMemory is not available on Windows 8.1. Fixes: a3ae2a734892 ("Cygwin: don't autoload some kernel32 functions") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-29Cygwin: Add '--names-only' flag to cygcheckJon Turney
Add '--names-only' flag to cygcheck, to output just the bare package names.
2023-11-29RISC-V: Fix timeval conversion in _gettimeofday()Kuan-Wei Chiu
Replace multiplication with division for microseconds calculation from nanoseconds in _gettimeofday function. Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
2023-11-28newlib: filter out versions from newlib.h to simplify autoreconfMike Frysinger
We've been manually editing newlib.hin after generating it with autoheader to drop the version defines that we keep in the separate _newlib_version.h header. This is confusing for people, and is an easy source of mistakes/errors. Since we're already running sed on newlib.h during configure to filter out defines we don't want to expose, add the version macros there too. This way we don't have to manually edit newlib.hin. This simplifies the autoreconf step in exchange for a slightly more complicated configure+sed step, but seems worth the trade-off.
2023-11-28Cygwin: fallocate(2): handle FALLOC_FL_PUNCH_HOLE and FALLOC_FL_ZERO_RANGECorinna Vinschen
Split fhandler_disk_file::fallocate into multiple methods, each implementing a different aspect of fallocate(2), thus adding FALLOC_FL_PUNCH_HOLE and FALLOC_FL_ZERO_RANGE handling. For more correctly implementing posix_fallocate(3) semantics, make sure to re-allocate holes in the given range if the file is sparse. While at it, change the way checking when to make a file sparse. The rule is now, make file sparse if the hole created by the action spans at least one sparse block, taking the allocation granularity of sparse files into account. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: pwrite(2): sparsify fileCorinna Vinschen
write(2) sparsifies a file after an lseek far enough beyond EOF. Let pwrite(2) sparsify as well if offset is far enough beyond EOF. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: fallocate(2): fix evaluating return valueCorinna Vinschen
fallocate is not supposed to return an errno code, it has to return -1 and set errno. Fixes: dd90ede40510 ("Cygwin: introduce fallocate(2)") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: open(2): reset sparseness on O_TRUNCated filesCorinna Vinschen
open(2) implements O_TRUNC by just reducing the size of the file to 0, to make sure EAs stay available. Turns out, file sparseness is not removed this way either, so add code to do just that. Fixes: 603ef545bdbd ("* fhandler.cc (fhandler_base::open): Never open files with FILE_OVERWITE/FILE_OVERWRITE_IF.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: introduce fallocate(2)Corinna Vinschen
First cut of the new, Linux-specific fallocate(2) function. Do not add any functionality yet, except of basic handling of FALLOC_FL_KEEP_SIZE. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: fcntl.h: Use cdefs.h macrosCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: fhandler: rename ftruncate method to fallocateCorinna Vinschen
also, take mode flags parameter instead of just a bool. Introduce __FALLOC_FL_TRUNCATE mode flag as internal flag to indictae being called from ftruncate(2). This is in preparation of an upcoming change introducing the Linx-specific fallocate(2) call. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-28Cygwin: posix_fallocate: return ENODEVCorinna Vinschen
The fhandler method ftruncate returns either EISDIR if it has been called on directories, or EINVAL if called on files other than regular files. This matches what ftruncate(2) is supposed to return, but it doesn't match posix_fallocate(3), which is supposed to return ENODEV in both cases. To accomplish that, return ENODEV from fhandler_base::ftruncate() and convert it to EINVAL in ftruncate(2). In posix_fallocate(3), convert EISDIR to ENODEV. Fixes: 7636b58590621 ("* autoload.cc (NtSetInformationFile): Define.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-25Cygwin: lseek: check for file sparseness, not for mount point sparsenessCorinna Vinschen
The code introducing the lseek(2) code for the GNU extensions SEEK_DATA and SEEK_HOLE accidentally checks if the mount point has the "sparse" flag set and, if not, emulates SEEK_DATA/SEEK_HOLE per the Linux specs. However, the mount point "sparse" flag only determines whether files should be made sparse or not. Files may be sparse independently of that, obviously. Fix that by checking for the FILE_ATTRIBUTE_SPARSE_FILE attribute instead. Fixes: edfa581d3c5a ("Cygwin: lseek: implement SEEK_DATA and SEEK_HOLE for files") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-24newlib: nl_langinfo: Fix a bug of time stuff.Takashi Yano
Previously, e.g. nl_langinfo(_NL_TIME_WMONTH_1) returns "February" due to the bug. Similarly, nl_langinfo(_NL_TIME_WWDAY_1) returns "Mon". This occurs because wide char month and weekday arrays are pointed off-by-one (e.g. the array wmon[12] is reffered as wmon[1-12] rather than wmon[0-11]). This patch fixes that. Fixes: d47d5b850bed ("Extend locale support to maintain wide char values of native strings") Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-11-21Cygwin: /dev/disk: Append '#N' if the same name appears more than onceChristian Franke
No longer drop ranges of identical link names. Append '#0, #1, ...' to each name instead. Enhance charset allowed in label names. No longer ignore null volume serial numbers. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-11-21aarch64: Remove duplicated optimized memmove()Sebastian Huber
The optimized aarch64/memcpy.S already provides a memmove() implementation.
2023-11-20stdio: drop unnecessary calls to ORIENTCorinna Vinschen
Now that the low-level functions set and test stream orientation, a few calls in API functions are redundant. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-20stdio: set and test stream orientation in low-level input function __srget_rCorinna Vinschen
This allows to set and test orientation correctly if input is only using macros from stdio.h. Wide-char-oriented functions must call __srefill_r directly. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-20stdio: split byte- and wide-char-oriented low-level output functionsCorinna Vinschen
Introduce function __swbufw_r and macros/inline-functions called __swputc_r. Call these functions/macros exclusively from wide-char functions. This allows to set and test the stream orientation correctly even if output is only performed using byte-oriented macros from stdio.h. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-20stdio: Fix bugs in commit 3d94e07c49b5Takashi Yano
The commit 3d94e07c49b5 has a few bugs which cause testsuite failure in libstdc++. This is due to excess orientation check in __srefill_r() and _ungetc_r(). Further, sscanf() family also calls ssvfscanf() family with fp->_file == -1. This causes undesired orientation set/check for sscanf() family. This patch fixes these problems. Also, as in GLibC, do not set orientation in ungetc, and only set, but do not check orientation in ungetwc. Fixes: 3d94e07c49b5 ("newlib: libc: Fix crash on fprintf to a wide-oriented stream.") Reported-by: Christophe Lyon <christophe.lyon@linaro.org> Reported-by: Joel Sherrill <joel@rtems.org> Co-developed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-20Cygwin: /dev/disk/by-uuid: Fix NTFS serial number print formatChristian Franke
Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-11-20Reclaim _REENT_MP_P5S in _reclaim_reentChris Johns
The _REENT_MP_P5S blocks are allocated using Balloc via i2b and linked in the pow5mult call. As a result these blocks are not on the freelist managed by the Bfree call. This change fixes a memory leak in threads that clean up using _reclaim_reent. RTEMS: Closes #4967
2023-11-17Cygwin: Document /dev/disk/by-* subdirectoriesChristian Franke
Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-11-17Cygwin: Add /dev/disk/by-label and /dev/disk/by-uuid symlinksChristian Franke
The new directories '/dev/disk/by-label' and '/dev/disk/by-uuid' provide symlinks for each disk related volume label and serial number: 'VOLUME_LABEL' -> '../../sdXN' 'VOLUME_SERIAL' -> '../../sdXN' Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-11-17__sfvwrite_r: call __sputc_r rather than putc in __SCLE caseCorinna Vinschen
__sfvwrite_r is called under lock. There's no reason to call putc, locking the file recursively. Add a comment that locking is required when calling __sfvwrite_r. Fixes: 49d64538cd20 ("* libc/include/stdio.h (FILE): define __SCLE for "convert line endings" for Cygwin.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-17v{fs}printf/v{fs}wprintf: create external output helpersCorinna Vinschen
So far, the printf family of functions has two output helper functions called __sprint_r and __sfputs_r. Both are called from all variants of vfprintf as well as vfwprintf. There are also analogue helper functions for the string-creating functions vsprintf/vswprintf called __ssprint_r and __ssputs_r. However, the helpers are built once when building vfprintf/vsprintf with the INTEGER_ONLY flag, and then they are part of the vfiprintf.c and vsiprintf.c files. The problem is this: Even if a process only calls vfwprintf or the non-INTEGER_ONLY vfprintf it will always have to include the INTEGER_ONLY vfiprintf. Otherwise the helper functions are undefined. Analogue for the string-creating functions. That's a useless waste of space by including one (or two) big, unused function, if newlib is linked in statically. Create new files to define the printf output helpers separately and split them into byte-oriented and wide-char-oriented functions. This allows to link only the required functions. Also, simplify the string output helpers and fix a potential (but unlikely) buffer overflow in __ssprint_r. Fixes: 8a0efa53e449 ("import newlib-2000-02-17 snapshot") Fixes: 6121968b198d ("* libc/include/stdio.h (__VALIST): Guard against multiple definition.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-17newlib.hin: regenerateCorinna Vinschen
The last two patches to configure.ac missed regeneration of newlib.hin. Fixes: 64a11fded15b ("Fix problem with _newlib_version.h not being filled in correctly") Fixes: 39f734a857e2 ("newlib: fix AC_DEFINE quoting style with version macros") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-17Cygwin: Add /dev/disk/by-drive and /dev/disk/by-voluuid symlinksChristian Franke
The new directory '/dev/disk/by-drive' provides symlinks for each disk related drive letter: 'x' -> '../../sdXN' The new directory '/dev/disk/by-voluuid' provides symlinks for each disk related storage volume: 'MBR_SERIAL-OFFSET' -> '../../sdXN' 'VOLUME_GUID' -> '../../sdXN' Both directories provide Windows specific information and do not exist on Linux. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2023-11-14Cygwin: rand(3): implement in terms of random(3)Corinna Vinschen
This makes rand(3) ISO C compliant and adds locking to avoid race conditions. Reported-by: Bruno Haible <bruno@clisp.org> Fixes: 8a0efa53e4491 ("import newlib-2000-02-17 snapshot") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-14Fix profiler error() definition and usageMark Geisert
Minor updates to profiler and gmondump, which share some code: - fix operation of error() so it actually works as intended - resize 4K-size auto buffer reservations to BUFSIZ (==1K) - remove trailing '\n' from 2nd arg on error() calls everywhere - provide consistent annotation of Windows error number displays Fixes: 9887fb27f6126 ("Cygwin: New tool: profiler") Fixes: 087a3d76d7335 ("Cygwin: New tool: gmondump") Signed-off-by: Mark Geisert <mark@maxrnd.com>