Age | Commit message (Collapse) | Author | Files | Lines |
|
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: Mahmoud Abumandour <ma.mandourr@gmail.com>
|
|
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: Mahmoud Abumandour <ma.mandourr@gmail.com>
|
|
|
|
This fixes a compile error with GCC 15.
|
|
This fixes a compile error with GCC 15.
|
|
The merged below patch modifies the __ieee754_sqrtf and __ieee754_sqrt functions to use a shared implementation, replacing the original fsqrt.d[s] instruction usage.
patch:https://sourceware.org/git/?p=newlib-cygwin.git;a=commit;h=d572c4482b473d7725be0f9380d4f5d8342e4390
Signed-off-by: Songhe Zhu <zhusonghe@eswincomputing.com>
|
|
Two new C files were added to the RISC-V build, so regenerate the
relevant configuration file.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: Eric Salem <ericsalem@gmail.com>
|
|
The RISC-V Zbb, Zbkb, and Zilsd extensions provide instructions
optimized for bit and load/store operations. Use them when available for
the RISC-V port.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: Eric Salem <ericsalem@gmail.com>
|
|
Copy stock implementations of memchr() and memrchr() to the RISC-V port.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: Eric Salem <ericsalem@gmail.com>
|
|
|
|
For architectures where XLEN is 32 bits, when detecting a null byte, a
word is read at a time. Once a null is found in the word, its precise
location is then determined. Make clear to the compiler that if the
first three bytes are not null, the last byte must be null, and does not
need to be read from the string, since its value is always zero.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: Eric Salem <ericsalem@gmail.com>
|
|
Add type posix_tnode. Change certain uses of "void" to "posix_tnode" in
both the prototypes and definitions of functions associated with <search.h>.
(Necessary changes to Cygwin's /usr/include/search.h will follow in a
separate patch to be sent to cygwin-patches.)
Reported-by: Collin Funk <collin.funk1@gmail.com>
Addresses: https://cygwin.com/pipermail/cygwin/2025-April/258032.html
Signed-off-by: Mark Geisert <mark@maxrnd.com>
Fixes: ec98d19a08c2 "* wininfo.h (wininfo::timer_active): Delete."
|
|
Avoid some deprecation warnings with recent python:
> .../newlib/doc/makedocbook.py:201: DeprecationWarning: 'count' is passed as positional argument
> .../newlib/doc/makedocbook.py:566: DeprecationWarning: 'count' is passed as positional argument
|
|
Update the macro check so that rv64e builds successfully.
Signed-off-by: Eric Salem <ericsalem@gmail.com>
|
|
For architectures where XLEN is 32 bits, when detecting a null byte, a
word is read at a time. Once a null is found in the word, its precise
location is then determined. Make clear to the compiler that if the
first three bytes are not null, the last byte must be null, and does not
need to be read from the source string, since its value is always zero.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: Eric Salem <ericsalem@gmail.com>
|
|
Replace add instructions with addi where applicable in
the size optimized versions of memmove(), memset(), memcpy(),
and strcmp(). This change does not affect the functions themselves
and is only done to improve syntactic accuracy.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
Rename local labels to improve readability.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
Swap register t1 with a3, so that the affected instructions can be compressed.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Reviewed-by: m fally <marlene.fally@gmail.com>
Signed-off-by: Eric Salem <ericsalem@gmail.com>
|
|
Replace registers t1 and t2 with registers a3 and a4 respectively,
so that the affected instructions can be compressed.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: Mahmoud Abumandour <ma.mandourr@gmail.com>
|
|
Replace lb with lbu to avoid unnecessary sign extension.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: Mahmoud Abumandour <ma.mandourr@gmail.com>
|
|
Move the instruction that increments the remaining number of
bytes to be copied inbetween the load and store instructions.
This is done in order to relax the RAW dependency between the
load and store instructions.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
Replace lb with lbu to avoid unnecessary sign extension.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
Since the algorithm in this version of memmove() is different
from the original version, add comments to give a description.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Reviewed-by: Eric Salem <ericsalem@gmail.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
Rename local lables so that the structure of the function is clearer.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
Change register t1 to register a4, so that the affected instructions
can be compressed. Since now we have less registers available, the
following changes need to be made:
In the previous version of this function, a4 was used to hold the offset
that needs to be added to source and destination addresses before copying
any data in the case of source address > destination address.
Since a4 now holds the destination address, this offset is not calculated
anymore. Instead, the value in a2 (the number of bytes to be copied) is added
to the source and destination addresses. Therefore, in the case of
source address > destination adress, a value of 1 needs to be subtracted
from both addresses before starting the copying process.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
Replace register t2 with register a5, so that lb/sb instructions can be compressed.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: m fally <marlene.fally@gmail.com>
|
|
Addresses: https://sourceware.org/pipermail/cygwin-patches/2025q2/013644.html
Fixes: 3e8a7eb1a868 ("sys/unistd.h: fix definition of setproctitle_init")
Reported-by: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca>
Co-authored-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
|
|
The sys/asm.h header file is included for certain assembly files, so
move the typedef to a separate header file due to the build breaking on
some systems. Also include the port's string header file (and move and
rename) instead of the system's version.
Addresses: https://sourceware.org/pipermail/newlib/2025/021591.html
Fixes: c3b9bb173c8c ("newlib: riscv: Add XLEN typedef and clean up types")
Reported-by: Jeff Law <jlaw@ventanamicro.com>
Suggested-by: Kito Cheng <kito.cheng@gmail.com>
Signed-off-by: Eric Salem <ericsalem@gmail.com>
|
|
The large code model assume the data may far away from the code, so we
must put the address of the target data wihin the `.text` section,
normally we will just put within the function or nearby the function to
prevent it out-of-range.
Report from riscv-gnu-toolchain:
https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1699
Verified with riscv-gnu-toolchain with rv64gc.
|
|
Since January, GCC has been miscompiling Newlib libm on AMD GCN due to
undefined behaviour in the RESIZE_VECTOR macro. It was "working" but expanding
the size of a vector would no longer zero the additional lanes, as it expected.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119325
|
|
Following the changes from Austin Group bug
https://www.austingroupbugs.net/view.php?id=1741, getlocalename_l()
now allows to specify LC_ALL and returns a setlocale-conmpatible
LC_ALL locale string.
Consequentially we have to raise the size of _reent::_getlocalename_l_buf
so there's enough space for the LC_ALL locale string.
Guard all different definitions and usages of _getlocalename_l_buf
in reent.h with _MB_CAPABLE.
Link: https://www.austingroupbugs.net/view.php?id=1741
Fixes: 71511d4ac868 ("getlocalename_l: implement per SUS Base Specifications Issue 8 draft")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
After 71511d4ac868 ("getlocalename_l: implement per SUS Base
Specifications Issue 8 draft") the Austin Group changed the definition
of getlocalename_l() to return setlocale-compatible strings if LC_ALL
has been specified. In contrast to the former definition which
disallowed LC_ALL as category.
In preparation, add a locale_string to every locale_t, and drop
the static global_locale_string.
This in turn requires to change currentlocale() to work locale-agnostic.
Rename to __currentlocale and take two parameters, the locale object
and a target string to store the locale string. The latter is required
to allow specifiying a target string not in the current locale.
Link: https://www.austingroupbugs.net/view.php?id=1741
Fixes: 71511d4ac868 ("getlocalename_l: implement per SUS Base Specifications Issue 8 draft")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
Fix name of the defining POSIX standard.
Fixes: 71511d4ac868 ("getlocalename_l: implement per SUS Base Specifications Issue 8 draft")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
The data was written to the per-reent getlocalename buffer,
but the value wasn't returned.
Fixes: 71511d4ac868 ("getlocalename_l: implement per SUS Base Specifications Issue 8 draft")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
A new C file was added to the RISC-V build
|
|
Add implementation of stpcpy() to the RISC-V port. Also refactor shared
code between strcpy() and stpcpy() to a common function.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: Eric Salem <ericsalem@gmail.com>
|
|
The RISC-V Zbb extension provides instructions optimized for bit
operations. Use them when available for the RISC-V port.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: Eric Salem <ericsalem@gmail.com>
|
|
The size of the long data type isn't precisely defined in the C
standard, so create a new typedef that uses either uint32_t or uint64_t
based on XLEN. The fixed width types are more robust against any ABI
changes and fit the data types of the intrinsic functions. Use the new
uintxlen_t type instead of long and uintptr_t.
Reviewed-by: Christian Herber <christian.herber@oss.nxp.com>
Signed-off-by: Eric Salem <ericsalem@gmail.com>
|
|
without "_printf_float" being linked
Patch fixes wrong number of written characters being returend from 'printf'
family of functionsx when '_printf_float' is not linked (nano.specs). If user
tries to print a floating point number anyway, returned number of written
characters is not correct. For example in
printf("%d%f", 1, 1.0);
should return 1, but actaully returns 2.
|
|
sigaction() returns EINVAL on SIGKILL & SIGSTOP. We need to skip them.
Fixes: c7c1a1ca1b33 ("* libc/posix/posix_spawn.c: New file.")
|
|
setproctitle_init is defined in c2x manner, omitting names for
the unused parameters. This can result in warnings or errors
on certain compiler versions:
clang 8:
error: parameter name omitted
clang 15:
warning: omitting the parameter name in a function definition is a C2x
extension [-Wc2x-extensions]
gcc -Wsystem-headers -pedantic -std=c17:
warning: ISO C does not support omitting parameter names in function
definitions before C2X [-Wpedantic]
Add parameters to avoid above warning and errors.
Fixes: 2e7f7b96e5f1 ("Cygwin: implement setproctitle")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
This patch fixes "integer overflow" warning in arc4random.c. It explicitly
casts REKEY_BASE macro to size_t. The existing code relies on an implicit
conversion to int and assumes that sizeof(int)=sizeof(size_t), which is
not always true.
2025-03-02 Jan Dubiec <jdx@o2.pl>
newlib/ChangeLog:
* libc/stdlib/arc4random.c (REKEY_BASE): Explicitly cast the macro
to size_t.
newlib/libc/stdlib/arc4random.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
This patch fixes a few "left shift count >= width of type
[-Wshift-count-overflow]" warnings. Before shifting a char 16 (or more)
bits left first it explicitly casts the char to uint32_t. The existing
code relies on implicit casts to int and assumes that ints are 32-bit.
This is not always true because the C standard does not require int to
be 32-bit and there are targets (e.g. H8/300) where by default int is
indeed 16-bit.
2025-03-02 Jan Dubiec <jdx@o2.pl>
newlib/ChangeLog:
* libc/stdlib/gdtoa-gdtoa.c (gdtoa): Cast to __ULong before left shift.
* libc/string/memmem.c (memmem): Cast to uint32_t before left shift.
* libc/string/strstr.c (strstr2): Ditto.
(strstr3): Ditto.
(strstr4): Ditto.
newlib/libc/stdlib/gdtoa-gdtoa.c | 2 +-
newlib/libc/string/memmem.c | 3 ++-
newlib/libc/string/strstr.c | 6 +++---
3 files changed, 6 insertions(+), 5 deletions(-)
|
|
2025-03-02 Jan Dubiec <jdx@o2.pl>
newlib/ChangeLog:
* libc/sys/h8300hms/sbrk.c: Replace the K&R definition with the
standard one.
* libc/sys/h8300hms/syscalls.c (_isatty): Ditto.
(_unlink): Ditto.
newlib/libc/sys/h8300hms/sbrk.c | 3 +--
newlib/libc/sys/h8300hms/syscalls.c | 6 ++----
2 files changed, 3 insertions(+), 6 deletions(-)
|
|
This improves compatibility with clang that does not support vfpxd and does not need these extra directives.
Change-Id: Id2027e622aef8457ac9c7e1d6715a9240ce8e3f0
|
|
This is to improve compatibility with LLVM clang: .align 0 is a special case for GCC that is not handled by clang.
Change-Id: I855939a32294c74813ecce7275a362265dbc3b1a
|
|
The strcasecmp family of functions (strcasecmp, strncasecmp,
strcasecmp_l, strncasecmp_l) call tolower on the incoming
character before comparison. tolower takes an int as parameter.
All four strcasecmp functions neglect to cast the character to
unsigned before using it as parameter to tolower. This tolower
is called with negative values if the incoming character is not
in the ASCII range. This breaks case-insensitive comparison in
other singlebyte codesets like ISO-8859-1 with native characters.
Adding casts to unsigned char when calling tolower fixes it.
Reported-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
https://pubs.opengroup.org/onlinepubs/9799919799/functions/lseek.html
Signed-off-by: Christian Franke <christian.franke@t-online.de>
|
|
- related to Bug libc/32679
|
|
- fixes Bug libc/32679
|