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
2024-01-23newlib: docs: add "Function " to every function nodeMike Frysinger
When creating a split manual with one-node-per-page, the main index.html ends up getting clobbered by the page for the index() function because it uses "@node index" which, for html, also creates an index.html page. To remedy this, add "Function " to every function node so now we output "Function-index.html" and avoid clobbering. It also namespaces every other function and helps make sure we don't clobber anything else. Otherwise, there isn't really much rendering difference as @node text is mostly internal. Node title text comes from @section instead.
2023-12-23GCN: Implement '_exit' instead of 'exit'Thomas Schwinge
... so that all of 'exit', '_exit', '_Exit' work. 'exit' thus becomes the standard 'newlib/libc/stdlib/exit.c'. (Getting 'atexit' functional needs further work elsewhere.) See also commit 5841b2f6a4208682264d03e3edfa0a09881932a6 "nvptx: Implement '_exit' instead of 'exit'".
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-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-11-21aarch64: Remove duplicated optimized memmove()Sebastian Huber
The optimized aarch64/memcpy.S already provides a memmove() implementation.
2023-10-31amdgcn: remove unnecessary scalar cache flushAndrew Stubbs
The exit code isn't actually written via the scalar cache so the cache flush is not actually needed.
2023-10-12sparc: Improve setjmp()Sebastian Huber
Flush the windows in setjmp(). This helps if the stack is changed after the setjmp() and we want to jump back to the original stack using longjmp().
2023-10-12riscv: Fix fenv.h supportSebastian Huber
Use the same C preprocessor expressions to define FE_RMODE_MASK and __RISCV_HARD_FLOAT. The problem was noticed on GCC 10 which does not define __riscv_f.
2023-10-05aarch64: Import memrchr.SSebastian Huber
Import memrchr.S for AArch64 from: https://github.com/ARM-software/optimized-routines commit 0cf84f26b6b8dcad8287fe30a4dcc1fdabd06560 Author: Sebastian Huber <sebastian.huber@embedded-brains.de> Date: Thu Jul 27 17:14:57 2023 +0200 string: Fix corrupt GNU_PROPERTY_TYPE (5) size For ELF32 the notes alignment is 4 and not 8.
2023-10-05aarch64: Sync with ARM-software/optimized-routinesSebastian Huber
Update AArch64 assembly string routines from: https://github.com/ARM-software/optimized-routines commit 0cf84f26b6b8dcad8287fe30a4dcc1fdabd06560 Author: Sebastian Huber <sebastian.huber@embedded-brains.de> Date: Thu Jul 27 17:14:57 2023 +0200 string: Fix corrupt GNU_PROPERTY_TYPE (5) size For ELF32 the notes alignment is 4 and not 8. Add license and copyright information to COPYING.NEWLIB as entry (56).
2023-08-18newlib: add Xtensa portAlexey Lapshin
2023-07-26RISC-V: Support Zfinx/Zdinx extension.Kito Cheng via Newlib
Zfinx/Zdinx are new extensions ratified in 2022, it similar to F/D extensions, support hard float operation for single/double precision, but the difference between Zfinx/Zdinx and F/D is Zfinx/Zdinx is operating under general purpose registers rather than dedicated floating-point registers. This patch improve the hard float support detection for RISC-V port, so that Zfinx/Zdinx can have better/right performance. Co-authored-by: Jesse Huang <jesse.huang@sifive.com>
2023-05-30m68k: disallow unaligned access for m68010 and m68020Remy Bohmer
Disable at least m68010 and m68020. These processors certainly do not like unaligned accesses. Signed-off-by: Remy Bohmer <linux@bohmer.net> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> Signed-off-by: Austin Morton <austinpmorton@gmail.com> Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-05-16newlib: Add non LDBL_EQ_DBL math support for aarch64, i386, and x86_64Jennifer Averett
Rename s_nearbyint.c, s_fdim.c and s_scalbln.c to remove conflicts Remove functions that are not needed from above files Modify include paths Add includes missing in cygwin build Add missing types Create Makefiles Create header files to resolve dependencies between directories Modify some instances of unsigned long to uint64_t for 32 bit platforms Add HAVE_FPMATH_H
2023-05-16newlib: Add FreeBSD files for non LDBL_EQ_DBL supportJennifer Averett
FreeBSD files to add long double support for i386, aarch64 and x86_64.
2023-02-03libc: arm: Implement setjmp GCC backwards compatibility.Victor L. Do Nascimento
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-01-27RISC-V: Fix floating-point environment support for soft floatMaciej W. Rozycki
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-19nvptx: In offloading execution, map '_exit' to 'abort' [GCC PR85463]Thomas Schwinge
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.
2023-01-19nvptx: Provide stub 'getpid', 'kill', 'stat'Thomas Schwinge
... 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>
2023-01-19nvptx: Provide stub 'gettimeofday'Thomas Schwinge
Instead of them FAILing due to 'unresolved symbol gettimeofday', this makes PASS a number of GCC 'gfortran.dg' test cases, for example.
2023-01-11libgloss: arm: break newlib dependencyMike Frysinger
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.
2023-01-10newlib: libc: setjmp M-profile PACBTI-enablementVictor L. Do Nascimento
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.
2023-01-10newlib: libc: aeabi_memset M-profile PACBTI-enablementVictor L. Do Nascimento
Add function prologue/epilogue to conditionally add BTI landing pads and/or PAC code generation & authentication instructions depending on compilation flags.
2023-01-10newlib: libc: aeabi_memmove M-profile PACBTI-enablementVictor L. Do Nascimento
Add function prologue/epilogue to conditionally add BTI landing pads and/or PAC code generation & authentication instructions depending on compilation flags.
2023-01-10newlib: libc: memcpy M-profile PACBTI-enablementVictor L. Do Nascimento
Add function prologue/epilogue to conditionally add BTI landing pads and/or PAC code generation & authentication instructions depending on compilation flags.
2023-01-10newlib: libc: memchr M-profile PACBTI-enablementVictor L. Do Nascimento
Add function prologue/epilogue to conditionally add BTI landing pads and/or PAC code generation & authentication instructions depending on compilation flags.
2023-01-10newlib: libc: strlen M-profile PACBTI-enablementVictor L. Do Nascimento
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
2023-01-10newlib: libc: strcmp M-profile PACBTI-enablementVictor L. Do Nascimento
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
2023-01-10newlib: libc: define M-profile PACBTI-enablement macrosVictor L. Do Nascimento
Augment the arm_asm.h header file to simplify function prologues and epilogues whilst adding support for PACBTI enablement via macros for hand-written assembly functions. For PACBTI, both prologues/epilogues as well as cfi-related directives are automatically amended accordingly, depending on the compile-time mbranch-protection argument values. It defines the following preprocessor macros: * HAVE_PAC_LEAF: Indicates whether pac-signing has been requested for leaf functions. * PAC_LEAF_PUSH_IP: Whether leaf functions should push the pac code to the stack irrespective of whether the ip register is clobbered in the function or not. * STACK_ALIGN_ENFORCE: Whether a dummy register should be added to the push list as necessary in the prologue to ensure stack alignment preservation at the start of assembly function. The epilogue behavior is likewise affected by this flag, ensuring any pushed dummy registers also get popped on function return. It also defines the following assembler macros: * prologue: In addition to pushing any callee-saved registers onto the stack, it generates any requested pacbti instructions. Pushed registers are specified via the optional `first', `last', `push_ip' and `push_lr' macro argument parameters. when a single register number is provided, it pushes that register. When two register numbers are provided, they specify a rage to save. If push_ip and/or push_lr are non-zero, the respective registers are also saved. Stack alignment is requested via the `align` argument, which defaults to the value of STACK_ALIGN_ENFORCE, unless manually overridden. For example: prologue push_ip=1 -> push {ip} prologue push_ip=1, align8=1 -> push {r2, ip} prologue push_ip=1, push_lr=1 -> push {ip, lr} prologue 1 -> push {r1} prologue 1, align8=1 -> push {r0, r1} prologue 1 push_ip=1 -> push {r1, ip} prologue 1 4 -> push {r1-r4} prologue 1 4 push_ip=1 -> push {r1-r4, ip} * epilogue: pops registers off the stack and emits pac key signing instruction, if requested. The `first', `last', `push_ip', `push_lr' and `align' function as per the prologue macro, generating pop instead of push instructions. Stack alignment is enforced via the following helper macro call-chain: {prologue|epilogue} ->_align8 -> _preprocess_reglist -> _preprocess_reglist1 -> {_prologue|_epilogue} Finally, the necessary cfi directives for adding debug information to prologue and epilogue are generated via the following macros: * cfisavelist - prologue macro helper function, generating necessary .cfi_offset directives associated with push instruction. Therefore, the net effect of calling `prologue 1 2 push_ip=1' is to generate the following: push {r1-r2, ip} .cfi_adjust_cfa_offset 12 .cfi_offset 143, -4 .cfi_offset 2, -8 .cfi_offset 1, -12 * cfirestorelist - epilogue macro helper function, emitting .cfi_restore instructions prior to resetting the cfa offset. As such, calling `epilogue 1 2 push_ip=1' will produce: pop {r1-r2, ip} .cfi_register 143, 12 .cfi_restore 2 .cfi_restore 1 .cfi_def_cfa_offset 0
2022-12-22nvptx: Implement '_exit' instead of 'exit'Thomas Schwinge
... so that all of 'exit', '_exit', '_Exit' work. 'exit' thus becomes the standard 'newlib/libc/stdlib/exit.c' -- and functions registered via 'atexit' are now called at return from 'main' or manual 'exit' invocation.
2022-12-22remove +x bit on source filesMike Frysinger
These should never be marked executable as they have no shebang and are pure source files.
2022-12-19libc: arm: setjmp.S code cleanupVictor L. Do Nascimento
The code for setjmp and longjmp contains unconditionally-disabled legacy FPA code. Given the code is not used by any targets, remove the code.
2022-12-19Fix a bug in setjmp for MIPS o32/o64 FPXX/FP64Giovanni Bajo
It seems there is a swapped logic in one of the subcases of setjmp.S for MIPS: when the FPU registers are 64-bit within a 32-bit aligned jmp_buf, the code realigns the pointers before doing 64-bit writes, but the branch logic is swapped: we must avoid the address adjustement when bit 2 is zero (that is, the address is already 8-byte aligned). This always triggers an address error when run, as tested on a MIPS VR4300 with O64 ABI.
2022-12-13libc: arm: fix setjmp abi non-conformanceVictor L. Do Nascimento
As per the arm Procedure Call Standard for the Arm Architecture section 6.1.2 [1], VFP registers s16-s31 (d8-d15, q4-q7) must be preserved across subroutine calls. The current setjmp/longjmp implementations preserve only the core registers, with the jump buffer size too small to store the required co-processor registers. In accordance with the C Library ABI for the Arm Architecture section 6.11 [2], this patch sets _JBTYPE to long long adjusting _JBLEN to 20. It also emits vfp load/store instructions depending on architectural support, predicated at compile time on ACLE feature-test macros. [1] https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst [2] https://github.com/ARM-software/abi-aa/blob/main/clibabi32/clibabi32.rst
2022-11-23amdgcn: Use __builtin_gcn_ in libc/machine/amdgcn/getreent.cTobias Burnus
Call __builtin_gcn_get_stack_limit and __builtin_gcn_first_call_this_thread_p to reduce dependency on some register/layout assumptions by using the new GCC mainline (GCC 13) builtins, if they are available. If not, the existing code is used.
2022-11-21amdgcn: Replace asm("s8") by __builtin_gcn_kernarg_ptr if existingTobias Burnus
Check whether __builtin_gcn_kernarg_ptr is available and, if it is, call it instead using the hard-coded 'asm("s8")' in: * newlib/libc/machine/amdgcn/exit-value.h (exit_with_int) * newlib/libc/machine/amdgcn/mlock.c (sbrk) * newlib/libc/sys/amdgcn/write.c (write) newlib/libc/machine/amdgcn/exit-value.h | 6 ++++++ newlib/libc/machine/amdgcn/mlock.c | 10 +++++++--- newlib/libc/sys/amdgcn/write.c | 4 ++++ 3 files changed, 17 insertions(+), 3 deletions(-)
2022-11-10powerpc/setjmp: Fix 64-bit buffer alignmentSebastian Huber
The rlwinm is a word-size instruction which clears the remaining 32 bits of a 64-bit register. Use clrrdi in 64-bit configurations.
2022-10-28powerpc/setjmp: Fix 64-bit supportSebastian Huber
The first attempt to support the 64-bit mode had two bugs: 1. The saved general-purpose register 31 value was overwritten with the saved link register value. 2. The link register was saved and restored using 32-bit instructions. Use 64-bit store/load instructions to save/restore the link register. Make sure that the general-purpose register 31 and the link register storage areas do not overlap.
2022-09-24powerpc/setjmp: Add 64-bit supportSebastian Huber
Use 64-bit store/load instructions to save/restore the general-purpose registers.
2022-07-13Add _REENT_IS_NULL()Matt Joyce
In a follow up patch, struct _reent is optionally replaced by dedicated thread-local objects. In this case,_REENT is optionally defined to NULL. Add the _REENT_IS_NULL() macro to disable this check on demand.
2022-07-13Add _REENT_CLEANUP(ptr)Matt Joyce
Add a _REENT_CLEANUP() macro to encapsulate access to the __cleanup member of struct reent. This will help to replace the struct member with a thread-local storage object in a follow up patch.
2022-07-13Add _REENT_STDERR(ptr)Matt Joyce
Add a _REENT_STDERR() macro to encapsulate access to the _stderr member of struct reent. This will help to replace the struct member with a thread-local storage object in a follow up patch.
2022-07-13Add _REENT_STDOUT(ptr)Matt Joyce
Add a _REENT_STDOUT() macro to encapsulate access to the _stdout member of struct reent. This will help to replace the struct member with a thread-local storage object in a follow up patch.
2022-07-13Add _REENT_STDIN(ptr)Matt Joyce
Add a _REENT_STDIN() macro to encapsulate access to the _stdin member of struct reent. This will help to replace the struct member with a thread-local storage object in a follow up patch.
2022-07-13Add _REENT_ERRNO(ptr)Matt Joyce
Add a _REENT_ERRNO() macro to encapsulate the access to the _errno member of struct reent. This will help to replace the structure member with a thread-local storage object in a follow up patch. Replace uses of __errno_r() with _REENT_ERRNO(). Keep __errno_r() macro for potential users outside of Newlib.
2022-05-04Remove _global_impure_ptr indirectionSebastian Huber
Remove the pointer indirection through the read-only _global_impure_ptr and directly use a externally visible _impure_data object of type struct _reent. This enables the static initialization of global data structures in a follow up patch. In addition, we get rid of a machine-specific file.
2022-04-01newlib: Remove superfluous CHECK_STD_INIT() macroSebastian Huber
This macro is unused or expands to nothing.
2022-03-23amdgcn: Fix build failureAndrew Stubbs
The recent makefile reorganization broke the amdgcn port by creating duplicate __malloc_lock symbols. This patch fixes the problem by renaming the malloc_support.c file to mlock.c, thus overriding the default symbol properly. Actually, I'm not sure how this ever worked?
2022-03-17newlib: libc: merge build up a directoryMike Frysinger
Convert all the libc/ subdir makes into the top-level Makefile. This allows us to build all of libc from the top Makefile without using any recursive make calls. This is faster and avoids the funky lib.a logic where we unpack subdir archives to repack into a single libc.a. The machine override logic is maintained though by way of Makefile include ordering, and source file accumulation in libc_a_SOURCES. There's a few dummy.c files that are no longer necessary since we aren't doing the lib.a accumulating, so punt them. The winsup code has been pulling the internal newlib ssp library out, but that doesn't exist anymore, so change that to pull the objects.
2022-03-14newlib: xstormy16: move malloc multiplex logic from build to source filesMike Frysinger
Rather than define per-object rules in the Makefile, have small files that define & include the right content. This simplifies the build rules, and makes understanding the source a little easier (imo) as it makes all the subdirs behave the same: you have 1 source file and it produces 1 object. It's also about the same amount of boiler plate, without having to define custom build rules that can fall out of sync. We also realign the free & pvalloc definitions: common code puts these in malloc.o & valloc.o respectively, not in free.o & pvalloc.o objects. This will also be important as we merge the libc.a build into the top dir since it relies on a single flat list of objects for overrides.